|
34 | 34 | required: false |
35 | 35 | type: number |
36 | 36 | default: 0 |
| 37 | + platforms: |
| 38 | + description: "Comma-separated wheel platforms to build, such as linux-x86_64; empty builds all" |
| 39 | + required: false |
| 40 | + type: string |
| 41 | + default: "" |
37 | 42 | outputs: |
38 | 43 | sha: |
39 | 44 | description: "Commit the distributions were built from" |
|
49 | 54 | outputs: |
50 | 55 | sha: ${{ steps.source.outputs.sha }} |
51 | 56 | tree: ${{ steps.source.outputs.tree }} |
| 57 | + platforms: ${{ steps.platforms.outputs.platforms }} |
52 | 58 | steps: |
53 | 59 | - uses: actions/checkout@v4 |
54 | 60 | with: |
|
61 | 67 | echo "sha=${sha}" >> "${GITHUB_OUTPUT}" |
62 | 68 | echo "tree=${tree}" >> "${GITHUB_OUTPUT}" |
63 | 69 | echo "Distributions for commit ${sha} with tree ${tree}" >> "${GITHUB_STEP_SUMMARY}" |
| 70 | + # The wheel platform matrix. DuckDB's C++ needs aligned deallocation, available from macOS 10.13. |
| 71 | + - name: Choose the wheel platforms |
| 72 | + id: platforms |
| 73 | + env: |
| 74 | + ONLY: ${{ inputs.platforms }} |
| 75 | + run: | |
| 76 | + all='[ |
| 77 | + {"name": "linux-x86_64", "runner": "ubuntu-24.04", "target": "x86_64"}, |
| 78 | + {"name": "linux-aarch64", "runner": "ubuntu-24.04-arm", "target": "aarch64"}, |
| 79 | + {"name": "macos-x86_64", "runner": "macos-15-intel", "target": "x86_64", "macos-target": "10.15"}, |
| 80 | + {"name": "macos-arm64", "runner": "macos-15", "target": "aarch64", "macos-target": "11.0"}, |
| 81 | + {"name": "windows-x86_64", "runner": "windows-2025", "target": "x86_64"} |
| 82 | + ]' |
| 83 | + chosen="$(jq -c --arg only "${ONLY}" \ |
| 84 | + 'if $only == "" then . else [.[] | select(.name as $name | $only | split(",") | index($name))] end' \ |
| 85 | + <<< "${all}")" |
| 86 | + if [[ "${chosen}" == "[]" ]]; then |
| 87 | + echo "No wheel platform is named ${ONLY}" >&2 |
| 88 | + exit 1 |
| 89 | + fi |
| 90 | + echo "platforms=${chosen}" >> "${GITHUB_OUTPUT}" |
| 91 | + echo "Wheel platforms: $(jq -r 'map(.name) | join(", ")' <<< "${chosen}")" >> "${GITHUB_STEP_SUMMARY}" |
64 | 92 | - name: Download the prebuilt manifest |
65 | 93 | if: inputs.prebuilt-run-id != '' |
66 | 94 | uses: actions/download-artifact@v4 |
@@ -92,25 +120,7 @@ jobs: |
92 | 120 | strategy: |
93 | 121 | fail-fast: false |
94 | 122 | matrix: |
95 | | - platform: |
96 | | - - name: linux-x86_64 |
97 | | - runner: ubuntu-24.04 |
98 | | - target: x86_64 |
99 | | - - name: linux-aarch64 |
100 | | - runner: ubuntu-24.04-arm |
101 | | - target: aarch64 |
102 | | - # DuckDB's C++ needs aligned deallocation, available from macOS 10.13. |
103 | | - - name: macos-x86_64 |
104 | | - runner: macos-15-intel |
105 | | - target: x86_64 |
106 | | - macos-target: "10.15" |
107 | | - - name: macos-arm64 |
108 | | - runner: macos-15 |
109 | | - target: aarch64 |
110 | | - macos-target: "11.0" |
111 | | - - name: windows-x86_64 |
112 | | - runner: windows-2025 |
113 | | - target: x86_64 |
| 123 | + platform: ${{ fromJSON(needs.source.outputs.platforms) }} |
114 | 124 | steps: |
115 | 125 | - uses: actions/checkout@v4 |
116 | 126 | if: inputs.prebuilt-run-id == '' |
|
0 commit comments