@@ -13,28 +13,19 @@ jobs:
1313 permissions :
1414 contents : write
1515 outputs :
16- new_tag : ${{ steps.bump_version.outputs.new_tag }}
16+ new_version : ${{ steps.bump_version.outputs.new_version }}
1717 steps :
1818 - name : Check out the repository
1919 uses : actions/checkout@v4
2020
21- - name : Read version from file
22- run : |
23- # Read the version from the version file, only store the number (without the 'v')
24- INITIAL_VERSION=$(source version && echo ${VERSION#v})
25- echo "Current version: $INITIAL_VERSION"
26- echo "INITIAL_VERSION=${INITIAL_VERSION}" >> $GITHUB_ENV
27-
28- - name : Bump version
21+ - name : Compute new version
2922 id : bump_version
30- uses : anothrNick/github-tag-action@v1
3123 env :
32- DEFAULT_BUMP : minor
33- DRY_RUN : true
34- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35- INITIAL_VERSION : ${{ env.INITIAL_VERSION }}
36- WITH_V : true
37-
24+ PR_BODY : ${{ github.event.pull_request.body }}
25+ run : |
26+ source version
27+ new_version=$(.github/workflows/compute_version.sh "$VERSION" "${PR_BODY//[^a-zA-Z0-9# $'\n']/}")
28+ echo "new_version=$new_version" >> $GITHUB_OUTPUT
3829
3930 update-version-file :
4031 needs : compute-version
@@ -49,18 +40,18 @@ jobs:
4940
5041 - name : Update version file with new version
5142 run : |
52- echo "New version: ${{ needs.compute-version.outputs.new_tag }}"
53- echo "VERSION=${{ needs.compute-version.outputs.new_tag }}" > version
43+ echo "New version: ${{ needs.compute-version.outputs.new_version }}"
44+ echo "VERSION=${{ needs.compute-version.outputs.new_version }}" > version
5445 git config --local user.name "github-actions[bot]"
5546 git config --local user.email "github-actions[bot]@users.noreply.github.com"
5647 git add version
57- git commit -m "chore: update version file to ${{ needs.compute-version.outputs.new_tag }}"
48+ git commit -m "chore: update version file to ${{ needs.compute-version.outputs.new_version }}"
5849 git push
5950
6051 - name : Push new tag
6152 run : |
62- git tag ${{ needs.compute-version.outputs.new_tag }}
63- git push origin ${{ needs.compute-version.outputs.new_tag }}
53+ git tag ${{ needs.compute-version.outputs.new_version }}
54+ git push origin ${{ needs.compute-version.outputs.new_version }}
6455
6556
6657 create-release :
7364 uses : actions/checkout@v4
7465 with :
7566 fetch-depth : 0
76- ref : ${{ needs.compute-version.outputs.new_tag }}
67+ ref : ${{ needs.compute-version.outputs.new_version }}
7768
7869 - name : Build release packages
7970 uses : docker/build-push-action@v6
9384 uses : ncipollo/release-action@v1
9485 with :
9586 artifacts : " /tmp/artifacts/release/*"
96- tag : ${{ needs.compute-version.outputs.new_tag }}
87+ tag : ${{ needs.compute-version.outputs.new_version }}
9788 body : ${{ github.event.pull_request.body }}
9889
9990
@@ -105,11 +96,11 @@ jobs:
10596 uses : docker/build-push-action@v6
10697 with :
10798 build-args : |
108- RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/util_caching/releases/download/${{ needs.compute-version.outputs.new_tag }}
99+ RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/util_caching/releases/download/${{ needs.compute-version.outputs.new_version }}
109100 push : false
110101 tags : release_tester
111102 target : release_test
112103
113104 - name : Run unit tests with/against released version
114105 run : |
115- docker run --rm release_tester
106+ docker run --rm release_tester
0 commit comments