Skip to content

Commit c843f5c

Browse files
Fix workflow version detection to use git tags for releases
- Implement git tag detection in GitHub workflow for non-PR builds - Match CMakeLists.txt logic exactly for consistent versioning - Update buildspec.json to 0.6.0 for proper artifact generation - Resolves missing Linux artifacts and wrong version numbers in releases
1 parent d833eba commit c843f5c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/build-project.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ jobs:
6969
plugin_name="$(jq -r '.name' buildspec.json)"
7070
plugin_display_name="$(jq -r '.displayName // empty' buildspec.json)"
7171
72-
# For PR builds, calculate the same development version that CMake uses
72+
# Version resolution logic - match CMakeLists.txt behavior exactly
7373
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
74-
# Match CMake logic: MAJOR.MINOR.(9000 + GITHUB_RUN_NUMBER)
74+
# For PR builds, calculate the same development version that CMake uses
7575
base_version="$(jq -r '.version' buildspec.json)"
7676
IFS='.' read -r major minor patch <<< "${base_version}"
7777
if [[ -n "${GITHUB_RUN_NUMBER}" ]]; then
@@ -82,7 +82,15 @@ jobs:
8282
plugin_version="${major}.${minor}.999"
8383
fi
8484
else
85-
plugin_version="$(jq -r '.version' buildspec.json)"
85+
# For non-PR builds, use git tag detection (same logic as CMakeLists.txt)
86+
git_version_tag=$(git describe --tags --always --dirty 2>/dev/null || echo "")
87+
if [[ "${git_version_tag}" =~ ^v?([0-9]+\.[0-9]+\.[0-9]+) ]]; then
88+
# Extract version number from tag (e.g., "v1.2.3" -> "1.2.3", "1.2.3-dirty" -> "1.2.3")
89+
plugin_version=$(echo "${git_version_tag}" | sed -E 's/^v?([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
90+
else
91+
# Fallback to buildspec.json version if no proper git tag is available
92+
plugin_version="$(jq -r '.version' buildspec.json)"
93+
fi
8694
fi
8795
8896
if [[ "${plugin_display_name}" ]]; then

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"name": "c64stream",
4040
"displayName": "C64 Stream",
41-
"version": "0.5.1",
41+
"version": "0.6.0",
4242
"author": "Chris Gleissner",
4343
"website": "https://chrisgleissner.github.io/c64stream",
4444
"email": "[email protected]"

0 commit comments

Comments
 (0)