From 8d548cbb58492a929a5c520b03ae1eefce204dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Wed, 22 Oct 2025 09:45:29 +0200 Subject: [PATCH] Revise release directory naming Include the Git tag in the name of the release directory rather than just the version number. Revise the script for the "release" job accordingly. This enables using the $CI_COMMIT_TAG variable in job scripts without the need to resort to string manipulation to strip the leading "v", improving readability. The only place where string manipulation is applied to the Git tag is now the "release" job itself, to verify that the Git tag matches the version number embedded in the source tarball name. --- .gitlab-ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c153c63ae3..8ee438ad33 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1615,18 +1615,17 @@ release: <<: *base_image stage: release script: - - export BIND_DIRECTORY="$(basename build/meson-dist/bind-*.tar.xz ".tar.xz")" + - export RELEASE_DIRECTORY="bind-${CI_COMMIT_TAG}-release" + - export BIND_VERSION="bind-${CI_COMMIT_TAG#v}" # Prepare release tarball contents (tarballs + documentation) - - mkdir -p "${BIND_DIRECTORY}-release/doc/arm" - - pushd "${BIND_DIRECTORY}-release" - - mv "../build/meson-dist/${BIND_DIRECTORY}.tar.xz" . - - tar --extract --file="${BIND_DIRECTORY}.tar.xz" - - mv "${BIND_DIRECTORY}"/{COPYRIGHT,LICENSE,README.md,srcid} . - - rm -rf "${BIND_DIRECTORY}" + - mkdir -p "${RELEASE_DIRECTORY}/doc/arm" + - pushd "${RELEASE_DIRECTORY}" + - mv "../build/meson-dist/${BIND_VERSION}.tar.xz" . + - tar --extract --file="${BIND_VERSION}.tar.xz" --strip-components=1 "${BIND_VERSION}"/{COPYRIGHT,LICENSE,README.md,srcid} - mv ../build/arm/ doc/arm/html/ - mv ../build/arm-epub/Bv9ARM.epub doc/arm/ - - echo 'Redirect' > "RELEASE-NOTES-${BIND_DIRECTORY}.html" - - echo 'Redirect' > "CHANGELOG-${BIND_DIRECTORY}.html" + - echo 'Redirect' > "RELEASE-NOTES-${BIND_VERSION}.html" + - echo 'Redirect' > "CHANGELOG-${BIND_VERSION}.html" - popd needs: - job: tarball-create @@ -1637,7 +1636,7 @@ release: - *rule_tag artifacts: paths: - - "*-release" + - bind-${CI_COMMIT_TAG}-release expire_in: "1 month" # Job signing the source tarballs in the release directory @@ -1647,7 +1646,7 @@ sign: tags: - signer script: - - export RELEASE_DIRECTORY="$(echo *-release)" + - export RELEASE_DIRECTORY="bind-${CI_COMMIT_TAG}-release" - pushd "${RELEASE_DIRECTORY}" - | echo