Skip to content

Commit 0873846

Browse files
author
Erik Rasmussen
committed
ci: add npm publish workflow on GitHub release
1 parent ed07005 commit 0873846

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
name: Publish to npm
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18+
19+
- name: Use Node.js 22
20+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
21+
with:
22+
node-version: "22"
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- name: Install dependencies
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Run tests
29+
run: yarn start test
30+
31+
- name: Build
32+
run: yarn start build
33+
34+
- name: Publish
35+
run: npm publish --provenance ${{ github.event.release.prerelease && '--tag next' || '' }}
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)