]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Revise release directory naming
authorMichał Kępień <michal@isc.org>
Wed, 22 Oct 2025 07:45:29 +0000 (09:45 +0200)
committerAndoni Duarte Pintado <andoni@isc.org>
Mon, 27 Oct 2025 13:00:04 +0000 (14:00 +0100)
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

index c153c63ae35d6decf8f07b87c30d8ee013c0ce83..8ee438ad33f08d80f3f6a483311a31793bd3a5ff 100644 (file)
@@ -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 '<!DOCTYPE HTML><html lang="en"><meta http-equiv="refresh" content="0; url=doc/arm/html/notes.html"><title>Redirect</title></html>' > "RELEASE-NOTES-${BIND_DIRECTORY}.html"
-    - echo '<!DOCTYPE HTML><html lang="en"><meta http-equiv="refresh" content="0; url=doc/arm/html/changelog.html"><title>Redirect</title></html>' > "CHANGELOG-${BIND_DIRECTORY}.html"
+    - echo '<!DOCTYPE HTML><html lang="en"><meta http-equiv="refresh" content="0; url=doc/arm/html/notes.html"><title>Redirect</title></html>' > "RELEASE-NOTES-${BIND_VERSION}.html"
+    - echo '<!DOCTYPE HTML><html lang="en"><meta http-equiv="refresh" content="0; url=doc/arm/html/changelog.html"><title>Redirect</title></html>' > "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