Skip to content

Commit 87bd6c9

Browse files
committed
task: update onRelease to support trusted publishing
1 parent d254e46 commit 87bd6c9

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

.github/workflows/onRelease.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,37 @@ on:
1010
description: tag that needs to publish
1111
type: string
1212
required: true
13+
1314
jobs:
1415
npm:
15-
uses: oclif/github-workflows/.github/workflows/npmPublish.yml@main
16-
with:
17-
tag: latest
18-
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
19-
secrets: inherit
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
id-token: write
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ github.event.release.tag_name || inputs.tag }}
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: lts/*
30+
registry-url: 'https://registry.npmjs.org'
31+
cache: yarn
32+
33+
- name: Upgrade npm for trusted publishing
34+
run: npm install -g npm@^11.5.1
35+
36+
- name: Install dependencies
37+
run: yarn install --frozen-lockfile
38+
39+
- name: Build
40+
run: yarn build
41+
42+
- name: Generate oclif manifest
43+
run: yarn prepack
44+
45+
- name: Publish to npm
46+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)