Build Wheels #129
Workflow file for this run
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: Build Wheels | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [windows-latest, ubuntu-latest] | |
os: [windows-latest, ubuntu-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
submodules: 'recursive' | |
- name: Force update submodules | |
run: | | |
git submodule sync --recursive | |
git submodule update --init --recursive --force | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.20.0 | |
env: | |
CIBW_BUILD: 'cp39-* cp310-* cp311-* cp312-* cp313-*' | |
CIBW_PRERELEASE_PYTHONS: 1 | |
CIBW_SKIP: '*win32 *i686' # Don't build for 32-bit | |
CIBW_ARCHS_MACOS: x86_64 arm64 | |
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=11.0 | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
test_wheels: | |
name: Test wheels on Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
needs: build_wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macOS-latest] | |
python-version: ['3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download wheels | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: wheelhouse | |
- name: Install and test the built wheel | |
run: | | |
pip install --find-links wheelhouse geodesk | |
pip install pytest | |
cd test | |
pytest test_basic.py | |
upload_wheels: | |
name: Upload Wheels to PyPI | |
needs: test_wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download built wheels | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: wheelhouse | |
- name: Set up Python for twine | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Publish to PyPI | |
run: | | |
python -m pip install twine | |
twine upload --skip-existing --non-interactive -u __token__ -p ${{ secrets.PYPI_TOKEN }} wheelhouse/*.whl |