Skip to content

Commit cccecf3

Browse files
authored
chore: update release workflow (#65)
1 parent 1a8dc3b commit cccecf3

File tree

4 files changed

+25
-252
lines changed

4 files changed

+25
-252
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,52 @@
1-
name: Release Full
1+
# This action will publish the package to npm and create a GitHub release.
2+
name: Release
23

34
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
type: choice
8-
description: 'Release Version Type'
9-
required: true
10-
default: 'patch'
11-
options:
12-
- major
13-
- premajor
14-
- minor
15-
- preminor
16-
- patch
17-
- prepatch
18-
- prerelease
19-
20-
tag:
21-
type: choice
22-
description: 'Release Npm Tag'
23-
required: true
24-
default: 'latest'
25-
options:
26-
- canary
27-
- nightly
28-
- latest
29-
- beta
30-
- alpha
5+
# Run `npm run bump` to bump the version and create a git tag.
6+
push:
7+
tags:
8+
- 'v*'
319

32-
dry_run:
33-
type: boolean
34-
description: 'DryRun release'
35-
required: true
36-
default: false
10+
workflow_dispatch:
3711

3812
permissions:
3913
contents: write
40-
# To publish packages with provenance
4114
id-token: write
4215

4316
jobs:
44-
release:
45-
name: Release
17+
publish:
4618
runs-on: ubuntu-latest
4719
environment: npm
4820
steps:
4921
- name: Checkout
5022
uses: actions/checkout@v6
5123

52-
- name: Setup Pnpm
53-
run: |
54-
npm install -g corepack@latest
55-
corepack enable
56-
5724
- name: Setup Node.js
5825
uses: actions/setup-node@v6
5926
with:
60-
node-version: 20
61-
cache: 'pnpm'
27+
node-version: 24.11.1
6228

6329
# Update npm to the latest version to enable OIDC
64-
- name: Update npm
30+
# Use corepack to install pnpm
31+
- name: Setup Package Managers
6532
run: |
6633
npm install -g npm@latest
6734
npm --version
35+
npm install -g corepack@latest --force
36+
corepack enable
6837
6938
- name: Install Dependencies
7039
run: pnpm install
7140

72-
- name: Run Test
73-
run: pnpm run test
41+
- name: Build
42+
run: pnpm run build
7443

75-
- name: Try release to npm
76-
run: pnpm run release
77-
env:
78-
DRY_RUN: ${{ inputs.dry_run }}
79-
TAG: ${{ inputs.tag }}
80-
VERSION: ${{ inputs.version }}
44+
- name: Publish
45+
uses: JS-DevTools/npm-publish@v4
46+
with:
47+
token: empty
48+
49+
- name: Create GitHub Release
50+
uses: ncipollo/release-action@v1
51+
with:
52+
generateReleaseNotes: 'true'

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"prettier:ci": "prettier --check .",
2929
"test:install": "cross-env ./node_modules/.bin/puppeteer browsers install chrome",
3030
"test": "pnpm run test:install && pnpm run build && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ./node_modules/jest-cli/bin/jest --colors",
31-
"release": "node ./scripts/release.mjs"
31+
"bump": "npx bumpp"
3232
},
3333
"simple-git-hooks": {
3434
"pre-commit": "npx nano-staged"
@@ -70,8 +70,6 @@
7070
"cross-env": "^7.0.3",
7171
"css-loader": "^7.1.2",
7272
"connect": "^3.7.0",
73-
"execa": "9.3.0",
74-
"fs-extra": "11.2.0",
7573
"graceful-fs": "4.2.10",
7674
"http-proxy": "^1.18.1",
7775
"hono": "^4.6.8",
@@ -84,7 +82,6 @@
8482
"puppeteer": "^24.34.0",
8583
"react-refresh": "0.14.0",
8684
"require-from-string": "^2.0.2",
87-
"semver": "7.6.3",
8885
"simple-git-hooks": "^2.11.1",
8986
"sockjs-client": "^1.6.1",
9087
"style-loader": "^4.0.0",

0 commit comments

Comments
 (0)