fix: move attestation to multi-platform manifest creation

This commit is contained in:
Till Wegmueller 2025-11-29 17:36:35 +01:00
parent 6e0fb3cb68
commit 656bdb5531
No known key found for this signature in database

View file

@ -70,19 +70,13 @@ jobs:
VERSION=${{ github.ref_name }} VERSION=${{ github.ref_name }}
REVISION=${{ github.sha }} REVISION=${{ github.sha }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
create-manifest: create-manifest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build-platform needs: build-platform
permissions: permissions:
contents: read contents: read
packages: write packages: write
id-token: write
steps: steps:
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
@ -104,6 +98,7 @@ jobs:
type=sha,prefix=sha- type=sha,prefix=sha-
- name: Create and push multi-platform manifest - name: Create and push multi-platform manifest
id: manifest
run: | run: |
# Extract tags into an array # Extract tags into an array
TAGS=$(echo '${{ steps.meta.outputs.tags }}' | tr '\n' ' ') TAGS=$(echo '${{ steps.meta.outputs.tags }}' | tr '\n' ' ')
@ -116,6 +111,18 @@ jobs:
${TAG}-arm64 ${TAG}-arm64
done done
# Get the digest of the first tag (version tag) for attestation
FIRST_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n1)
DIGEST=$(docker buildx imagetools inspect ${FIRST_TAG} --format '{{.Manifest.Digest}}')
echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.manifest.outputs.digest }}
push-to-registry: true
create-github-release: create-github-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: create-manifest needs: create-manifest