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 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 22:38:37 -07:00
parent 40d281c1ff
commit 9a3b643a5a
+24 -3
View File
@@ -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: