Skip to content

Commit f6c39f5

Browse files
authored
task: update onRelease to support trusted publishing (#26)
**Description:** NPM classic token [has been revoked](https://github.blog/changelog/2025-12-09-npm-classic-tokens-revoked-session-based-auth-and-cli-token-management-now-available/#if-you-were-still-using-npm-classic-tokens) so we'll try to use the [Trusted Publishers](https://docs.npmjs.com/trusted-publishers) workflow to release.
1 parent d254e46 commit f6c39f5

File tree

5 files changed

+40
-401
lines changed

5 files changed

+40
-401
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

.github/workflows/test.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.mocharc.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,15 @@
2424
"zod": "^3.25.67"
2525
},
2626
"devDependencies": {
27-
"@oclif/test": "^4.1.13",
28-
"@types/chai": "^5.2.2",
29-
"@types/mocha": "^10.0.10",
3027
"@types/node": "^24.0.4",
3128
"@types/request": "^2.48.12",
3229
"@typescript-eslint/eslint-plugin": "^8.35.0",
3330
"@typescript-eslint/parser": "^8.35.0",
34-
"chai": "^5.2.0",
3531
"eslint": "^9.29.0",
3632
"eslint-config-prettier": "^10.1.5",
3733
"eslint-plugin-import": "^2.32.0",
3834
"eslint-plugin-jest": "^29.0.1",
3935
"eslint-plugin-prettier": "^5.5.1",
40-
"mocha": "^11.7.1",
4136
"oclif": "^4.20.1",
4237
"prettier": "^3.6.2",
4338
"shx": "^0.4.0",
@@ -63,7 +58,7 @@
6358
"postpack": "shx rm -f oclif.manifest.json",
6459
"posttest": "yarn lint",
6560
"prepack": "yarn build && oclif manifest && oclif readme",
66-
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
61+
"test": "echo \"No tests\"",
6762
"version": "oclif readme && git add README.md"
6863
},
6964
"engines": {

0 commit comments

Comments
 (0)