1- env :
2- IMAGE_TAG : 2025-11-21.9
3-
41on :
52 workflow_call :
63 outputs :
7- image :
8- description : " The build image "
9- value : ${{ jobs.build-container .outputs.image }}
4+ images :
5+ description : " The build images "
6+ value : ${{ jobs.collect .outputs.outcomes }}
107 image_options :
118 description : " The options to use with the image"
129 value : --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined --privileged
1714 runs-on : ubuntu-latest
1815 strategy :
1916 matrix :
20- image : ['ubuntu-latest', 'fedora-latest']
21-
22- outputs :
23- image : ${{ steps.check.outputs.image }}
17+ image :
18+ - ' ubuntu-latest:2025-11-21.9'
19+ - ' fedora-latest:2025-11-21.10'
2420
2521 steps :
2622 - name : Login to GHCR
@@ -35,16 +31,22 @@ jobs:
3531 run : |
3632 ACTOR="${{ github.actor }}"
3733 OWNER="${{ github.repository_owner }}"
38- image_actor="ghcr.io/${ACTOR,,}/flatpak-ci:${{ env.IMAGE_TAG }}"
39- image_owner="ghcr.io/${OWNER,,}/flatpak-ci:${{ env.IMAGE_TAG }}"
4034
41- if docker manifest inspect "${image_owner}-${{ matrix.image }}" >/dev/null ; then
35+ image_name=$(echo "${{ matrix.image }}" | cut -d':' -f1)
36+ image="flatpak-ci-${{ matrix.image }}"
37+
38+ echo "image_name=${image_name}" >> "$GITHUB_OUTPUT"
39+
40+ image_owner="ghcr.io/${OWNER,,}/${image}"
41+ image_actor="ghcr.io/${ACTOR,,}/${image}"
42+
43+ if docker manifest inspect "${image_owner}" >/dev/null ; then
4244 echo "exists=true" >> "$GITHUB_OUTPUT"
4345 echo "image=${image_owner}" >> "$GITHUB_OUTPUT"
4446 exit 0
4547 fi
4648
47- if docker manifest inspect "${image_actor}-${{ matrix.image }} " >/dev/null ; then
49+ if docker manifest inspect "${image_actor}" >/dev/null ; then
4850 echo "exists=true" >> "$GITHUB_OUTPUT"
4951 echo "image=${image_actor}" >> "$GITHUB_OUTPUT"
5052 exit 0
5860 uses : docker/build-push-action@v5
5961 with :
6062 push : true
61- file : .github/workflows/containers/${{ matrix.image }}.containerfile
62- tags : ${{ steps.check.outputs.image }}-${{ matrix.image }}
63+ file : .github/workflows/containers/${{ steps.check.outputs.image_name }}.containerfile
64+ tags : ${{ steps.check.outputs.image }}
65+
66+ - name : Record the result
67+ run : |
68+ jq -cn \
69+ --arg name "${{ steps.check.outputs.image_name }}" \
70+ --arg image "${{ steps.check.outputs.image }}" \
71+ '$ARGS.named' > outcome
72+
73+ - name : Upload the result
74+ uses : actions/upload-artifact@v4
75+ with :
76+ name : ${{ hashFiles('outcome') }}
77+ path : outcome
78+
79+ collect :
80+ name : Collect build container results
81+ runs-on : ubuntu-latest
82+ needs : build-container
83+ if : ${{ !cancelled() }}
84+ outputs :
85+ outcomes : ${{ steps.collect.outputs.outcomes }}
86+
87+ steps :
88+ - uses : actions/download-artifact@v4
89+ - id : collect
90+ run : |
91+ outcomes="$(cat */outcome | jq -c --slurp 'map({(.name): .image})')"
92+ echo $outcomes
93+ echo outcomes=$outcomes >> $GITHUB_OUTPUT
0 commit comments