Accept release tags without v prefix in the WASM npm publish gate.

The AppImage release workflows trigger on any tag (the project tags
releases as e.g. 8.3.662, without a v prefix), but the npm publish
gate in main-wasm.yml required a v-prefixed tag, so a normal release
tag built the AppImages but never published the npm package to GitHub
Packages.  The gate now accepts both forms, so a single tag releases
everything.
This commit is contained in:
Enno Schnackenberg 2026-06-10 11:40:15 +02:00
parent a38fa29dac
commit a7f2a38d32
1 changed files with 10 additions and 9 deletions

View File

@ -2,15 +2,15 @@ name: CI-wasm
# Builds the Magic WebAssembly target (both the non-TCL and TCL variants) # Builds the Magic WebAssembly target (both the non-TCL and TCL variants)
# on every push and pull request as a CI check. **Publishing** only happens # on every push and pull request as a CI check. **Publishing** only happens
# when a release tag of the form v<x.y.z>... is pushed — that gate is the # when a release tag of the form <x.y.z>... (optionally v-prefixed) is
# manual release trigger: # pushed — the same tag that triggers the AppImage release workflows:
# #
# # bump magic/VERSION, commit, push to default branch # # bump magic/VERSION, commit, push to default branch
# git tag v8.3.638 # git tag 8.3.638
# git push origin v8.3.638 # git push origin 8.3.638
# #
# The tag name (minus the leading "v") provides the base; the workflow appends # The tag name (minus any leading "v") provides the base; the workflow appends
# the commit date and short SHA: v8.3.799 → 8.3.799020261231+git01234cde. # the commit date and short SHA: 8.3.799 → 8.3.799020261231+git01234cde.
# Forks publish under their own namespace via the @<owner>/ scope. # Forks publish under their own namespace via the @<owner>/ scope.
on: on:
@ -162,11 +162,12 @@ jobs:
done done
# The release gate. We publish a new npm version only when a tag of the # The release gate. We publish a new npm version only when a tag of the
# shape v<x.y.z>... is pushed. # shape <x.y.z>... (optionally v-prefixed) is pushed, matching the
# AppImage release workflows so one tag releases everything.
# #
# Version scheme (per dmiles' recommendation): # Version scheme (per dmiles' recommendation):
# {MAJOR}.{MINOR}.{PATCH}0{YYYYMMDD}+git{SHORT_SHA} # {MAJOR}.{MINOR}.{PATCH}0{YYYYMMDD}+git{SHORT_SHA}
# e.g. v8.3.799 pushed on 2026-12-31 → 8.3.799020261231+git01234cde # e.g. 8.3.799 pushed on 2026-12-31 → 8.3.799020261231+git01234cde
# #
# The leading zero between PATCH and date keeps the number readable and # The leading zero between PATCH and date keeps the number readable and
# ensures correct numeric ordering: 799020261231 < 800020261231. # ensures correct numeric ordering: 799020261231 < 800020261231.
@ -180,7 +181,7 @@ jobs:
date=$(git show -s --format=%cs | tr -d '-') date=$(git show -s --format=%cs | tr -d '-')
hash=$(git show -s --format=%h) hash=$(git show -s --format=%h)
if [ "${{ github.event_name }}" = "push" ] && \ if [ "${{ github.event_name }}" = "push" ] && \
echo "${{ github.ref }}" | grep -Eq '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+'; then echo "${{ github.ref }}" | grep -Eq '^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+'; then
tag="${GITHUB_REF#refs/tags/}" tag="${GITHUB_REF#refs/tags/}"
base="${tag#v}" base="${tag#v}"
echo "publish=true" >> "$GITHUB_OUTPUT" echo "publish=true" >> "$GITHUB_OUTPUT"