77 - main
88
99jobs :
10- bump -version :
10+ compute -version :
1111 if : github.event.pull_request.merged == true
1212 runs-on : ubuntu-latest
1313 permissions :
1717 steps :
1818 - name : Check out the repository
1919 uses : actions/checkout@v4
20- with :
21- ssh-key : ${{ secrets.DEPLOY_KEY }}
2220
2321 - name : Read version from file
2422 run : |
@@ -37,31 +35,45 @@ jobs:
3735 INITIAL_VERSION : ${{ env.INITIAL_VERSION }}
3836 WITH_V : true
3937
38+
39+ update-version-file :
40+ if : github.event.pull_request.merged == true
41+ needs : compute-version
42+ runs-on : ubuntu-latest
43+ permissions :
44+ contents : write
45+ steps :
46+ - name : Check out the repository
47+ uses : actions/checkout@v4
48+ with :
49+ ssh-key : ${{ secrets.DEPLOY_KEY }}
50+
4051 - name : Update version file with new version
4152 run : |
42- echo "New version: ${{ steps.bump_version .outputs.new_tag }}"
43- echo "VERSION=${{ steps.bump_version .outputs.new_tag }}" > version
53+ echo "New version: ${{ needs.compute-version .outputs.new_tag }}"
54+ echo "VERSION=${{ needs.compute-version .outputs.new_tag }}" > version
4455 git config --local user.name "github-actions[bot]"
4556 git config --local user.email "github-actions[bot]@users.noreply.github.com"
4657 git add version
47- git commit -m "chore: update version file to ${{ steps.bump_version .outputs.new_tag }}"
58+ git commit -m "chore: update version file to ${{ needs.compute-version .outputs.new_tag }}"
4859 git push
4960
5061 - name : Push new tag
5162 run : |
52- git tag ${{ steps.bump_version.outputs.new_tag }}
53- git push origin ${{ steps.bump_version.outputs.new_tag }}
63+ git tag ${{ needs.compute-version.outputs.new_tag }}
64+ git push origin ${{ needs.compute-version.outputs.new_tag }}
65+
5466
5567 create-release :
56- needs : bump -version
68+ needs : update -version-file
5769 runs-on : ubuntu-latest
5870 permissions :
5971 contents : write
6072 steps :
6173 - name : Check out the repository and pull the new tag
6274 uses : actions/checkout@v4
6375 with :
64- ref : ${{ needs.bump -version.outputs.new_tag }}
76+ ref : ${{ needs.compute -version.outputs.new_tag }}
6577
6678 - name : Build release packages
6779 uses : docker/build-push-action@v6
8193 uses : ncipollo/release-action@v1
8294 with :
8395 artifacts : " /tmp/artifacts/release/*"
84- tag : ${{ needs.bump -version.outputs.new_tag }}
96+ tag : ${{ needs.compute -version.outputs.new_tag }}
8597 body : ${{ github.event.pull_request.body }}
8698
0 commit comments