File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33on :
44 push :
5+ branches :
6+ - " **"
57 pull_request :
68 workflow_dispatch :
79
1517 with :
1618 fetch-depth : 0
1719 persist-credentials : false
18-
20+
1921 - name : Setup PNPM
2022 uses : pnpm/action-setup@v4
2123 with :
2729 node-version-file : " .nvmrc"
2830 cache : " pnpm"
2931 registry-url : " https://registry.npmjs.org"
30-
32+
3133 - name : Install
3234 run : pnpm install --frozen-lockfile
3335
3436 - name : Build
35- run : pnpm build:prod_publish
37+ run : pnpm build:prod_publish
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+
12+ permissions :
13+ contents : write
14+ id-token : write
15+
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v6
19+ with :
20+ fetch-depth : 0
21+ persist-credentials : true
22+
23+ - name : Setup PNPM
24+ uses : pnpm/action-setup@v4
25+ with :
26+ version : latest
27+
28+ - name : Setup Node.js
29+ uses : actions/setup-node@v6
30+ with :
31+ node-version-file : " .nvmrc"
32+ cache : " pnpm"
33+ registry-url : " https://registry.npmjs.org"
34+
35+ - name : Install
36+ run : pnpm install --frozen-lockfile
37+
38+ - name : Set build environment variables
39+ run : |
40+ echo "BUILD_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
41+ echo "BUILD_DATE=$(date -u +%Y-%m-%d)" >> $GITHUB_ENV
42+
43+ - name : Build
44+ run : pnpm build:prod_publish
45+
46+ - name : Publish to npm
47+ run : pnpm publish --no-git-checks --provenance
48+
49+ - name : Create GitHub Release
50+ uses : softprops/action-gh-release@v2
51+ with :
52+ generate_release_notes : true
53+
54+ - name : Bump package.json version
55+ run : |
56+ pnpm version $BUILD_VERSION --no-git-tag-version
57+ git config user.name "github-actions[bot]"
58+ git config user.email "github-actions[bot]@users.noreply.github.com"
59+ git add package.json
60+ git commit -m "chore: bump version to $BUILD_VERSION [skip ci]"
61+ git push origin HEAD:refs/heads/${{ github.event.repository.default_branch }}
Original file line number Diff line number Diff line change 1+ enable-pre-post-scripts = true
2+ access = public
You can’t perform that action at this time.
0 commit comments