Skip to content

Commit 9015b1a

Browse files
committed
Add release workflow
1 parent 576b5f1 commit 9015b1a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Release to npm
2+
on:
3+
release:
4+
types: [published]
5+
permissions: read-all
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
id-token: write
12+
steps:
13+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
14+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # 4.0.3
15+
with:
16+
node-version: "20"
17+
registry-url: 'https://registry.npmjs.org'
18+
- run: npm ci
19+
- run: npm test
20+
- if: ${{ github.event.release.tag_name != '' && env.NPM_PUBLISH_TAG != '' }}
21+
run: npm publish --provenance --access=public --tag=${{ env.NPM_PUBLISH_TAG }}
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
NPM_PUBLISH_TAG: ${{ contains(github.event.release.tag_name, '-alpha.') && 'canary' || 'latest' }}

0 commit comments

Comments
 (0)