Skip to content

Commit cb733e3

Browse files
committed
Switch to trusted publishing
1 parent e7aef1d commit cb733e3

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
78

89
permissions: {}
910

1011
jobs:
1112
release:
12-
name: Publish
13+
name: Publish latest
14+
if: github.event_name == 'push'
1315
permissions:
1416
id-token: write
1517
runs-on: ubuntu-latest
@@ -32,11 +34,48 @@ jobs:
3234
- name: Install dependencies
3335
run: pnpm install --frozen-lockfile
3436

37+
- name: Install latest npm
38+
run: npm install -g npm@latest
39+
3540
- name: Publish to npm
3641
uses: changesets/action@v1
3742
with:
3843
publish: pnpm run release
3944
version: pnpm run stage
4045
env:
4146
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
42-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
48+
snapshot:
49+
name: Publish Snapshot
50+
if: github.event_name == 'workflow_dispatch'
51+
permissions:
52+
id-token: write
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Check out repo
56+
uses: actions/checkout@v5
57+
with:
58+
fetch-depth: 0
59+
token: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
60+
61+
- name: Set up Node.js
62+
uses: actions/setup-node@v5
63+
with:
64+
node-version: 22.x
65+
package-manager-cache: false
66+
67+
- name: Set up pnpm
68+
run: corepack enable pnpm
69+
70+
- name: Install dependencies
71+
run: pnpm install --frozen-lockfile
72+
73+
- name: Install latest npm
74+
run: npm install -g npm@latest
75+
76+
- name: Publish to npm
77+
uses: seek-oss/changesets-snapshot@v0
78+
with:
79+
pre-publish: pnpm run build
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)