-
Notifications
You must be signed in to change notification settings - Fork 21
56 lines (46 loc) · 1.44 KB
/
release.yaml
File metadata and controls
56 lines (46 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# .github/workflows/release.yml
name: Release
permissions:
id-token: write # Required for OIDC
contents: write
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
environment: npm
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
# Update npm to the latest version to enable OIDC
# Use corepack to install pnpm
- name: Setup Package Managers
run: |
npm install -g npm@latest
npm --version
npm install -g corepack@latest --force
corepack enable
- name: Install Dependencies and build
run: pnpm install --frozen-lockfile
- uses: actions/github-script@v9
id: version_to_release
with:
result-encoding: string
script: |
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('./packages/builder-rsbuild/package.json', 'utf8'));
return 'v' + packageJson.version;
- name: Publish to NPM
run: |
git tag ${{ steps.version_to_release.outputs.result }}
git push origin ${{ steps.version_to_release.outputs.result }}
pnpm -r publish --no-git-checks
- name: GitHub Release
run: pnpx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}