Skip to content

Commit

Permalink
workflow: mkosi: Publish qcow2 with oras
Browse files Browse the repository at this point in the history
Publish the podvm qcow2 files with oras

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman committed Oct 25, 2024
1 parent 83d34c4 commit 0293f36
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/podvm_mkosi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,37 @@ jobs:
REGISTRY: ${{ inputs.registry }}
PODVM_TAG: ${{ steps.image_tag.outputs.image_tag }}

- name: Upload the qcow2 with oras
id: publish
working-directory: src/cloud-api-adaptor/podvm-mkosi
run: |
mkdir oras
cd oras
cp build/podvm-*.qcow2 .
image=${{ inputs.registry }}/podvm-generic-fedora
if [ "${{inputs.debug}}" = "true" ]; then
image=${image}-debug
fi
tag=${{ steps.image_tag.outputs.image_tag }}
arch_tag=${tag}_-${{ matrix.platforms.arch }}
oras push "${image}:${arch_tag}" podvm-*.qcow2
# We need to create the platform annotations with docker, since oras 1.2 doesn't support
# pushing with platform yet.
docker manifest create "${image}:${tag}" --amend "${image}:${arch_tag}"
docker manifest annotate --arch "${{ matrix.platforms.arch }}" --os linux "${image}:${tag}" "${image}:${arch_tag}"
docker manifest push "${image}:${tag}"
# add image and digest to output for attestation
echo "image=${image}" >> "$GITHUB_OUTPUT"
digest="$(oras manifest fetch "${image}:${arch_tag}" --descriptor | jq -r .digest)"
echo "digest=${digest}" >> "$GITHUB_OUTPUT"
- uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ steps.publish.outputs.image }}
subject-digest: ${{ steps.publish.outputs.digest }}
push-to-registry: true


- name: Clean up some space for the docker provider build
working-directory: src/cloud-api-adaptor/podvm-mkosi
run: |
Expand Down

0 comments on commit 0293f36

Please sign in to comment.