1212 - ' .gitignore'
1313 - ' LICENSE'
1414 - ' *.md'
15- permissions : read-all
15+ permissions :
16+ contents : read
17+ id-token : write # needed for signing the images with GitHub OIDC Token
18+
1619jobs :
1720 build-verify-package :
1821 runs-on : ubuntu-latest
4851 echo "PACKAGE_IMAGE=false" >> "$GITHUB_ENV"
4952 fi
5053
54+ - name : Install Cosign
55+ 56+
5157 - name : Set up QEMU
5258 if : github.repository_owner == 'microcks' && env.PACKAGE_IMAGE == 'true'
5359 uses : docker/setup-qemu-action@v2
@@ -64,14 +70,29 @@ jobs:
6470 docker buildx inspect $BUILDER || docker buildx create --name=$BUILDER --driver=docker-container --driver-opt=network=host
6571
6672 - name : Build and push container image for cli
73+ id : build-and-push
74+ 6775 if : github.repository_owner == 'microcks' && env.PACKAGE_IMAGE == 'true'
76+ with :
77+ context : .
78+ sbom : true
79+ push : true
80+ platforms : linux/amd64,linux/arm64
81+ builder : buildx-multi-arch
82+ file : build/Dockerfile
83+ labels : |
84+ org.opencontainers.image.revision=${GITHUB_SHA}
85+ org.opencontainers.image.created=${{ steps.date.outputs.date }}
86+ tags : quay.io/microcks/microcks-cli:${{env.IMAGE_TAG}}
87+
88+ - name : Sign the image with GitHub OIDC Token
89+ env :
90+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
91+ TAGS : quay.io/microcks/microcks-cli:${{env.IMAGE_TAG}}
92+ COSIGN_EXPERIMENTAL : " true"
6893 run : |
69- docker buildx build --push \
70- --platform=linux/amd64,linux/arm64 \
71- --builder=buildx-multi-arch \
72- --provenance=false \
73- --build-arg TAG=$IMAGE_TAG \
74- --file build/Dockerfile \
75- --label "org.opencontainers.image.revision=${GITHUB_SHA}" \
76- --label "org.opencontainers.image.created=${{ steps.date.outputs.date }}" \
77- --tag=quay.io/microcks/microcks-cli:$IMAGE_TAG .
94+ images=""
95+ for tag in ${TAGS}; do
96+ images+="${tag}@${DIGEST} "
97+ done
98+ cosign sign --yes ${images}
0 commit comments