Skip to content

Build

Build #114

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
release:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-wheels:
name: Build wheels for ${{ matrix.pyver }} on ${{ matrix.platform.os }} ${{ matrix.platform.arch }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
pyver: [cp39, cp310, cp311, cp312]
platform:
- arch: x86_64
os: ubuntu-20.04
- arch: arm64
os: macos-11
- arch: x86_64
os: macos-11
- arch: x86
os: windows-2019
- arch: AMD64
os: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.pyver }}-*
CIBW_ARCHS: ${{ matrix.platform.arch }}
with:
package-dir: .
output-dir: dist
config-file: pyproject.toml
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build source distribution
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
check:
name: All wheels built successfully
if: always()
needs:
- build-wheels
runs-on: ubuntu-latest
steps:
- name: Check build matrix status
if: ${{ !success() }}
run: exit 1
publish:
name: Publish package
runs-on: ubuntu-latest
needs:
- build-wheels
- build-sdist
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- id: download-artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1