]> 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 17:34:52 +0000 (18:34 +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.

(cherry picked from commit 8d548cbb58492a929a5c520b03ae1eefce204dbb)

.gitlab-ci.yml

index eaec374bb78c445d10163faf5d1e75e8906aa6c7..e242f996d95a236f9d75ff1711a0d510cb26419e 100644 (file)
@@ -1565,19 +1565,18 @@ release:
   <<: *base_image
   stage: release
   script:
-    - export BIND_DIRECTORY="$(basename 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 "../${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 "../${BIND_VERSION}.tar.xz" .
+    - tar --extract --file="${BIND_VERSION}.tar.xz" --strip-components=1 "${BIND_VERSION}"/{COPYRIGHT,LICENSE,README.md,srcid}
     - mv "../doc/arm/_build/html" doc/arm/
     - mv "../doc/arm/_build/latex/Bv9ARM.pdf" doc/arm/
     - mv "../doc/arm/_build/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
@@ -1590,7 +1589,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
@@ -1600,7 +1599,7 @@ sign:
   tags:
     - signer
   script:
-    - export RELEASE_DIRECTORY="$(echo *-release)"
+    - export RELEASE_DIRECTORY="bind-${CI_COMMIT_TAG}-release"
     - pushd "${RELEASE_DIRECTORY}"
     - |
       echo