Skip to content

Commit f845287

Browse files
authored
Support Trusted Publishing (#1629)
1 parent 3c7ed31 commit f845287

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/actions/setup/action.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: 'Setup'
1+
name: Setup
2+
description: Install toolchain for this repo CI tasks
23
inputs:
34
node-version:
4-
description: 'Specific node version'
5+
description: "Specific node version"
56
required: false
67
runs:
7-
using: 'composite'
8+
using: composite
89
steps:
910
- name: Install pnpm
1011
uses: pnpm/action-setup@v4
@@ -13,11 +14,11 @@ runs:
1314
uses: actions/setup-node@v5
1415
with:
1516
node-version: ${{ inputs.node-version }}
16-
node-version-file: '.node-version'
17-
cache: 'pnpm'
17+
node-version-file: ".node-version"
18+
cache: "pnpm"
1819
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
1920
# necessary for publish
20-
registry-url: 'https://registry.npmjs.org'
21+
registry-url: "https://registry.npmjs.org"
2122

2223
- name: Install dependencies
2324
run: pnpm install

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
branches:
1111
- main
1212
paths:
13-
- '.release-plan.json'
13+
- ".release-plan.json"
1414

1515
concurrency:
1616
group: publish-${{ github.head_ref || github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:
2020
publish:
21-
name: 'NPM Publish'
21+
name: "NPM Publish"
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: write
@@ -30,8 +30,10 @@ jobs:
3030
- uses: actions/checkout@v5
3131
- name: Setup
3232
uses: ./.github/actions/setup
33+
# we are doing this to make sure theat the gloabally installed npm is new enough to support OIDC
34+
- name: Install latest npm (for Trusted Publishing)
35+
run: npm install -g npm@latest
3336
- name: Publish to NPM
3437
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
3538
env:
3639
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
37-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)