Skip to content
This repository was archived by the owner on Dec 14, 2024. It is now read-only.

Commit 4e2907a

Browse files
authored
feat: 调整 release action (#104)
* feat: build docker 放在 release 后面 * feat: 调整 release action * feat: 调整 release action
1 parent 3b2b929 commit 4e2907a

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,48 @@ on:
77
- "pre-release/*.*.*"
88

99
jobs:
10+
version:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Extract build args
17+
# Extract version from branch name
18+
# Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0
19+
run: |
20+
echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
21+
22+
- name: "change version"
23+
uses: reedyuk/npm-version@1.1.1
24+
with:
25+
version: "${{ env.VERSION }}"
26+
git-tag-version: "false"
27+
28+
- name: "change version"
29+
uses: reedyuk/npm-version@1.1.1
30+
with:
31+
version: "${{ env.VERSION }}"
32+
package: "packages/client/"
33+
git-tag-version: "false"
34+
35+
- name: "change version"
36+
uses: reedyuk/npm-version@1.1.1
37+
with:
38+
version: "${{ env.VERSION }}"
39+
package: "packages/server/"
40+
git-tag-version: "false"
41+
42+
- run: |
43+
git config user.name 'Jake Yu'
44+
git config user.email 'jake.laoyu@gmail.com'
45+
git add .
46+
git commit -m "chore: ${{ env.VERSION }}"
47+
git push "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "${{ github.ref }}"
48+
1049
docker:
1150
runs-on: ubuntu-latest
51+
needs: version
1252
steps:
1353
- name: Set up QEMU
1454
uses: docker/setup-qemu-action@v2
@@ -39,13 +79,9 @@ jobs:
3979
push: true
4080
tags: jakeee/qim:latest, jakeee/qim:${{ env.VERSION }}
4181

42-
- run: curl --url "${{ secrets.BT_WEBHOOK_ACCESS_KEY }}&param=${{ env.VERSION }}"
43-
- run: curl ${{ secrets.RENDER_DEPLOY_WEBHOOK }}
44-
4582
release:
83+
needs: [docker, version]
4684
runs-on: ubuntu-latest
47-
permissions:
48-
contents: write
4985
steps:
5086
- uses: actions/checkout@v3
5187
- name: Extract build args
@@ -54,33 +90,6 @@ jobs:
5490
run: |
5591
echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
5692
57-
- name: "change version"
58-
uses: reedyuk/npm-version@1.1.1
59-
with:
60-
version: "${{ env.VERSION }}"
61-
git-tag-version: "false"
62-
63-
- name: "change version"
64-
uses: reedyuk/npm-version@1.1.1
65-
with:
66-
version: "${{ env.VERSION }}"
67-
package: "packages/client/"
68-
git-tag-version: "false"
69-
70-
- name: "change version"
71-
uses: reedyuk/npm-version@1.1.1
72-
with:
73-
version: "${{ env.VERSION }}"
74-
package: "packages/server/"
75-
git-tag-version: "false"
76-
77-
- run: |
78-
git config user.name 'Jake Yu'
79-
git config user.email 'jake.laoyu@gmail.com'
80-
git add .
81-
git commit -m "chore: ${{ env.VERSION }}"
82-
git push "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" "${{ github.ref }}"
83-
8493
- name: Bump version and push tag
8594
id: tag_version
8695
uses: mathieudutour/github-tag-action@v6.1

0 commit comments

Comments
 (0)