diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0ec61d2..a4435fb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}