Skip to content

Commit

Permalink
Attempt to build wheels in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Oct 15, 2024
1 parent d70d206 commit c2e5906
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/python-distributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,44 @@ on:
- cron: "0 6 * * *" # Daily 6AM UTC build

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
# output all build identifiers when running on the default branch or a
# tag, otherwise just the latest Python version
build-identifiers: ${{ steps.build-identifiers.outputs.build-identifiers }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Find build identifiers using cibuildwheel --print-build-identifiers
id: all-build-identifiers
run: echo "all-build-identifiers=$(cibuildwheel --print-build-identifiers | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> $GITHUB_OUTPUT
- name: Set build identifiers to latest Python version
id: latest-build-identifiers
run: echo "latest-build-identifiers=[\"$(python -c 'import sys; print(f"cp{sys.version_info.major}{sys.version_info.minor}-*", end="")')\"]" >> $GITHUB_OUTPUT
- name: Set build identifiers output
id: build-identifiers
run: |
if [ "$GITHUB_REF" = "refs/heads/main" ] || [ "$GITHUB_REF" = "refs/heads/master" ] || [ "$GITHUB_REF" = "refs/tags/"* ]; then
echo "::set-output name=build-identifiers::${{ steps.all-build-identifiers.outputs.all-build-identifiers }}"
else
echo "::set-output name=build-identifiers::${{ steps.latest-build-identifiers.outputs.latest-build-identifiers }}"
fi
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-prefix: [pp, cp]
build-identifiers: ${{fromJson(needs.define-matrix.outputs.build-identifiers)}}
fail-fast: true

steps:
Expand Down

0 comments on commit c2e5906

Please sign in to comment.