-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (30 loc) · 981 Bytes
/
release.yml
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
40
name: NPM Package Release
on:
release:
types: [published]
jobs:
publish:
name: Build & Publish to NPM Registry
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
permissions:
contents: read # Allow reading repository contents
id-token: write # Allow writing an OIDC token for authentication
steps:
- uses: actions/checkout@v4 # Check out the repository code
- name: Set up Node.js environment (v${{ matrix.node-version }})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install project dependencies
run: npm ci
- name: Build production package
run: npm run build --if-present
- name: Publish package to NPM Registry
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}