@@ -14,6 +14,8 @@ concurrency:
14
14
group : images-${{ github.ref }}
15
15
cancel-in-progress : true
16
16
17
+ permissions : {}
18
+
17
19
jobs :
18
20
meta :
19
21
runs-on : ubuntu-latest
@@ -22,19 +24,25 @@ jobs:
22
24
implementation-name : ${{ steps.impl.outputs.name }}
23
25
steps :
24
26
- uses : actions/checkout@v4
27
+ with :
28
+ persist-credentials : false
25
29
26
30
- name : Install bowtie
27
31
uses : bowtie-json-schema/bowtie@main
28
32
29
33
- name : Compute implementation name
30
34
id : impl
31
- run : echo "name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT
35
+ env :
36
+ GH_REPOSITORY : ${{ github.repository }}
37
+ run : echo "name=$(echo ${GH_REPOSITORY} | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT
32
38
33
39
- name : Compute latest implementation version
34
40
id : version
41
+ env :
42
+ IMPL_NAME : ${{ steps.impl.outputs.name }}
35
43
run : |
36
44
version=$(bowtie info \
37
- --implementation ${{ steps.impl.outputs.name } } \
45
+ --implementation ${IMPL_NAME } \
38
46
--format json | jq -r '.version // empty')
39
47
echo "value=${version}" >> $GITHUB_OUTPUT
40
48
54
62
55
63
steps :
56
64
- uses : actions/checkout@v4
65
+ with :
66
+ persist-credentials : false
57
67
58
68
- name : Install bowtie
59
69
uses : bowtie-json-schema/bowtie@main
@@ -82,20 +92,27 @@ jobs:
82
92
enable-cache : true
83
93
84
94
- name : Smoke Test
95
+ env :
96
+ IMAGE_WITH_TAG : ${{ steps.build_image.outputs.image-with-tag }}
85
97
run : |
86
- bowtie smoke -i "localhost/${{ steps.build_image.outputs.image-with-tag } }" --format json
87
- bowtie smoke -i "localhost/${{ steps.build_image.outputs.image-with-tag } }" --format markdown >> $GITHUB_STEP_SUMMARY
98
+ bowtie smoke -i "localhost/${IMAGE_WITH_TAG }" --format json
99
+ bowtie smoke -i "localhost/${IMAGE_WITH_TAG }" --format markdown >> $GITHUB_STEP_SUMMARY
88
100
89
101
- name : Collect current version
90
102
id : current-version
103
+ env :
104
+ IMAGE_WITH_TAG : ${{ steps.build_image.outputs.image-with-tag }}
91
105
run : |
92
106
version=$(bowtie info \
93
- --implementation "localhost/${{ steps.build_image.outputs.image-with-tag } }" \
107
+ --implementation "localhost/${IMAGE_WITH_TAG }" \
94
108
--format json | jq -r '.version // empty')
95
109
echo "value=${version}" >> $GITHUB_OUTPUT
96
110
97
111
- name : Print collected versions
98
- run : echo "latest_version=${{ needs.meta.outputs.latest-version }}; current_version=${{ steps.current-version.outputs.value }}"
112
+ env :
113
+ LATEST_VERSION : ${{ needs.meta.outputs.latest-version }}
114
+ CURRENT_VERSION : ${{ steps.current-version.outputs.value }}
115
+ run : echo "latest_version=${LATEST_VERSION}; current_version=${CURRENT_VERSION}"
99
116
100
117
- name : Log in to ghcr.io
101
118
uses : redhat-actions/podman-login@v1
@@ -106,7 +123,10 @@ jobs:
106
123
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
107
124
108
125
- name : Add tag with version to the image
109
- run : podman tag ${{ steps.build_image.outputs.image-with-tag }} ${{ steps.build_image.outputs.image }}:${{ steps.current-version.outputs.value }}
126
+ env :
127
+ IMAGE_WITH_TAG : ${{ steps.build_image.outputs.image-with-tag }}
128
+ IMAGE_WITH_VERSION : " ${{ steps.build_image.outputs.image }}:${{ steps.current-version.outputs.value }}"
129
+ run : podman tag ${IMAGE_WITH_TAG} ${IMAGE_WITH_VERSION}
110
130
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
111
131
112
132
- name : Publish
@@ -138,6 +158,7 @@ jobs:
138
158
env :
139
159
TAG : v${{ needs.meta.outputs.latest-version }}
140
160
COMMIT : ${{ github.event.before }}
161
+ GH_REPOSITORY : ${{ github.repository }}
141
162
142
163
steps :
143
164
@@ -150,7 +171,7 @@ jobs:
150
171
--method POST
151
172
-H "Accept: application/vnd.github+json"
152
173
-H "X-GitHub-Api-Version: 2022-11-28"
153
- /repos/${{ github.repository } }/git/refs
174
+ /repos/${GH_REPOSITORY }/git/refs
154
175
-f "ref=refs/tags/$TAG"
155
176
-f "sha=$COMMIT"
156
177
@@ -162,7 +183,7 @@ jobs:
162
183
--method POST
163
184
-H "Accept: application/vnd.github+json"
164
185
-H "X-GitHub-Api-Version: 2022-11-28"
165
- /repos/${{ github.repository } }/releases
186
+ /repos/${GH_REPOSITORY }/releases
166
187
-f "tag_name=$TAG"
167
188
-f "name=$TAG"
168
189
-f "body=Automatic release for $TAG"
0 commit comments