Skip to content

Commit 2c1bae2

Browse files
committed
ci: add release workflow with npm OIDC provenance
1 parent 4aa9594 commit 2c1bae2

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (e.g. patch, minor, major, or explicit like 1.0.0). Leave empty for conventional-commits auto-detect.'
8+
required: false
9+
10+
permissions:
11+
contents: write
12+
id-token: write
13+
14+
jobs:
15+
checks:
16+
uses: ./.github/workflows/checks.yml
17+
18+
release:
19+
needs: checks
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 24
29+
registry-url: 'https://registry.npmjs.org'
30+
31+
- name: git config
32+
run: |
33+
git config user.name "${GITHUB_ACTOR}"
34+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
35+
36+
- run: npm install
37+
38+
- name: Release
39+
run: npm run release -- --ci ${{ inputs.version }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@
107107
],
108108
"publishConfig": {
109109
"access": "public",
110-
"tag": "latest"
110+
"tag": "latest",
111+
"provenance": true
111112
},
112113
"release-it": {
113114
"git": {

0 commit comments

Comments
 (0)