Skip to content

Commit 6b3f286

Browse files
committed
Remove yarn caching + add version verification before publishing
1 parent 56a2585 commit 6b3f286

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ jobs:
2929
uses: actions/setup-node@v4
3030
with:
3131
node-version: "22.16.0"
32-
cache: "yarn"
33-
cache-dependency-path: |
34-
package.json
35-
yarn.lock
3632
registry-url: "https://registry.npmjs.org"
3733
- name: Install yarn package manager
3834
run: npm install --global yarn
@@ -51,6 +47,22 @@ jobs:
5147
run: |
5248
yarn run clean
5349
yarn run build
50+
- name: Verify package version matches tag
51+
run: |
52+
set -euo pipefail
53+
PKG_VERSION=$(node -p "require('./package.json').version")
54+
TAG="${{ github.event.release.tag_name }}"
55+
if [ -z "$TAG" ]; then TAG="${GITHUB_REF#refs/tags/}"; fi
56+
if [ -z "$TAG" ]; then
57+
echo "Error: could not determine release tag from github.event.release.tag_name or GITHUB_REF"
58+
exit 1
59+
fi
60+
TAG="${TAG#v}"
61+
if [ "$PKG_VERSION" != "$TAG" ]; then
62+
echo "Version mismatch: package.json=$PKG_VERSION tag=$TAG"
63+
exit 1
64+
fi
65+
echo "Version OK: $PKG_VERSION"
5466
- name: Publish to npm
5567
run: |
5668
npm publish .

.github/workflows/run_unit_tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ jobs:
7171
uses: actions/setup-node@v4
7272
with:
7373
node-version: "22.16.0"
74-
cache: "yarn"
75-
cache-dependency-path: |
76-
package.json
77-
yarn.lock
7874
- name: Install yarn package manager
7975
run: npm install --global yarn
8076
- name: Install dependencies

0 commit comments

Comments
 (0)