Skip to content

Commit d25ae5a

Browse files
committed
Publish release script best practices
1 parent aa1be11 commit d25ae5a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ on:
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
environment: GitHub Publish
89
permissions:
910
contents: read
1011
id-token: write
1112
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
13+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
14+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # 4.0.3
1415
with:
15-
node-version: "20"
16+
node-version: "22"
1617
registry-url: 'https://registry.npmjs.org'
17-
- run: npm install
18+
- run: npm install -g npm@latest
19+
- run: npm ci
1820
- run: npm test
1921
- if: ${{ github.event.release.tag_name != '' && env.NPM_PUBLISH_TAG != '' }}
2022
run: npm publish --provenance --access=public --tag=${{ env.NPM_PUBLISH_TAG }}
2123
env:
22-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2324
NPM_PUBLISH_TAG: ${{ contains(github.event.release.tag_name, '-alpha.') && 'alpha' || contains(github.event.release.tag_name, '-beta.') && 'beta' || 'latest' }}

0 commit comments

Comments
 (0)