Skip to content

Commit e8f63b9

Browse files
authored
Merge pull request #263 from postmanlabs/feature/npm-release
feat: add npm release action
2 parents 1e3e966 + 205f905 commit e8f63b9

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/pkg-release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Package Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to publish (e.g. v1.2.3)'
11+
required: true
12+
type: string
13+
14+
# OIDC trusted publishing — no NPM token needed
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
jobs:
20+
npm-publish:
21+
name: Publish to npm
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout (the tag being released)
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag }}
28+
29+
- name: Set up Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '22'
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Upgrade npm for OIDC trusted publishing (needs npm >= 11.5.1)
36+
run: npm install -g npm@latest
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Publish to npm
42+
run: npm publish # authenticates via OIDC; provenance added automatically

0 commit comments

Comments
 (0)