Skip to content

Commit

Permalink
Add support for npm provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Oct 18, 2023
1 parent e72e9b4 commit 5c67234
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,25 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn --immutable

- name: Generate archive
run: yarn pack

- name: Publish with latest tag
if: github.event.release.prelease == false
run: yarn npm publish --tag latest
run: npm publish package.tgz --tag latest --provenance
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish with next tag
if: github.event.release.prelease == true
run: yarn npm publish --tag next
run: npm publish package.tgz --tag next --provenance
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 5c67234

Please sign in to comment.