-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (32 loc) · 918 Bytes
/
publish.yml
File metadata and controls
39 lines (32 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Publish release on npmjs
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for OIDC
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org'
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
- name: Publish to npm
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
npm publish --tag beta --provenance --access public
else
npm publish --tag latest --provenance --access public
fi