Skip to content

Commit 01f7cdc

Browse files
authored
ci: update deployment workflow to use npm trusted publishers (#1015)
1 parent 78d2197 commit 01f7cdc

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

.github/actions/setup/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ runs:
1717
node-version: ${{ inputs.node-version }}
1818
registry-url: ${{ inputs.registry-url }}
1919

20+
# Ensure npm 11.5.1 or later is installed
21+
# See https://docs.npmjs.com/trusted-publishers
22+
# Note that pnpm publish runs npm publish
23+
- name: Update npm
24+
shell: bash
25+
run: npm install -g npm@latest
26+
2027
# Install pnpm. https://github.com/pnpm/action-setup
2128
- uses: pnpm/action-setup@v4
2229
with:

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
17-
- uses: ./.github/actions/lint
1817
- uses: ./.github/actions/setup
18+
- uses: ./.github/actions/lint
1919
- uses: ./.github/actions/test
2020
- uses: ./.github/actions/local/build
2121
- uses: ./.github/actions/local/e2e

.github/workflows/pre-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
with:
2626
node-version: 22
2727

28-
2928
- name: Build package
3029
run: pnpm -F @opennextjs/aws build
3130

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77

88
concurrency: ${{ github.workflow }}-${{ github.ref }}
99

10+
permissions:
11+
id-token: write
12+
contents: read
13+
1014
jobs:
1115
release:
1216
name: Release
@@ -19,6 +23,11 @@ jobs:
1923
fetch-depth: 0
2024

2125
- uses: ./.github/actions/setup
26+
with:
27+
# Ensure npm 11.5.1 or later is installed
28+
# See https://docs.npmjs.com/trusted-publishers
29+
node-version: 24
30+
2231
- uses: ./.github/actions/lint
2332

2433
- name: Create Release Pull Request or Publish to npm
@@ -31,7 +40,6 @@ jobs:
3140
publish: pnpm run release
3241
env:
3342
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3543

3644
- name: View outputs
3745
run: echo ${{join(steps.changesets.outputs.*, ' ')}}

0 commit comments

Comments
 (0)