Skip to content

Commit

Permalink
ci: sets up automated publishing with provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Jan 29, 2024
1 parent de728a7 commit 8288277
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish pre-releases as beta to npmjs
on:
release:
types: [prereleased]

jobs:
publish-as-beta:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 21.x
registry-url: https://registry.npmjs.org
- run: npm clean-install
- run: npm publish --provenance --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish to npmjs
on:
release:
types: [released]

jobs:
publish-as-latest:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 21.x
registry-url: https://registry.npmjs.org
- run: npm clean-install
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 8288277

Please sign in to comment.