Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vicamo committed Feb 3, 2025
1 parent 6bc764c commit 8e33596
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
UNAVAILABLES: ${{ steps.processing.outputs.unavailables }}
run: |
available='[]'
echo "Retrieving image manifest:"
echo "::group::Retrieving image manifest"
for image in $({ echo "${CODENAMES}"; echo "${UNAVAILABLES}"; } |
jq -s 'map(.[])' |
jq -r -M '.[] | .distribution + ":" + .codename' |
Expand All @@ -196,6 +196,7 @@ jobs:
available="$(echo "${available}" |
jq -c -M '. + [{ "image":"'"${image}"'", "platforms":'"${platforms_json}"' }]')"
done
echo "::endgroup::"
echo "::group::Availables"
echo "${available}" | jq
Expand All @@ -204,31 +205,33 @@ jobs:
unbuildables="$(echo "${CODENAMES}" |
jq -c -M 'map(. as $s |
('"${available}"' | map(select(.image == ($s.distribution + ":" + $s.codename))) | map(.platforms[])) as $available |
{
"codename":$s.codename,
"architectures":(
[
$s.codename,
(
$s.architectures | fromjson |
map(select(. as $a | $available | map(select(. == $a.platform)) | length == 0)) |
map(.arch)
)
}) |
map(select(.architectures | length > 0))')"
),
"unavailable"
]) |
map(select(.[1] | length > 0))')"
if [ "${unbuildables}" != "[]" ]; then
echo "::group::Images unavalble at present but are to be built"
echo "${unbuildables}" | jq
echo "::endgroup::"
fi
buildables="$(echo "${UNAVAILABLES}" |
jq -c -M 'map(. as $s | {
"codename":$s.codename,
"architectures": (
($s.architectures | map(. as $arch | '"${DEBIAN_ARCHES}"' | map(select(. == $arch))[0][1])) as $platforms |
jq -c -M 'map(. as $s | [
$s.codename,
(
($s.architectures | map(. as $arch | '"${DEBIAN_ARCHES}"' | map(select(.[0] == $arch))[0][1])) as $platforms |
('"${available}"' | map(select(.image == ($s.distribution + ":" + $s.codename))) | map(.platforms[])) as $available |
$platforms - ($platforms - $available)
)
}) |
map(select(.architectures | length > 0))')"
),
"TODOs"
]) |
map(select(.[1] | length > 0))')"
if [ "${buildables}" != "[]" ]; then
echo "::group::Images skipped due to unavailability but are avalble now"
echo "${buildables}" | jq
Expand Down

0 comments on commit 8e33596

Please sign in to comment.