Skip to content

Commit c0b55d5

Browse files
committed
refactor(release): use node24, enable provenance, set permissions and remove NPM_TOKEN to allow oidc publishing
1 parent 2ee754b commit c0b55d5

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@ on:
44
push:
55
branches:
66
- master
7+
permissions: {}
78

89
jobs:
910
release:
11+
permissions:
12+
contents: write # to create release (changesets/action)
13+
id-token: write # OpenID Connect token needed for provenance
14+
pull-requests: write # to create pull request (changesets/action)
1015
# prevents this action from running on forks
1116
if: github.repository == 'sveltejs/svelte-hmr'
1217
name: Release
1318
runs-on: ${{ matrix.os }}
1419
strategy:
1520
matrix:
1621
# pseudo-matrix for convenience, NEVER use more than a single combination
17-
node: [20]
22+
node: [24]
1823
os: [ubuntu-latest]
1924
steps:
2025
- name: checkout
@@ -39,13 +44,6 @@ jobs:
3944
- name: install
4045
run: pnpm install --frozen-lockfile --prefer-offline
4146

42-
- name: Creating .npmrc
43-
run: |
44-
cat << EOF > "$HOME/.npmrc"
45-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
46-
EOF
47-
env:
48-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4947
- name: Create Release Pull Request or Publish to npm
5048
id: changesets
5149
uses: changesets/action@v1
@@ -54,7 +52,7 @@ jobs:
5452
publish: pnpm release
5553
env:
5654
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
NPM_CONFIG_PROVENANCE: true
5856

5957
# TODO alert discord
6058
# - name: Send a Slack notification if a publish happens

0 commit comments

Comments
 (0)