Skip to content

Commit

Permalink
ci: More wheel hell
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Oct 18, 2024
1 parent 22c84ce commit f668414
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/buildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-12, macos-14]
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4

Expand All @@ -24,7 +25,13 @@ jobs:
with:
platforms: all

- name: Set MACOSX_DEPLOYMENT_TARGET dynamically from the runner
if: runner.os == 'macOS'
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d. -f1,2)" >> $GITHUB_ENV

- name: Build wheels
env:
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=${{ env.MACOSX_DEPLOYMENT_TARGET }}
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and upload to PyPI

on:
workflow_dispatch:
release:
types: [published]

jobs:
build_wheels:
Expand All @@ -26,6 +28,8 @@ jobs:
platforms: all

- name: Build wheels
env:
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=11
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ before-all = "yum install -y gcc make zlib-devel openssl-devel libpng-devel"
[tool.cibuildwheel.macos]
archs = ["auto"] # "arm64" needs M1 runner on GitHub Actions
before-all = """
export MACOSX_DEPLOYMENT_TARGET=${sw_vers -productVersion | cut -d. -f1}
brew install pkg-config openssl libpng # -> /usr/local (x86_64)
"""

0 comments on commit f668414

Please sign in to comment.