-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.4 KB
/
Copy pathrelease.yml
File metadata and controls
50 lines (41 loc) · 1.4 KB
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
41
42
43
44
45
46
47
48
49
50
name: Release
# Publishes to npm via Trusted Publishing (OIDC), no long-lived tokens.
# The package's Trusted Publisher on npm points at this repo + workflow,
# which is what the id-token: write permission below binds to.
# https://docs.npmjs.com/trusted-publishers/
# https://docs.npmjs.com/generating-provenance-statements
#
# Triggered when a v* tag is pushed:
# git tag v0.1.1 && git push --tags
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write # for creating the GitHub Release
id-token: write # for npm OIDC (provenance + trusted publishing)
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24
registry-url: https://registry.npmjs.org
cache: npm
# Trusted Publishing requires npm >= 11.5.1. Node 24 ships with npm 11.x,
# but pin to the latest explicitly so a runner image change never breaks
# publishes.
- name: Ensure npm >= 11.5.1 for Trusted Publishing
run: npm install -g npm@latest
- run: npm ci
- run: npm test
- run: npm run build
- name: Publish to npm (OIDC, provenance)
run: npm publish --provenance --access public
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true