File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,33 @@ jobs:
36
36
BUILDS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs" --paginate \
37
37
--jq '.check_runs[] | select(.name | endswith("-env")) | { "config": .name, "build_path": .output.text }' | \
38
38
jq --slurp -c -r)
39
- echo "$BUILDS" | jq .
40
- echo "matrix=${BUILDS}" >> $GITHUB_OUTPUT
39
+ # Group the output by platform.
40
+ GROUPS=$("$BUILDS" | jq -c -r '. as $jobs | map(.config | split(".") | first) | unique | map(. as $group | {"platform": $group, "jobs": $jobs | map(select(.config |startswith($group)))})')
41
+ echo "${GROUPS}" | jq .
42
+ echo "matrix=${GROUPS}" >> $GITHUB_OUTPUT
41
43
42
- ghcr-upload :
44
+ # We need this process step in here, because we have in excess of 256 jobs.
45
+ process :
43
46
needs : discover
47
+ runs-on : ubuntu-latest # You still need runs-on to define a job, but it can be minimal
48
+ strategy :
49
+ fail-fast : false
50
+ matrix :
51
+ group : ${{ fromJson(needs.discover.outputs.matrix) }}
52
+ name : Process Jobs for ${{ matrix.group.platform }}
53
+ outputs :
54
+ jobs : ${{ toJson(matrix.group.jobs) }} # Direct output definition
55
+ steps :
56
+ - name : No-op step (required to have at least one step)
57
+ run : echo "No-op" # Minimal step to satisfy step requirement
58
+
59
+ ghcr-upload :
60
+ needs : process
44
61
name : Container Upload
45
62
strategy :
46
63
fail-fast : false
47
64
matrix :
48
- job : ${{ fromJson(needs.discover .outputs.matrix) }}
65
+ job : ${{ fromJson(needs.process .outputs.matrix) }}
49
66
runs-on : ubuntu-latest
50
67
permissions :
51
68
contents : read
You can’t perform that action at this time.
0 commit comments