Skip to content

Commit

Permalink
Merge pull request #22 from ciatph/feat/ciatph-18
Browse files Browse the repository at this point in the history
feat: publish npm package with provenance
  • Loading branch information
ciatph authored Jan 24, 2025
2 parents 1202301 + 0e06bb9 commit 6e3e64c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ on:

jobs:
publish-npm:
if: github.event.release.target_commitish == 'master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout the repository
uses: actions/checkout@v3
with:
node-version: 16
ref: ${{ github.event.release.tag_name }}

# Use Node v20 (latest than v16) when publishing with provenance
- name: Use NodeJS v20.15.0
uses: actions/setup-node@v3
with:
node-version: 20.15.0
registry-url: https://registry.npmjs.org/
- run: npm publish

- name: Publish package
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 6e3e64c

Please sign in to comment.