Skip to content

Commit f19d9ed

Browse files
committed
Release script best practices
1 parent a94b7bc commit f19d9ed

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@ name: Publish Release to npm
22
on:
33
release:
44
types: [published]
5+
permissions: read-all
56
jobs:
67
build:
78
runs-on: ubuntu-latest
9+
environment: GitHub Publish
810
permissions:
911
contents: read
1012
id-token: write
1113
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
15+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # 4.0.3
1416
with:
15-
node-version: "20"
17+
node-version: "22"
1618
registry-url: 'https://registry.npmjs.org'
17-
- run: npm install
19+
- run: npm install -g npm@latest
20+
- run: npm ci
1821
- run: npm test
1922
- if: ${{ github.event.release.tag_name != '' && env.NPM_PUBLISH_TAG != '' }}
2023
run: npm publish --provenance --access=public --tag=${{ env.NPM_PUBLISH_TAG }}
2124
env:
22-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2325
NPM_PUBLISH_TAG: ${{ contains(github.event.release.tag_name, '-beta.') && 'beta' || 'latest' }}

0 commit comments

Comments
 (0)