Skip to content

Commit 9823e14

Browse files
authored
chore: use npm staged publishing for release (#65)
1 parent 2121ebe commit 9823e14

4 files changed

Lines changed: 19 additions & 281 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,37 @@
1-
name: Release Full
1+
name: Release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
tag:
7-
type: choice
8-
description: "Release Npm Tag"
9-
required: true
10-
default: "nightly"
11-
options:
12-
- alpha
13-
- beta
14-
- canary
15-
- latest
16-
- nightly
17-
- rc
4+
# Run `npm run bump` to bump the version and create a git tag.
5+
push:
6+
tags:
7+
- 'v*'
188

19-
dry_run:
20-
type: boolean
21-
description: "DryRun release"
22-
required: true
23-
default: false
9+
workflow_dispatch:
2410

2511
permissions:
26-
contents: write
27-
# To publish packages with provenance
28-
id-token: write
12+
contents: read
13+
id-token: write # Required for OIDC
2914

3015
jobs:
31-
release:
32-
name: Release
33-
environment: npm
16+
publish:
3417
runs-on: ubuntu-latest
35-
18+
environment: npm
3619
steps:
3720
- name: Checkout
3821
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3922

40-
- name: Install Pnpm
41-
run: npm i -g corepack@latest --force && corepack enable
42-
4323
- name: Setup Node.js
4424
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4525
with:
4626
node-version: 24.15.0
47-
cache: "pnpm"
4827

49-
# Update npm to the latest version to enable OIDC
50-
- name: Update npm
28+
- name: Setup Pnpm
5129
run: |
52-
npm install -g npm@latest
53-
npm --version
30+
npm install -g corepack@latest --force
31+
corepack enable
5432
5533
- name: Install Dependencies
56-
run: pnpm install
57-
58-
- name: Run Test
59-
run: pnpm run test
60-
61-
- name: Dry run release to npm
62-
if: inputs.dry_run
63-
run: node scripts/release.mjs --dry-run --tag ${{ inputs.tag }}
34+
run: pnpm i
6435

65-
- name: Release to npm
66-
if: ${{ !inputs.dry_run }}
67-
run: node scripts/release.mjs --tag ${{ inputs.tag }}
36+
- name: Publish
37+
run: pnpm stage publish --no-git-checks

package.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"prepare": "simple-git-hooks && npm run build",
2626
"test": "rstest",
2727
"testu": "rstest -u",
28-
"release": "node ./scripts/release.mjs",
2928
"bump": "npx bumpp --no-push --no-tag --no-commit"
3029
},
3130
"files": [
@@ -43,33 +42,27 @@
4342
]
4443
},
4544
"devDependencies": {
46-
"@rslint/core": "^0.5.3",
4745
"@prefresh/core": "^1.5.10",
4846
"@prefresh/utils": "^1.2.1",
4947
"@rslib/core": "^0.21.5",
48+
"@rslint/core": "^0.5.3",
5049
"@rspack/core": "^2.0.4",
5150
"@rspack/test-tools": "2.0.4",
52-
"wast-loader": "^1.14.1",
5351
"@rstest/core": "^0.10.2",
5452
"@swc/helpers": "0.5.21",
5553
"@swc/plugin-prefresh": "^12.10.0",
5654
"@types/node": "^24.12.4",
57-
"cac": "^7.0.0",
58-
"prettier": "^3.8.3",
59-
"cross-env": "^10.1.0",
60-
"execa": "9.6.1",
61-
"fs-extra": "11.3.5",
6255
"nano-staged": "^1.0.2",
6356
"preact": "^10.29.2",
64-
"semver": "7.8.1",
57+
"prettier": "^3.8.3",
6558
"simple-git-hooks": "^2.13.1",
6659
"typescript": "^6.0.3"
6760
},
6861
"peerDependencies": {
6962
"@prefresh/core": "^1.5.0",
7063
"@prefresh/utils": "^1.2.0"
7164
},
72-
"packageManager": "pnpm@11.2.2",
65+
"packageManager": "pnpm@11.4.0",
7366
"publishConfig": {
7467
"access": "public",
7568
"registry": "https://registry.npmjs.org/"

0 commit comments

Comments
 (0)