Skip to content

Commit

Permalink
Fix publish workflow (#57)
Browse files Browse the repository at this point in the history
* add python3

* ppc64 fix

* remove ppc64

* cargo

* extend timeout

* split jobs

* skip problematic jobs
  • Loading branch information
WT-MM authored Dec 17, 2024
1 parent b6b4805 commit 4016694
Showing 1 changed file with 116 additions and 15 deletions.
131 changes: 116 additions & 15 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: 180
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* cp313-*"
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,15 +152,13 @@ jobs:

- name: Build package
env:
CIBW_SKIP: "pp* *-musllinux*" # Skip PyPy and musllinux builds
CIBW_SKIP: "pp* *-musllinux* cp312-* cp313-*"
CIBW_ARCHS_LINUX: s390x
CIBW_BEFORE_ALL_LINUX: |
yum install -y libudev-devel pkgconfig
CIBW_BEFORE_ALL_MACOS: |
brew install openssl pkg-config
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x
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
source $HOME/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"
pip install setuptools-rust
CIBW_ENVIRONMENT: |
PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH"
Expand All @@ -68,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 @@ -109,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 4016694

Please sign in to comment.