From 1d402d2c5fe4eb6cde8f7347ba06ed6c22b94a68 Mon Sep 17 00:00:00 2001 From: Intubun <41478036+Intubun@users.noreply.github.com> Date: Wed, 6 May 2026 10:38:06 +0200 Subject: [PATCH] npm: stamp version as base-YYYYMMDD.hash on every CI build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/npm-publish.yml | 10 +++++++--- npm/package.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) 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",