Skip to content

Commit 1552085

Browse files
committed
Update publish action
1 parent a002870 commit 1552085

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/release-node.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,18 @@ jobs:
3434
run: cd crates/node-litesvm/ && ls -R ./npm
3535
- name: Publish
3636
run: |
37-
cd crates/node-litesvm/
38-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
39-
npm publish --access public
37+
npm config set provenance true
38+
if git log -1 --pretty=%B | grep "^node-v[0-9]\+\.[0-9]\+\.[0-9]\+$";
39+
then
40+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
41+
npm publish --access public
42+
elif git log -1 --pretty=%B | grep "^node-v[0-9]\+\.[0-9]\+\.[0-9]\+";
43+
then
44+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
45+
npm publish --tag next --access public
46+
else
47+
echo "Not a release, skipping publish"
48+
fi
4049
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)