Skip to content

Commit 0383045

Browse files
authored
chore: update release workflow (#20)
1 parent fa60da5 commit 0383045

File tree

4 files changed

+30
-400
lines changed

4 files changed

+30
-400
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,49 @@
1-
2-
name: Release Full
1+
# This action will publish the package to npm and create a GitHub release.
2+
name: Release
33

44
on:
5-
workflow_dispatch:
6-
inputs:
7-
version:
8-
type: choice
9-
description: "Release Version Type"
10-
required: true
11-
default: "patch"
12-
options:
13-
- major
14-
- premajor
15-
- minor
16-
- preminor
17-
- patch
18-
- prepatch
19-
- prerelease
5+
# Run `npm run bump` to bump the version and create a git tag.
6+
push:
7+
tags:
8+
- "v*"
209

21-
tag:
22-
type: choice
23-
description: "Release Npm Tag"
24-
required: true
25-
default: "latest"
26-
options:
27-
- canary
28-
- nightly
29-
- latest
30-
- beta
31-
- alpha
32-
33-
dry_run:
34-
type: boolean
35-
description: "DryRun release"
36-
required: true
37-
default: false
10+
workflow_dispatch:
3811

3912
permissions:
40-
# To publish packages with provenance
13+
contents: write
4114
id-token: write
4215

4316
jobs:
44-
release:
45-
name: Release
46-
permissions:
47-
contents: write
48-
# To publish packages with provenance
49-
id-token: write
17+
publish:
5018
runs-on: ubuntu-latest
51-
19+
environment: npm
5220
steps:
5321
- name: Checkout
5422
uses: actions/checkout@v5
5523

56-
- name: Install Pnpm
57-
run: npm i -g corepack@latest --force && corepack enable
58-
5924
- name: Setup Node.js
6025
uses: actions/setup-node@v6
6126
with:
62-
node-version: 20.19.5
63-
cache: "pnpm"
27+
node-version: 24.11.0
28+
29+
# Update npm to the latest version to enable OIDC
30+
# Use corepack to install pnpm
31+
- name: Setup Package Managers
32+
run: |
33+
npm install -g npm@latest
34+
npm --version
35+
npm install -g corepack@latest --force
36+
corepack enable
6437
6538
- name: Install Dependencies
6639
run: pnpm install
6740

68-
- name: Run Test
69-
run: pnpm run test
70-
71-
- name: Try release to npm
72-
run: pnpm run release
73-
env:
74-
DRY_RUN: ${{ inputs.dry_run }}
75-
TAG: ${{ inputs.tag }}
76-
VERSION: ${{ inputs.version }}
77-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
- name: Publish
42+
uses: JS-DevTools/npm-publish@v4
43+
with:
44+
token: empty
7845

79-
46+
- name: Create GitHub Release
47+
uses: ncipollo/release-action@v1
48+
with:
49+
generateReleaseNotes: "true"

package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"lint:write": "biome check . --write",
2323
"prepare": "simple-git-hooks && npm run build",
2424
"test": "rstest run",
25-
"release": "node ./scripts/release.mjs"
25+
"bump": "npx bumpp"
2626
},
2727
"files": ["dist"],
2828
"simple-git-hooks": {
@@ -39,21 +39,13 @@
3939
"@rspack/core": "^1.6.0",
4040
"@rstest/core": "0.6.1",
4141
"@types/node": "^22.18.13",
42-
"cross-env": "^10.1.0",
43-
"execa": "9.6.0",
44-
"fs-extra": "11.3.2",
4542
"nano-staged": "^0.8.0",
46-
"semver": "7.7.3",
4743
"simple-git-hooks": "^2.13.1",
4844
"typescript": "5.9.3"
4945
},
5046
"packageManager": "pnpm@10.20.0",
5147
"publishConfig": {
5248
"access": "public",
53-
"registry": "https://registry.npmjs.org/",
54-
"provenance": true
55-
},
56-
"engines": {
57-
"node": ">=16.0.0"
49+
"registry": "https://registry.npmjs.org/"
5850
}
5951
}

0 commit comments

Comments
 (0)