Build, test and publish wheels #1
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, test and publish wheels | |
on: | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
cibw_archs: "aarch64" | |
- os: macos-13 | |
cibw_archs: "x86_64" | |
- os: macos-14 | |
cibw_archs: "arm64" | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
with: | |
egress-policy: audit | |
- name: Checkout repository | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
lfs: true | |
- name: Set up QEMU [aarch64 only] | |
if: matrix.cibw_archs == 'aarch64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: geti-sdk-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_source: | |
name: Build source distribution and pure python wheel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | |
with: | |
python-version: 3.9 | |
- name: Install package with dev and notebook requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev, notebooks] | |
- name: Install build tools | |
run: pip install build twine | |
- name: Build package | |
run: python -m build | |
- name: Check package contents | |
run: twine check dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: geti-sdk | |
path: dist |