add wheels for apple silicon #370
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 Status | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
strategy: | ||
max-parallel: 16 | ||
fail-fast: false | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | ||
architecture: ["x86", "x64"] | ||
include: | ||
- architecture: "x86" | ||
platform-vcvars: "x86" | ||
platform-msbuild: "Win32" | ||
- architecture: "x64" | ||
platform-vcvars: "x86_amd64" | ||
platform-msbuild: "x64" | ||
exclude: | ||
- platform: macos-13 | ||
Check failure on line 22 in .github/workflows/pypi.yml GitHub Actions / Build StatusInvalid workflow file
|
||
architecture: "x86" | ||
- platform: macos-14 | ||
architecture: "x86" | ||
- platform: ubuntu-latest | ||
architecture: "x86" | ||
name: Build wheels on ${{ matrix.platform }} | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Visual Studio Command Prompt tool | ||
if: contains(matrix.platform, 'windows') | ||
run: | | ||
cmd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.platform-vcvars }} | ||
- name: Upgrade pip and install build/lint/test dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 build pytest | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=lib | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=lib | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.5 | ||
- name: Upload binaries | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.platform }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
build_sdist: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Upgrade pip and install build dependency | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Create source distribution | ||
run: | | ||
pipx run build --sdist | ||
- name: Upload binaries | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
upload_to_pypi: | ||
needs: [build, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download cibw artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
# unpacks all CIBW artifacts into dist/ | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
- name: Publish distribution Test PyPI | ||
if: | | ||
job.status == 'success' | ||
&& github.event_name == 'push' | ||
&& github.ref == 'refs/heads/dev' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution to PyPI | ||
if: | | ||
job.status == 'success' | ||
&& github.event_name == 'push' | ||
&& startsWith(github.event.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |