@@ -2,9 +2,6 @@ name: "Build Images"
22
33on :
44 push :
5- branches :
6- - main
7- - develop
85 release :
96 types :
107 - published
3936 uses : actions/checkout@v2
4037
4138 - name : Install cosign
42- uses : sigstore/cosign-installer@v2.8.1
39+ uses : sigstore/cosign-installer@v3.5.0
4340
4441 # Set up QEMU to be able to build to multiple architectures
4542 - name : Set up QEMU
@@ -67,18 +64,27 @@ jobs:
6764 type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
6865
6966 - name : Prepare build
67+ id : prepare
7068 run : |
69+ export BUILD_DATE=$(date -Iseconds)
70+ export FLAVOUR=${{ matrix.flavour.name }}
71+
7172 cat build/Dockerfile.prefix > Dockerfile
7273 cat "flavour/${{ matrix.flavour.name }}/Dockerfile.flavour" >> Dockerfile
7374
7475 # Download mo
7576 curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo
7677 chmod +x mo
7778
78- cat build/Dockerfile.suffix.mo | BUILD_DATE=$(date -Iseconds) FLAVOUR=${{ matrix.flavour.name }} ./mo > build/Dockerfile.suffix
79-
79+ cat build/Dockerfile.suffix.mo | ./mo > build/Dockerfile.suffix
8080 cat build/Dockerfile.suffix >> Dockerfile
8181
82+ {
83+ echo 'labels<<EOF'
84+ cat build/labels.txt.mo | ./mo | sed -re "s/^/ /gm" # Add whitespace to insert it as annotations
85+ echo EOF
86+ } >> "$GITHUB_OUTPUT"
87+
8288 rm mo
8389 env :
8490 FLAVOUR : " ${{ matrix.flavour.name }}"
@@ -89,17 +95,17 @@ jobs:
8995
9096 - name : Build and push Docker image
9197 id : build-and-push
92- uses : docker/build-push-action@v4.0 .0
98+ uses : docker/build-push-action@v5.3 .0
9399 with :
94100 context : .
95101 push : true
96102 pull : true
97103 tags : ${{ steps.meta.outputs.tags }}
98104 labels : ${{ steps.meta.outputs.labels }}
105+ annotations : |
106+ ${{ steps.prepare.outputs.labels }}
99107 no-cache : true
100108 platforms : ${{ matrix.flavour.platforms }}
101109
102110 - name : Sign the published Docker image
103- env :
104- COSIGN_EXPERIMENTAL : " true"
105- run : echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
111+ run : echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }}
0 commit comments