Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Nov 24, 2024
1 parent bb4c36f commit e441da4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ jobs:
steps:
- id: matrix
name: build matrix
shell: python
run: |
jq --version
QUERY='reduce .[] as $platform ([]; . += reduce $platform.policies.[] as $policy ([];. += [{policy: $policy, platform: $platform.platform, runner: $platform.runner}]))'
echo "${QUERY}"
JSON=$(cat << EOF | jq -c "${QUERY}"
[
{"platform": "x86_64", "runner": "ubuntu-22.04", "policies": ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"]},
{"platform": "aarch64", "runner": "ubuntu-22.04", "policies": ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"]},
{"platform": "i686", "runner": "ubuntu-22.04", "policies": ["manylinux2014", "musllinux_1_2"]},
{"platform": "armv7l", "runner": "ubuntu-22.04", "policies": ["manylinux_2_31", "musllinux_1_2"]}
import os
import json
reduced = [
("x86_64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
("aarch64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
("i686", "ubuntu-22.04", ("manylinux2014", "musllinux_1_2")),
("armv7l", "ubuntu-22.04", ("manylinux_2_31", "musllinux_1_2")),
]
EOF
)
echo "matrix=${JSON}" >> $GITHUB_OUTPUT
expanded = [{"policy": policy, "platform": platform, "runner": runner} for platform, runner, policies in reduced for policy in policies]
print(json.dumps(expanded, indent=2))
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"matrix={json.dumps(expanded)}")
build_manylinux:
name: ${{ matrix.policy }}_${{ matrix.platform }}
Expand Down

0 comments on commit e441da4

Please sign in to comment.