Skip to content

Commit a9605db

Browse files
vrogojinclaude
andcommitted
Fix release workflow: anchor grep patterns to avoid AC_INIT line matches
The version extraction grep patterns were matching both the define() lines AND the AC_INIT line, producing multi-line values that broke GITHUB_OUTPUT. Fix by anchoring with ^define( and filtering with grep -v ALPHA for core version lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e6bfad0 commit a9605db

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
- name: Determine version
3333
id: version
3434
run: |
35-
MAJOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
36-
MINOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
37-
BUILD=$(grep 'define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
38-
CODENAME=$(grep '_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | sed 's/.*\[\(.*\)\].*/\1/')
39-
CORE_MAJOR=$(grep 'define(_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
40-
CORE_MINOR=$(grep 'define(_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
41-
CORE_BUILD=$(grep 'define(_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
35+
MAJOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | head -1 | grep -o '[0-9]*')
36+
MINOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | head -1 | grep -o '[0-9]*')
37+
BUILD=$(grep '^define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | head -1 | grep -o '[0-9]*')
38+
CODENAME=$(grep '^define(_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | head -1 | sed 's/.*\[\(.*\)\].*/\1/')
39+
CORE_MAJOR=$(grep '^define(_CLIENT_VERSION_MAJOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
40+
CORE_MINOR=$(grep '^define(_CLIENT_VERSION_MINOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
41+
CORE_BUILD=$(grep '^define(_CLIENT_VERSION_BUILD' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
4242
PKG_VERSION="${MAJOR}.${MINOR}.${BUILD}-${CODENAME}-core-${CORE_MAJOR}.${CORE_MINOR}.${CORE_BUILD}"
4343
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_OUTPUT
4444
echo "Package version: ${PKG_VERSION}"
@@ -114,13 +114,13 @@ jobs:
114114
- name: Determine version
115115
id: version
116116
run: |
117-
MAJOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
118-
MINOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
119-
BUILD=$(grep 'define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
120-
CODENAME=$(grep '_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | sed 's/.*\[\(.*\)\].*/\1/')
121-
CORE_MAJOR=$(grep 'define(_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
122-
CORE_MINOR=$(grep 'define(_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
123-
CORE_BUILD=$(grep 'define(_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
117+
MAJOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | head -1 | grep -o '[0-9]*')
118+
MINOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | head -1 | grep -o '[0-9]*')
119+
BUILD=$(grep '^define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | head -1 | grep -o '[0-9]*')
120+
CODENAME=$(grep '^define(_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | head -1 | sed 's/.*\[\(.*\)\].*/\1/')
121+
CORE_MAJOR=$(grep '^define(_CLIENT_VERSION_MAJOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
122+
CORE_MINOR=$(grep '^define(_CLIENT_VERSION_MINOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
123+
CORE_BUILD=$(grep '^define(_CLIENT_VERSION_BUILD' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
124124
PKG_VERSION="${MAJOR}.${MINOR}.${BUILD}-${CODENAME}-core-${CORE_MAJOR}.${CORE_MINOR}.${CORE_BUILD}"
125125
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_OUTPUT
126126
@@ -190,13 +190,13 @@ jobs:
190190
- name: Determine version
191191
id: version
192192
run: |
193-
MAJOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
194-
MINOR=$(grep 'define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
195-
BUILD=$(grep 'define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
196-
CODENAME=$(grep '_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | sed 's/.*\[\(.*\)\].*/\1/')
197-
CORE_MAJOR=$(grep 'define(_CLIENT_VERSION_MAJOR' configure.ac | grep -o '[0-9]*')
198-
CORE_MINOR=$(grep 'define(_CLIENT_VERSION_MINOR' configure.ac | grep -o '[0-9]*')
199-
CORE_BUILD=$(grep 'define(_CLIENT_VERSION_BUILD' configure.ac | grep -o '[0-9]*')
193+
MAJOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MAJOR' configure.ac | head -1 | grep -o '[0-9]*')
194+
MINOR=$(grep '^define(_ALPHA_CLIENT_VERSION_MINOR' configure.ac | head -1 | grep -o '[0-9]*')
195+
BUILD=$(grep '^define(_ALPHA_CLIENT_VERSION_BUILD' configure.ac | head -1 | grep -o '[0-9]*')
196+
CODENAME=$(grep '^define(_ALPHA_CLIENT_RELEASE_NAME_MAJOR' configure.ac | head -1 | sed 's/.*\[\(.*\)\].*/\1/')
197+
CORE_MAJOR=$(grep '^define(_CLIENT_VERSION_MAJOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
198+
CORE_MINOR=$(grep '^define(_CLIENT_VERSION_MINOR' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
199+
CORE_BUILD=$(grep '^define(_CLIENT_VERSION_BUILD' configure.ac | grep -v ALPHA | head -1 | grep -o '[0-9]*')
200200
PKG_VERSION="${MAJOR}.${MINOR}.${BUILD}-${CODENAME}-core-${CORE_MAJOR}.${CORE_MINOR}.${CORE_BUILD}"
201201
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_OUTPUT
202202

0 commit comments

Comments
 (0)