|
96 | 96 | author_name: ${{ steps.build-meta.outputs.author_name }} |
97 | 97 | author_email: ${{ steps.build-meta.outputs.author_email }} |
98 | 98 | platforms: ${{ env.PLATFORMS }} |
99 | | - ubi_img: ${{ fromJSON(steps.bake-push.outputs.metadata)['ubi']['image.name'] }} |
| 99 | + olm_img: ${{ steps.olm-image.outputs.olm_image }} |
100 | 100 | steps: |
101 | 101 | - |
102 | 102 | name: Checkout |
@@ -214,12 +214,23 @@ jobs: |
214 | 214 | # See https://github.blog/security/supply-chain-security/safeguard-container-signing-capability-actions/ |
215 | 215 | # and https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml for more details on |
216 | 216 | # how to use cosign. |
217 | | - - name: Sign images |
| 217 | + - |
| 218 | + name: Sign images |
218 | 219 | run: | |
219 | 220 | images=$(echo '${{ steps.bake-push.outputs.metadata }}' | |
220 | 221 | jq -r '.[] | (."image.name" | sub(",.*";"" )) + "@" + ."containerimage.digest"' |
221 | 222 | ) |
222 | 223 | cosign sign --yes ${images} |
| 224 | + - |
| 225 | + # Bake returns all the tags for a target's variant in a comma separated list. |
| 226 | + # We only care about a single tag for OLM, so we remove the "latest" tag and |
| 227 | + # pick the first entry in order from what's left in the list |
| 228 | + name: Image for OLM |
| 229 | + id: olm-image |
| 230 | + env: |
| 231 | + ubi_tags: ${{ fromJSON(steps.bake-push.outputs.metadata)['ubi']['image.name'] }} |
| 232 | + run: | |
| 233 | + echo "olm_image=$(echo "$ubi_tags" | tr ',' '\n' | grep -v 'latest' | sed 's/^ *//g' | head -n 1)" >> $GITHUB_OUTPUT |
223 | 234 |
|
224 | 235 | olm-bundle: |
225 | 236 | name: Create OLM bundle and catalog |
@@ -261,11 +272,11 @@ jobs: |
261 | 272 |
|
262 | 273 | - name: Set bundle variables |
263 | 274 | env: |
264 | | - UBI_IMG: ${{ needs.release-binaries.outputs.ubi_img }} |
| 275 | + OLM_IMG: ${{ needs.release-binaries.outputs.olm_img }} |
265 | 276 | run: | |
266 | | - echo "CONTROLLER_IMG=${UBI_IMG}" >> $GITHUB_ENV |
267 | | - echo "BUNDLE_IMG=${UBI_IMG}-bundle" >> $GITHUB_ENV |
268 | | - echo "CATALOG_IMG=${UBI_IMG}-catalog" >> $GITHUB_ENV |
| 277 | + echo "CONTROLLER_IMG=${OLM_IMG}" >> $GITHUB_ENV |
| 278 | + echo "BUNDLE_IMG=${OLM_IMG}-bundle" >> $GITHUB_ENV |
| 279 | + echo "CATALOG_IMG=${OLM_IMG}-catalog" >> $GITHUB_ENV |
269 | 280 |
|
270 | 281 | - name: Create bundle |
271 | 282 | env: |
|
0 commit comments