@@ -13,28 +13,19 @@ jobs:
13
13
permissions :
14
14
contents : write
15
15
outputs :
16
- new_tag : ${{ steps.bump_version.outputs.new_tag }}
16
+ new_version : ${{ steps.bump_version.outputs.new_version }}
17
17
steps :
18
18
- name : Check out the repository
19
19
uses : actions/checkout@v4
20
20
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
29
22
id : bump_version
30
- uses : anothrNick/github-tag-action@v1
31
23
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
38
29
39
30
update-version-file :
40
31
needs : compute-version
@@ -49,18 +40,18 @@ jobs:
49
40
50
41
- name : Update version file with new version
51
42
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
54
45
git config --local user.name "github-actions[bot]"
55
46
git config --local user.email "github-actions[bot]@users.noreply.github.com"
56
47
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 }}"
58
49
git push
59
50
60
51
- name : Push new tag
61
52
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 }}
64
55
65
56
66
57
create-release :
73
64
uses : actions/checkout@v4
74
65
with :
75
66
fetch-depth : 0
76
- ref : ${{ needs.compute-version.outputs.new_tag }}
67
+ ref : ${{ needs.compute-version.outputs.new_version }}
77
68
78
69
- name : Build release packages
79
70
uses : docker/build-push-action@v6
93
84
uses : ncipollo/release-action@v1
94
85
with :
95
86
artifacts : " /tmp/artifacts/release/*"
96
- tag : ${{ needs.compute-version.outputs.new_tag }}
87
+ tag : ${{ needs.compute-version.outputs.new_version }}
97
88
body : ${{ github.event.pull_request.body }}
98
89
99
90
@@ -105,11 +96,11 @@ jobs:
105
96
uses : docker/build-push-action@v6
106
97
with :
107
98
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 }}
109
100
push : false
110
101
tags : release_tester
111
102
target : release_test
112
103
113
104
- name : Run unit tests with/against released version
114
105
run : |
115
- docker run --rm release_tester
106
+ docker run --rm release_tester
0 commit comments