Skip to content

Commit e22e78c

Browse files
updated release action to use OIDC
1 parent 335b506 commit e22e78c

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
name: Release
22
on:
33
push:
4-
tags: ['*']
4+
tags:
5+
- 'v*'
6+
7+
permissions:
8+
id-token: write
9+
contents: read
510

611
jobs:
712
release:
813
runs-on: ubuntu-latest
914
steps:
10-
- name: Checkout Code
11-
uses: actions/checkout@v4
12-
- name: Use Node.js 20.x
13-
uses: actions/setup-node@v4
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
1418
with:
15-
node-version: 20.x
16-
- name: Release to NPM
17-
run: |
18-
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
19-
echo "The version is: ${REF:10}"
20-
npm version --no-git-tag-version ${REF:10}
21-
npm publish
22-
env:
23-
CI: true
24-
NPM_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
25-
REF: ${{ github.ref }}
19+
node-version: '20'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
# Ensure npm 11.5.1 or later is installed
23+
- name: Update npm
24+
run: npm install -g npm@latest
25+
26+
- run: npm ci
27+
28+
- run: npm run build --if-present
29+
- run: npm test
30+
- run: npm publish

0 commit comments

Comments
 (0)