-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.31 KB
/
Copy pathpublish.yml
File metadata and controls
49 lines (39 loc) · 1.31 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
name: Publish to npm
# Trusted publishing (OIDC) with provenance — no npm token needed.
# Configure the trusted publisher on npm first:
# npmjs.com → package/account settings → Trusted Publisher
# Repository: KayhanB21/queue-economics Workflow: publish.yml
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write # required for OIDC trusted publishing + provenance
jobs:
publish:
runs-on: ubuntu-latest
# Deployment protection: requires the "release" GitHub environment (add
# required reviewers there). The npm trusted publisher must also set its
# "Environment name" field to "release" so the OIDC claim matches.
environment: release
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
# Trusted publishing requires npm >= 11.5.1.
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: bun install
- name: Test
run: bun test
- name: Build
run: bun run build
- name: Publish (provenance via OIDC)
run: npm publish --provenance --access public