From 5ad0bb53b40441db1fdc52817c19637efd9b81e3 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Thu, 26 Mar 2026 22:38:37 -0700 Subject: [PATCH] Derive release VERSION from clientversion.h instead of hardcoding Build jobs extract MAJOR.MINOR.REVISION from src/clientversion.h. Release job extracts from the git tag name. No more forgetting to update the workflow when bumping versions. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build-all.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index d8efc35..7c221b5 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -8,9 +8,6 @@ on: branches: [master] workflow_dispatch: -env: - VERSION: "5.3.9" - jobs: test-linux-unit: runs-on: ubuntu-22.04 @@ -149,6 +146,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set VERSION from source + run: | + MAJOR=$(grep 'CLIENT_VERSION_MAJOR' src/clientversion.h | awk '{print $3}') + MINOR=$(grep 'CLIENT_VERSION_MINOR' src/clientversion.h | awk '{print $3}') + REV=$(grep 'CLIENT_VERSION_REVISION' src/clientversion.h | awk '{print $3}') + echo "VERSION=${MAJOR}.${MINOR}.${REV}" >> $GITHUB_ENV + - name: Install dependencies run: | sudo apt-get update @@ -189,6 +193,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set VERSION from source + run: | + MAJOR=$(grep 'CLIENT_VERSION_MAJOR' src/clientversion.h | awk '{print $3}') + MINOR=$(grep 'CLIENT_VERSION_MINOR' src/clientversion.h | awk '{print $3}') + REV=$(grep 'CLIENT_VERSION_REVISION' src/clientversion.h | awk '{print $3}') + echo "VERSION=${MAJOR}.${MINOR}.${REV}" >> $GITHUB_ENV + - name: Install dependencies run: | sudo apt-get update @@ -225,6 +236,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set VERSION from source + run: | + MAJOR=$(grep 'CLIENT_VERSION_MAJOR' src/clientversion.h | awk '{print $3}') + MINOR=$(grep 'CLIENT_VERSION_MINOR' src/clientversion.h | awk '{print $3}') + REV=$(grep 'CLIENT_VERSION_REVISION' src/clientversion.h | awk '{print $3}') + echo "VERSION=${MAJOR}.${MINOR}.${REV}" >> $GITHUB_ENV + - name: Install dependencies run: | brew install qt@5 openssl@3 boost berkeley-db@5 leveldb libevent miniupnpc @@ -289,6 +307,9 @@ jobs: permissions: contents: write steps: + - name: Set VERSION from tag + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV + - name: Download all artifacts uses: actions/download-artifact@v4 with: