Skip to content

Commit 9f2f2bc

Browse files
authored
Update release workflow for version bump and tests
1 parent 338abd9 commit 9f2f2bc

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
41
name: NPM Publish
52

63
on:
@@ -9,16 +6,28 @@ on:
96

107
permissions:
118
id-token: write # Required for OIDC
12-
contents: read
9+
contents: write # Required to push version bump commit
1310

1411
jobs:
1512
publish-npm:
1613
runs-on: ubuntu-latest
1714
steps:
18-
- uses: actions/checkout@v5
19-
- uses: actions/setup-node@v5
15+
- uses: actions/checkout@v6
16+
- uses: actions/setup-node@v6
2017
with:
21-
node-version: 22
22-
registry-url: https://registry.npmjs.org/
23-
- run: npm install -g npm@latest
18+
node-version: 24
19+
- run: npm ci --ignore-scripts --no-audit --no-fund
20+
- run: npm test
21+
- name: Bump version in package.json
22+
run: |
23+
VERSION="${{ github.event.release.tag_name }}"
24+
npm version "${VERSION#v}" --no-git-tag-version
25+
- name: Commit and push version bump
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "github-actions[bot]@users.noreply.github.com"
29+
git add package.json package-lock.json
30+
git commit -m "chore: bump version to ${{ github.event.release.tag_name }}"
31+
git push origin HEAD:main
32+
- run: npm run build
2433
- run: npm publish --access public

0 commit comments

Comments
 (0)