Skip to content

Commit

Permalink
split jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
WT-MM committed Dec 16, 2024
1 parent 9e51c55 commit 954941b
Showing 1 changed file with 114 additions and 11 deletions.
125 changes: 114 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,116 @@ concurrency:
cancel-in-progress: true

jobs:
build-wheels:
strategy:
matrix:
os: [ubuntu-latest]
name: Build and publish Python package (${{ matrix.os }})
timeout-minutes: 600
runs-on: ${{ matrix.os }}
build-wheels-x86:
name: Build x86_64 wheels
timeout-minutes: 360
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cibuildwheel
shell: bash

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build package
env:
CIBW_SKIP: "pp* *-musllinux*"
CIBW_ARCHS_LINUX: auto
CIBW_BEFORE_ALL_LINUX: |
yum install -y libudev-devel pkgconfig python3-devel python3-pip python3-wheel
CIBW_BEFORE_BUILD: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
pip install setuptools-rust
CIBW_ENVIRONMENT: |
PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH"
CARGO_NET_GIT_FETCH_WITH_CLI=true
run: |
cibuildwheel --output-dir dist
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: wheels-x86_64
path: |
dist/*.whl
build-wheels-arm64:
name: Build ARM64 wheels
timeout-minutes: 360
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cibuildwheel
shell: bash

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build package
env:
CIBW_SKIP: "pp* *-musllinux*"
CIBW_ARCHS_LINUX: aarch64
CIBW_BEFORE_ALL_LINUX: |
yum install -y libudev-devel pkgconfig python3-devel python3-pip python3-wheel
CIBW_BEFORE_BUILD: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
pip install setuptools-rust
CIBW_ENVIRONMENT: |
PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH"
CARGO_NET_GIT_FETCH_WITH_CLI=true
run: |
cibuildwheel --output-dir dist
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: wheels-arm64
path: |
dist/*.whl
build-wheels-s390x:
name: Build s390x wheels
timeout-minutes: 360
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand Down Expand Up @@ -49,10 +152,10 @@ jobs:

- name: Build package
env:
CIBW_SKIP: "pp* *-musllinux*" # Skip PyPy and musllinux builds
CIBW_SKIP: "pp* *-musllinux*"
CIBW_ARCHS_LINUX: s390x
CIBW_BEFORE_ALL_LINUX: |
yum install -y libudev-devel pkgconfig python3-devel python3-pip python3-wheel
CIBW_ARCHS_LINUX: auto aarch64 s390x
CIBW_BEFORE_BUILD: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
Expand All @@ -66,7 +169,7 @@ jobs:
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.os }}
name: wheels-s390x
path: |
dist/*.whl
Expand Down Expand Up @@ -107,7 +210,7 @@ jobs:
dist/*.tar.gz
publish-wheels:
needs: [build-wheels, build-source-dist]
needs: [build-wheels-x86, build-wheels-arm64, build-wheels-s390x, build-source-dist]
name: Publish Python wheels
timeout-minutes: 10
runs-on: ubuntu-latest
Expand Down

0 comments on commit 954941b

Please sign in to comment.