|
7 | 7 | - "pre-release/*.*.*" |
8 | 8 |
|
9 | 9 | 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 | +
|
10 | 49 | docker: |
11 | 50 | runs-on: ubuntu-latest |
| 51 | + needs: version |
12 | 52 | steps: |
13 | 53 | - name: Set up QEMU |
14 | 54 | uses: docker/setup-qemu-action@v2 |
|
39 | 79 | push: true |
40 | 80 | tags: jakeee/qim:latest, jakeee/qim:${{ env.VERSION }} |
41 | 81 |
|
42 | | - - run: curl --url "${{ secrets.BT_WEBHOOK_ACCESS_KEY }}¶m=${{ env.VERSION }}" |
43 | | - - run: curl ${{ secrets.RENDER_DEPLOY_WEBHOOK }} |
44 | | - |
45 | 82 | release: |
| 83 | + needs: [docker, version] |
46 | 84 | runs-on: ubuntu-latest |
47 | | - permissions: |
48 | | - contents: write |
49 | 85 | steps: |
50 | 86 | - uses: actions/checkout@v3 |
51 | 87 | - name: Extract build args |
|
54 | 90 | run: | |
55 | 91 | echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV |
56 | 92 |
|
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 | | -
|
84 | 93 | - name: Bump version and push tag |
85 | 94 | id: tag_version |
86 | 95 | uses: mathieudutour/github-tag-action@v6.1 |
|
0 commit comments