From 8c369fdf2331b4a05b13b8fa0fef8fba22e82671 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 14:14:39 +0200 Subject: [PATCH 01/14] Add ADA_VERSION which can be automatically set by Github action --- ada/ada | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ada/ada b/ada/ada index 83ba47d..0abc43b 100755 --- a/ada/ada +++ b/ada/ada @@ -295,6 +295,8 @@ get_permissions () { # Set default values and initialize variables # set_defaults() { + # The ADA_VERSION value will be automatically updated by a Github Action + ADA_VERSION='unknown' api= debug=false dry_run=false @@ -393,9 +395,7 @@ get_args() { usage ;; --version ) - git_dir=$(dirname "${script_dir}") - _VERSION_PLACEHOLDER=$(git --git-dir="${git_dir}/.git" describe --tags --abbrev=0 2>/dev/null || echo "v3.0+") - echo "${_VERSION_PLACEHOLDER}" + echo "$ADA_VERSION" exit 1 ;; --tokenfile ) From 31688dfb4feddf901a8e21f3ad2be8a0cc0c07d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Oct 2025 12:21:16 +0000 Subject: [PATCH 02/14] Set version to 123-provide-reliable-ada---version --- ada/ada | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ada/ada b/ada/ada index 0abc43b..64493fa 100755 --- a/ada/ada +++ b/ada/ada @@ -296,7 +296,7 @@ get_permissions () { # set_defaults() { # The ADA_VERSION value will be automatically updated by a Github Action - ADA_VERSION='unknown' + ADA_VERSION="123-provide-reliable-ada---version" api= debug=false dry_run=false From cdd32be3acb34e06ec8d6913e7830e4149eb5f10 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 14:28:20 +0200 Subject: [PATCH 03/14] Changed comment Because I need to check if the version update works --- ada/ada | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ada/ada b/ada/ada index 64493fa..5347c5a 100755 --- a/ada/ada +++ b/ada/ada @@ -295,7 +295,7 @@ get_permissions () { # Set default values and initialize variables # set_defaults() { - # The ADA_VERSION value will be automatically updated by a Github Action + # The ADA_VERSION value will be automatically updated by Github Action Update-ada-version.yml ADA_VERSION="123-provide-reliable-ada---version" api= debug=false From 1184c86799c976c57ef7bbcd1cb2d941aa4ec15b Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 14:54:45 +0200 Subject: [PATCH 04/14] When pushing branch, add commit hash to the version. --- .github/workflows/Update-ada-version.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Update-ada-version.yml b/.github/workflows/Update-ada-version.yml index f56d217..1a12c07 100644 --- a/.github/workflows/Update-ada-version.yml +++ b/.github/workflows/Update-ada-version.yml @@ -21,7 +21,9 @@ jobs: if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then VERSION="${GITHUB_REF_NAME}" elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then - VERSION=$(git rev-parse --abbrev-ref HEAD) + BRANCH=$(git rev-parse --abbrev-ref HEAD) + COMMIT=$(git rev-parse --short HEAD) + VERSION="${BRANCH}+${COMMIT}" else VERSION="${GITHUB_REF_NAME}" fi From f96cc82218397480c3d78fc7563a05e73c40ebdb Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 15:13:10 +0200 Subject: [PATCH 05/14] Reset version number to test Github Action --- ada/ada | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ada/ada b/ada/ada index 5347c5a..384d366 100755 --- a/ada/ada +++ b/ada/ada @@ -296,7 +296,7 @@ get_permissions () { # set_defaults() { # The ADA_VERSION value will be automatically updated by Github Action Update-ada-version.yml - ADA_VERSION="123-provide-reliable-ada---version" + ADA_VERSION="unknown" api= debug=false dry_run=false From b0822c105e8f87f4df7b7696471575e1412c4ab3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Oct 2025 13:13:51 +0000 Subject: [PATCH 06/14] Set version to 123-provide-reliable-ada---version --- ada/ada | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ada/ada b/ada/ada index 384d366..5347c5a 100755 --- a/ada/ada +++ b/ada/ada @@ -296,7 +296,7 @@ get_permissions () { # set_defaults() { # The ADA_VERSION value will be automatically updated by Github Action Update-ada-version.yml - ADA_VERSION="unknown" + ADA_VERSION="123-provide-reliable-ada---version" api= debug=false dry_run=false From 9d9518d7c3e02f04b7793ea044f8cd896b8ecfd7 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 15:18:29 +0200 Subject: [PATCH 07/14] Add commit hash to version also on branch push --- .github/workflows/Update-ada-version.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/Update-ada-version.yml b/.github/workflows/Update-ada-version.yml index 1a12c07..c25672c 100644 --- a/.github/workflows/Update-ada-version.yml +++ b/.github/workflows/Update-ada-version.yml @@ -20,12 +20,10 @@ jobs: run: | if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then VERSION="${GITHUB_REF_NAME}" - elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then + else BRANCH=$(git rev-parse --abbrev-ref HEAD) COMMIT=$(git rev-parse --short HEAD) VERSION="${BRANCH}+${COMMIT}" - else - VERSION="${GITHUB_REF_NAME}" fi echo "Using version identifier: ${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV From b6cc626e76c3c5d977f261fd0747e5a9f80d675e Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 15:40:04 +0200 Subject: [PATCH 08/14] Remove commit hash from the version number Adding the commit hash to the version number was a bad idea, because all the time the remote has a commit extra compared to your local branch. Then you get the error: "Updates were rejected because the remote contains work that you do not have locally." You can solve that by doing git push --force, but it's not very convenience (and probably not quite safe) to do that with every push. --- .github/workflows/Update-ada-version.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Update-ada-version.yml b/.github/workflows/Update-ada-version.yml index c25672c..ac93be8 100644 --- a/.github/workflows/Update-ada-version.yml +++ b/.github/workflows/Update-ada-version.yml @@ -22,8 +22,7 @@ jobs: VERSION="${GITHUB_REF_NAME}" else BRANCH=$(git rev-parse --abbrev-ref HEAD) - COMMIT=$(git rev-parse --short HEAD) - VERSION="${BRANCH}+${COMMIT}" + VERSION="${BRANCH}" fi echo "Using version identifier: ${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV From d76b0bfee797d41028d4f7548de83c7ae13d1cef Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 15:45:32 +0200 Subject: [PATCH 09/14] Pushing something to test what the Github action does --- ada/ada | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ada/ada b/ada/ada index 5347c5a..9b9b53d 100755 --- a/ada/ada +++ b/ada/ada @@ -295,7 +295,7 @@ get_permissions () { # Set default values and initialize variables # set_defaults() { - # The ADA_VERSION value will be automatically updated by Github Action Update-ada-version.yml + # The ADA_VERSION value will be automatically updated by Github action Update-ada-version.yml ADA_VERSION="123-provide-reliable-ada---version" api= debug=false From db31a0051ec5e2cecb76cc57b60ae27c7990dfc3 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Thu, 9 Oct 2025 15:49:10 +0200 Subject: [PATCH 10/14] Add comments to explain the ADA_VERSION values --- ada/ada | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ada/ada b/ada/ada index 9b9b53d..bf4be74 100755 --- a/ada/ada +++ b/ada/ada @@ -296,6 +296,8 @@ get_permissions () { # set_defaults() { # The ADA_VERSION value will be automatically updated by Github action Update-ada-version.yml + # For a release, it will contain the version number (like v3.1). + # For a branch, it will contain the branch name. ADA_VERSION="123-provide-reliable-ada---version" api= debug=false From 1705bbe10d01bc40f8e32c229646f1cf638d9390 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Mon, 13 Oct 2025 16:44:23 +0200 Subject: [PATCH 11/14] Clean up update-version-file.yml and ada-version They are from a previous effort to automate version info --- .github/workflows/update-version-file.yml | 40 ----------------------- ada/etc/ada-version | 1 - 2 files changed, 41 deletions(-) delete mode 100644 .github/workflows/update-version-file.yml delete mode 100644 ada/etc/ada-version diff --git a/.github/workflows/update-version-file.yml b/.github/workflows/update-version-file.yml deleted file mode 100644 index a8b984f..0000000 --- a/.github/workflows/update-version-file.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Sync ada-version file - -on: - push: - tags: - - 'v*' # run automatically when a tag is pushed - workflow_dispatch: # allow manual trigger in Github UI - -jobs: - update-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # we need full tag history - - - name: Determine version - run: | - if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then - # Get the latest tag from Git - VERSION=$(git describe --tags --abbrev=0) - else - # Use the tag that triggered the workflow - VERSION="${GITHUB_REF_NAME}" - fi - echo "Detected version: ${VERSION}" - echo "VERSION=${VERSION}" >> $GITHUB_ENV - - - name: Write ada-version file - run: | - mkdir -p ada/etc - echo "${VERSION}" > ada/etc/ada-version - - - name: Commit and push ada-version - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add ada/etc/ada-version - git commit -m "Update ada-version to ${VERSION}" || echo "No changes" - git push diff --git a/ada/etc/ada-version b/ada/etc/ada-version deleted file mode 100644 index 8616689..0000000 --- a/ada/etc/ada-version +++ /dev/null @@ -1 +0,0 @@ -v3.1 From 783bddd5390c799220887d647fae553cbf39219c Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Wed, 15 Oct 2025 16:53:11 +0200 Subject: [PATCH 12/14] Rename Update-ada-version.yml for consistency; improved sed command * Renamed Update-ada-version.yml to update-ada-version.yml, because existing actions don't have capitals in their name either * Changed sed command to be more compatible with MacOS: sed -i expression file -> sed expression -i file --- .../{Update-ada-version.yml => update-ada-version.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{Update-ada-version.yml => update-ada-version.yml} (94%) diff --git a/.github/workflows/Update-ada-version.yml b/.github/workflows/update-ada-version.yml similarity index 94% rename from .github/workflows/Update-ada-version.yml rename to .github/workflows/update-ada-version.yml index ac93be8..9dc87ca 100644 --- a/.github/workflows/Update-ada-version.yml +++ b/.github/workflows/update-ada-version.yml @@ -29,7 +29,7 @@ jobs: - name: Update version in ada script run: | - sed -i "s/ADA_VERSION=.*/ADA_VERSION=\"${VERSION}\"/" ada/ada + sed "s/ADA_VERSION=.*/ADA_VERSION=\"${VERSION}\"/" -i ada/ada - name: Commit and push updated ada script run: | From 2e8352aadfe0f13cb973603325146bde5fac0e50 Mon Sep 17 00:00:00 2001 From: Onno Zweers Date: Wed, 15 Oct 2025 17:02:47 +0200 Subject: [PATCH 13/14] ${GITHUB_REF_NAME} already is either a tag or a branch name; if statement unnecessary. Thanks Haili for reading the documentation :-) --- .github/workflows/update-ada-version.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/update-ada-version.yml b/.github/workflows/update-ada-version.yml index 9dc87ca..445f8bd 100644 --- a/.github/workflows/update-ada-version.yml +++ b/.github/workflows/update-ada-version.yml @@ -18,12 +18,7 @@ jobs: - name: Determine version or branch run: | - if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then - VERSION="${GITHUB_REF_NAME}" - else - BRANCH=$(git rev-parse --abbrev-ref HEAD) - VERSION="${BRANCH}" - fi + VERSION="${GITHUB_REF_NAME}" echo "Using version identifier: ${VERSION}" echo "VERSION=${VERSION}" >> $GITHUB_ENV From 900ee47719749da15ffc9de8a16098c442948d3e Mon Sep 17 00:00:00 2001 From: Haili Hu Date: Wed, 22 Oct 2025 15:31:23 +0200 Subject: [PATCH 14/14] Make update_ada_version.yml work on MacOS and UNIX --- .../{update-ada-version.yml => update_ada_version.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{update-ada-version.yml => update_ada_version.yml} (92%) diff --git a/.github/workflows/update-ada-version.yml b/.github/workflows/update_ada_version.yml similarity index 92% rename from .github/workflows/update-ada-version.yml rename to .github/workflows/update_ada_version.yml index 445f8bd..1fb048a 100644 --- a/.github/workflows/update-ada-version.yml +++ b/.github/workflows/update_ada_version.yml @@ -24,7 +24,7 @@ jobs: - name: Update version in ada script run: | - sed "s/ADA_VERSION=.*/ADA_VERSION=\"${VERSION}\"/" -i ada/ada + sed -i".tmp" "s/ADA_VERSION=.*/ADA_VERSION=\"${VERSION}\"/" ada/ada - name: Commit and push updated ada script run: |