npm: stamp version as base-YYYYMMDD.hash on every CI build
Mirrors the AppImage versioning form (8.3.637~20260414~d157eea) as closely as semver allows: 8.3.637-20260414.d157eea. - package.json: placeholder 0.0.0-dev; CI always overwrites before pack - npm-publish.yml: version step now runs unconditionally (not just on tags), reading VERSION + git date + git hash — dry-run artifacts are stamped too, making them unambiguously traceable to their source commit
This commit is contained in:
parent
2d6a3a8ed6
commit
1d402d2c5f
|
|
@ -79,10 +79,14 @@ jobs:
|
|||
cp magic/magic.js npm/
|
||||
cp magic/magic.wasm npm/
|
||||
|
||||
- name: Set package version from tag
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
- name: Set package version
|
||||
run: |
|
||||
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||
base=$(cat VERSION) # e.g. 8.3.637
|
||||
date=$(git show -s --format=%cs | tr -d '-') # e.g. 20260414
|
||||
hash=$(git show -s --format=%h) # e.g. d157eea
|
||||
# npm requires semver; use pre-release syntax as the closest equivalent
|
||||
# to the AppImage form 8.3.637~20260414~d157eea
|
||||
VERSION="${base}-${date}.${hash}"
|
||||
cd npm
|
||||
npm version "$VERSION" --no-git-tag-version
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "magic-vlsi-wasm",
|
||||
"version": "8.3.637",
|
||||
"version": "0.0.0-dev",
|
||||
"description": "Magic VLSI Layout Tool — headless WebAssembly build",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
|
|
|
|||
Loading…
Reference in New Issue