-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (40 loc) · 1.26 KB
/
release.yaml
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
# .github/workflows/release.yml
name: Release
permissions:
contents: write
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
- name: Install Pnpm
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install Dependencies and build
run: pnpm install
- uses: actions/github-script@v7
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}}