build: four-part releaseVersion (2.0.0.1) injected at packaging time

electron-builder refuses a non-semver package.json version, so the published
number lives in package.json releaseVersion and scripts/dist.mjs passes it as
extraMetadata.version (plus the hotfix digit as Windows build number). The
workflow tags and names the release from the same field.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
This commit is contained in:
Claude committed 2026-09-03 15:47:32 +00:00
1 parent 35437e2d51
commit 2471add00b
4 files changed
+23 -6

No files matched your search

+2 -2
View File
@@ -43,7 +43,7 @@ jobs:
id: ver
shell: bash
run: |
version=$(node -p "require('./package.json').version")
version=$(node -p "const p=require('./package.json'); p.releaseVersion || p.version")
echo "version=$version" >> "$GITHUB_OUTPUT"
# Fourth component (hotfix number, e.g. 2.0.0.1) becomes the Windows file build number.
echo "build=$(echo "$version" | cut -d. -f4)" >> "$GITHUB_OUTPUT"
@@ -54,7 +54,7 @@ jobs:
fi
- run: npm run build
- name: Package Windows EXE
run: npx electron-builder --win --publish never
run: npm run dist -- --win --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_NUMBER: ${{ steps.ver.outputs.build }}