Skip to content

Commit e6a3331

Browse files
authored
Merge pull request #4 from szhygulin/ci/trusted-publisher
Add npm publish workflow (Trusted Publisher / OIDC)
2 parents 950c908 + e002676 commit e6a3331

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: publish-${{ github.ref }}
10+
cancel-in-progress: false
11+
12+
jobs:
13+
publish:
14+
name: Publish
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
id-token: write
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.release.tag_name || github.ref }}
24+
25+
- name: Set up Node 22
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "22"
29+
registry-url: "https://registry.npmjs.org"
30+
cache: npm
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build
36+
run: npm run build
37+
38+
- name: Run tests
39+
run: npm test
40+
41+
- name: Publish
42+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)