|
58 | 58 | # Tags have limited set of valid character, '+' not included |
59 | 59 | # https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests |
60 | 60 | run: | |
61 | | - echo "tag=$(echo -n "${{ matrix.torch }}${{ matrix.index && format('-{0}', matrix.index) || '' }}-${{ matrix.python }}${PLATFORM+-}${PLATFORM#*/}" | tr -c 'a-zA-Z0-9._-' '[-*]')" >> $GITHUB_OUTPUT |
| 61 | + echo "tag=$(echo -n "${{ matrix.torch }}${{ matrix.index && format('-{0}', matrix.index) || '' }}-${{ matrix.python }}${PLATFORM:+-}${PLATFORM#*/}" | tr -c 'a-zA-Z0-9._-' '[-*]')" >> $GITHUB_OUTPUT |
62 | 62 | env: |
63 | 63 | PLATFORM: ${{ matrix.index != 'cpu' && matrix.platform || '' }} |
64 | 64 |
|
|
88 | 88 | - name: Create attestation for the image |
89 | 89 | uses: actions/attest-build-provenance@v3 |
90 | 90 | with: |
91 | | - subject-name: ${{ vars.DOCKERHUB_USERNAME }}/python-torch:${{ steps.build-tag.outputs.tag }} |
| 91 | + subject-name: docker.io/${{ vars.DOCKERHUB_USERNAME }}/python-torch:${{ steps.build-tag.outputs.tag }} |
92 | 92 | subject-digest: ${{ steps.build-push.outputs.digest }} |
93 | 93 | push-to-registry: true |
94 | 94 |
|
@@ -117,18 +117,19 @@ jobs: |
117 | 117 | # This must match the build job tag generation |
118 | 118 | tag="$(echo -n "${{ matrix.torch }}${{ matrix.index && format('-{0}', matrix.index) || '' }}-${{ matrix.python }}" | tr -c 'a-zA-Z0-9._-' '[-*]')" |
119 | 119 | echo "tag=${tag}" >> $GITHUB_OUTPUT |
120 | | - name="$DOCKERHUB_USERNAME/python-torch:${tag}" |
| 120 | + repository="docker.io/$DOCKERHUB_USERNAME/python-torch" |
| 121 | + name="$repository:$tag" |
121 | 122 | echo "name=${name}" >> $GITHUB_OUTPUT |
122 | 123 | docker buildx imagetools create \ |
123 | 124 | --tag $name \ |
124 | 125 | ${name}-amd64 \ |
125 | 126 | ${name}-arm64 |
126 | | - # Unfortunately we don't get the digest directly so we need to query it |
| 127 | + # Unfortunately we don't get the digest directly so we need to query it risking it get changed |
127 | 128 | DIGEST=$(docker buildx imagetools inspect "${name}" --format '{{ print .Manifest.Digest }}') |
128 | 129 | # Ensure the images bundled behind the digest about to be attested still have valid attestations |
129 | | - for digest in $(docker buildx imagetools inspect "$DOCKERHUB_USERNAME/python-torch@$DIGEST" --format '{{ range .Manifest.Manifests }}{{ .Digest }} {{ end }}') |
| 130 | + for digest in $(docker buildx imagetools inspect "$repository@$DIGEST" --format '{{ range .Manifest.Manifests }}{{ .Digest }} {{ end }}') |
130 | 131 | do |
131 | | - gh attestation verify oci://$DOCKERHUB_USERNAME/python-torch@${digest} \ |
| 132 | + gh attestation verify oci://$repository@$digest \ |
132 | 133 | --repo $GITHUB_REPOSITORY \ |
133 | 134 | --signer-workflow $GITHUB_WORKFLOW_REF \ |
134 | 135 | --source-digest $GITHUB_SHA |
|
0 commit comments