default: image: debian:unstable variables: GIT_DEPTH: 0 stages: - bootstrap - build - upload - release pre-commit: stage: .pre variables: XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" before_script: - apt -qq update - apt -y -qq install git pre-commit script: - pre-commit run -a cache: key: $CI_JOB_NAME paths: - .cache/pre-commit bootstrap: stage: bootstrap before_script: - apt -qq update - apt -y -qq install autoconf automake autopoint gettext git libtool pkg-config wget script: - if test -d gnulib-src; then git -C gnulib-src pull; else git clone git://git.sv.gnu.org/gnulib gnulib-src; fi - rm -rf bootstrapped - mkdir bootstrapped - tar -cf - --exclude=bootstrapped . | tar -C bootstrapped -xf - - (cd bootstrapped && GNULIB_URL=../gnulib-src ./bootstrap) cache: paths: - gnulib-src/ artifacts: paths: - bootstrapped/ build-distcheck: stage: build before_script: - apt -qq update - apt -y -qq install build-essential bsdextrautils flex git groff libgdbm-dev libpipeline-dev pkg-config po4a zlib1g-dev script: - (cd bootstrapped && ./configure --enable-maintainer-mode) - make -C bootstrapped distcheck V=1 VERBOSE=1 artifacts: paths: - "bootstrapped/*.tar.xz" build-out-of-tree: stage: build before_script: - apt -qq update - apt -y -qq install build-essential bsdextrautils flex groff libgdbm-dev libpipeline-dev pkg-config po4a zlib1g-dev script: - mkdir -p bootstrapped/obj - (cd bootstrapped/obj && ../configure) - make -C bootstrapped/obj check V=1 VERBOSE=1 build-berkeley-db: stage: build before_script: - apt -qq update - apt -y -qq install build-essential bsdextrautils flex git groff libdb-dev libpipeline-dev pkg-config po4a zlib1g-dev script: - (cd bootstrapped && ./configure --with-db=db) - make -C bootstrapped check V=1 VERBOSE=1 build-ndbm: stage: build before_script: - apt -qq update # libgdbm-dev is needed here due to https://bugs.debian.org/1021123. - apt -y -qq install build-essential bsdextrautils flex git groff libgdbm-compat-dev libgdbm-dev libpipeline-dev pkg-config po4a zlib1g-dev script: - (cd bootstrapped && ./configure --with-db=ndbm) - make -C bootstrapped check V=1 VERBOSE=1 upload: stage: upload image: curlimages/curl:latest rules: - if: $CI_COMMIT_TAG script: - | curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "bootstrapped/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz" release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /-pre/ # Prepare description. The maintainer will need to download the tarball, # sign it, and reupload the tarball and its signature to Savannah. script: - | echo "Releasing ${CI_PROJECT_NAME} ${CI_COMMIT_TAG}." (echo "Changes" echo "-------" echo echo "$(tail -n+4 bootstrapped/NEWS.md | sed "/^${CI_PROJECT_NAME} /,\$d")" echo echo "Download (GPG key 0x393587D97D86500B)" echo "-------------------------------------" echo echo " * https://download.savannah.nongnu.org/releases/${CI_PROJECT_NAME}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz" printf %s " * https://download.savannah.nongnu.org/releases/${CI_PROJECT_NAME}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz.asc" ) >description.md release: tag_name: $CI_COMMIT_TAG description: './description.md'