Wheels #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wheels | |
on: | |
schedule: | |
- cron: '42 2 * * *' | |
push: | |
tags: | |
- v* | |
jobs: | |
build-wheels: | |
name: Build wheels on ${{matrix.os}} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: | |
- macos-13 | |
- macos-15 | |
- ubuntu-24.04 | |
- windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cibuildwheel | |
id: cache-cibuildwheel | |
uses: actions/cache@v4 | |
with: | |
path: .cibuildwheel/ | |
key: ${{matrix.os}}-cibuildwheel | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build | |
uses: pypa/cibuildwheel@v2.21.3 | |
env: | |
CIBW_ARCHS_LINUX: auto64 aarch64 | |
CIBW_ARCHS_MACOS: auto64 | |
CIBW_ARCHS_WINDOWS: auto64 | |
CIBW_CACHE_PATH: ${{github.workspace}}/.cibuildwheel/ | |
CIBW_ENVIRONMENT_LINUX: CXXFLAGS="-flto=auto -DPYBIND11_DETAILED_ERROR_MESSAGES" | |
CIBW_ENVIRONMENT_MACOS: CXXFLAGS="-flto=auto -DPYBIND11_DETAILED_ERROR_MESSAGES" MACOSX_DEPLOYMENT_TARGET=10.13 | |
CIBW_ENVIRONMENT_WINDOWS: CXXFLAGS="/GL /DPYBIND11_DETAILED_ERROR_MESSAGES" LDFLAGS=/LTCG | |
# As for Pillow 11.0.0, there is no aarch64 wheel for the | |
# free-threaded variant of Python 3.13 (both many* and musl*). We | |
# therefore skip the tests to avoid compiling Pillow from source which | |
# generally will fail due to missing dependencies. | |
# | |
# Additonally, there is no PyPy 3.9 aarch64 wheel of NumPy which is | |
# then built from source but fails with enabled LTO. | |
CIBW_TEST_SKIP: cp313t-*linux_aarch64 pp39-manylinux_aarch64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: wheelhouse/*.whl | |
build-sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.13 | |
cache: 'pip' | |
cache-dependency-path: requirements.txt | |
- name: Setup Dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Build | |
run: | | |
pipx run build --sdist --verbose | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/ | |
publish-to-testpypi: | |
name: Publish to TestPyPI | |
if: false # Used for testing purposes only, no trigger conditions yet | |
runs-on: ubuntu-latest | |
needs: | |
- build-sdist | |
- build-wheels | |
environment: | |
name: TestPyPI | |
url: https://test.pypi.org/p/hogpp | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist/ | |
merge-multiple: true | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
publish-to-pypi: | |
name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
runs-on: ubuntu-latest | |
needs: | |
- build-sdist | |
- build-wheels | |
environment: | |
name: PyPI | |
url: https://pypi.org/p/hogpp | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist/ | |
merge-multiple: true | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
deploy-artifacts: | |
name: Deploy Artifacts | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: | |
- build-wheels | |
steps: | |
- name: Download | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist/ | |
merge-multiple: true | |
- name: Deploy | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | |
dist/*.whl |