We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b5527b commit bccf33fCopy full SHA for bccf33f
.github/workflows/npm-publish.yml
@@ -0,0 +1,27 @@
1
+# Publish to npm whenever a release/prerelease is published
2
+name: Publish release to npm
3
+on:
4
+ release:
5
+ types: [published]
6
+
7
+jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v6
15
+ - uses: actions/setup-node@v6
16
+ with:
17
+ node-version: 24
18
+ registry-url: 'https://registry.npmjs.org'
19
+ - run: npm ci
20
+ - run: npm test
21
+ # Check if the release tag is a semver release (e.g., v1.2.3) or a pre-release (e.g., v1.2.3-alpha)
22
+ - run: |
23
+ if [[ ${{ github.event.release.tag_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
24
+ npm publish --provenance
25
+ else
26
+ npm publish --provenance --tag alpha
27
+ fi
0 commit comments