Skip to content

Commit

Permalink
ci: update cibuildwheel
Browse files Browse the repository at this point in the history
This is an attempt to fix the macos has the wrong *.so part of the
issue zxing-cpp#695.
  • Loading branch information
axxel committed Feb 20, 2024
1 parent f7c9de4 commit ec05db6
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,31 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install cibuildwheel
run: python3 -m pip install cibuildwheel==2.16.2
run: python3 -m pip install cibuildwheel==2.16.5

- name: Build wheels
run: python3 -m cibuildwheel --output-dir wheelhouse wrappers/python
env:
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*musllinux*"
# the default maylinux2014 image does not contain a c++20 compiler, see https://github.com/pypa/manylinux
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_ARCHS_MACOS: universal2
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES="arm64;x86_64"
CIBW_ARCHS_MACOS: "x86_64 arm64" # universal2
# CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES="arm64;x86_64"
MACOSX_DEPLOYMENT_TARGET: "10.13"
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v3 # v4 breaks the build, see https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
- name: Upload wheels
uses: actions/upload-artifact@v4 # v4 breaks the build, see https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build-sdist:
Expand All @@ -55,7 +59,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -70,8 +74,10 @@ jobs:
working-directory: wrappers/python
run: python3 setup.py sdist

- uses: actions/upload-artifact@v3
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: wrappers/python/dist/*.tar.gz

upload-pypi:
Expand All @@ -89,8 +95,12 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist
merge-multiple: true

- name: List wheels
run: ls dist

- uses: pypa/gh-action-pypi-publish@release/v1
# with:
Expand Down

0 comments on commit ec05db6

Please sign in to comment.