Skip to content

Commit dbfdb98

Browse files
committed
feat: automate release
Signed-off-by: seven <zilisheng1996@gmail.com>
1 parent 0cdf7fc commit dbfdb98

File tree

3 files changed

+819
-414
lines changed

3 files changed

+819
-414
lines changed

.github/workflows/page-site.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,41 @@ jobs:
77
publish:
88
runs-on: ubuntu-latest
99
permissions:
10-
contents: read
10+
contents: write
1111
deployments: write
12-
name: Publish to Cloudflare Pages
1312
steps:
1413
- name: Checkout
1514
uses: actions/checkout@v4
15+
- name: Use Node.js 20.x
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20.x
19+
cache: 'npm'
1620
- run: npm ci
1721
- run: npm run docs:build
22+
- name: Generate changelog
23+
uses: jaywcjlove/changelog-generator@main
24+
if: ${{ github.ref == 'refs/heads/master' }}
25+
id: changelog
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Build Release
29+
uses: jaywcjlove/create-tag-action@main
30+
if: ${{ github.ref == 'refs/heads/master' }}
31+
id: tag_release
32+
with:
33+
release: true
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
body: |
36+
${{ steps.changelog.outputs.compareurl }}
37+
38+
${{ steps.changelog.outputs.changelog }}
39+
40+
Document Website: https://raw.githack.com/jaywcjlove/changelog-generator/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
41+
1842
- name: Publish to Cloudflare Pages
1943
uses: cloudflare/pages-action@v1
44+
if: steps.tag_release.outputs.successful
2045
with:
2146
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2247
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@@ -26,4 +51,3 @@ jobs:
2651
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
2752
branch: main
2853
environment: production
29-

0 commit comments

Comments
 (0)