@@ -50,12 +50,32 @@ jobs:
5050 if : ${{ !startsWith(github.repository, env.REPOSITORY) }}
5151 run : echo "REPOSITORY=$(echo '${{ github.actor }}' | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV}
5252
53- - name : 🛠️ Set up QEMU
54- uses : docker/setup-qemu-action@v3
55-
5653 - name : 🐳 Set up Docker Buildx
5754 uses : docker/setup-buildx-action@v3
5855
56+ - name : 🐳 Set up Docker metadata
57+ id : meta
58+ uses : docker/metadata-action@v5
59+ with :
60+ images : ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}
61+ tags : ${{ inputs.qt_version == '6' && format('{0}-qt6', inputs.codename) || inputs.codename }}
62+ labels : |
63+ org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
64+ org.opencontainers.image.vendor=Hyperion Project
65+ org.opencontainers.image.authors=Hyperion Team
66+ org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
67+ org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
68+ org.opencontainers.image.documentation=https://docs.hyperion-project.org
69+ org.opencontainers.image.licenses=MIT
70+ annotations : |
71+ org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
72+ org.opencontainers.image.vendor=Hyperion Project
73+ org.opencontainers.image.authors=Hyperion Team
74+ org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
75+ org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
76+ org.opencontainers.image.documentation=https://docs.hyperion-project.org
77+ org.opencontainers.image.licenses=MIT
78+
5979 - name : 🔑 Login to GitHub Container Registry
6080 if : ${{ env.SECRET_DOCKER_CI != null }}
6181 uses : docker/login-action@v3
@@ -64,23 +84,15 @@ jobs:
6484 username : ${{ github.actor }}
6585 password : ${{ secrets.DOCKER_CI }}
6686
67- - name : 🐳 Set up Docker metadata
68- id : docker_metadata
69- uses : docker/metadata-action@v5
70- with :
71- images : ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}
72- tags : type=sha
73-
7487 - name : 👷 Build and 🚀 Push digest to GitHub Container/Package Registry
75- id : docker_build
88+ id : build
7689 uses : docker/build-push-action@v6
7790 with :
7891 context : .
7992 file : ${{ matrix.target_platform == 'armv6' && 'debian-armv6' || inputs.distribution == 'fedora' && 'fedora' || 'ubuntu_debian' }}
8093 platforms : ${{ matrix.target_lookup[format('{0}',matrix.target_platform)] }}
94+ labels : ${{ steps.meta.outputs.labels }}
8195 provenance : false
82- labels : ${{ steps.docker_metadata.outputs.labels }}
83- annotations : ${{ steps.docker_metadata.outputs.annotations }}
8496 outputs : type=image,name=ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }},push-by-digest=true,name-canonical=true,push=true
8597 build-args : |
8698 DIST=${{ inputs.distribution }}
92104 - name : ⬇ Export digest
93105 run : |
94106 mkdir -p /tmp/digests
95- digest="${{ steps.docker_build .outputs.digest }}"
107+ digest="${{ steps.build .outputs.digest }}"
96108 touch "/tmp/digests/${digest#sha256:}"
97109
98110 - name : 📦 Upload digest
@@ -107,8 +119,6 @@ jobs:
107119 name : 👷 Merge and 🚀 Push
108120 needs : build_and_push
109121 runs-on : ubuntu-22.04
110- env :
111- TAG : ${{ inputs.qt_version == '6' && format('{0}-qt6', inputs.codename) || inputs.codename }}
112122
113123 steps :
114124 - name : 💾 Download digests
@@ -125,6 +135,29 @@ jobs:
125135 - name : 🐳 Set up Docker Buildx
126136 uses : docker/setup-buildx-action@v3
127137
138+ - name : 🐳 Set up Docker metadata
139+ id : meta
140+ uses : docker/metadata-action@v5
141+ with :
142+ images : ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}
143+ tags : ${{ inputs.qt_version == '6' && format('{0}-qt6', inputs.codename) || inputs.codename }}
144+ labels : |
145+ org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
146+ org.opencontainers.image.vendor=Hyperion Project
147+ org.opencontainers.image.authors=Hyperion Team
148+ org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
149+ org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
150+ org.opencontainers.image.documentation=https://docs.hyperion-project.org
151+ org.opencontainers.image.licenses=MIT
152+ annotations : |
153+ org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
154+ org.opencontainers.image.vendor=Hyperion Project
155+ org.opencontainers.image.authors=Hyperion Team
156+ org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
157+ org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
158+ org.opencontainers.image.documentation=https://docs.hyperion-project.org
159+ org.opencontainers.image.licenses=MIT
160+
128161 - name : 🔑 Login to GitHub Container Registry
129162 if : ${{ env.SECRET_DOCKER_CI != null }}
130163 uses : docker/login-action@v3
@@ -136,8 +169,9 @@ jobs:
136169 - name : 📝 Create manifest list and 🚀 Push to GitHub Container/Package Registry
137170 working-directory : /tmp/digests
138171 run : |
139- docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}:${{ env.TAG }} $(printf 'ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}@sha256:%s ' *)
172+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
173+ $(printf 'ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}@sha256:%s ' *)
140174
141175 - name : 👀 Inspect image
142176 run : |
143- docker buildx imagetools inspect ghcr.io/ ${{ env.REPOSITORY }}/${{ inputs.distribution }}:${{ env.TAG }}
177+ docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
0 commit comments