diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 05e2d7cf..ef074941 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -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 diff --git a/npm/package.json b/npm/package.json index 0b43ce76..d4a82e17 100644 --- a/npm/package.json +++ b/npm/package.json @@ -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",