Merge pull request #11 from maximusron/overload-dev #17
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 and upload to PyPI | |
on: [push] | |
jobs: | |
build-aarch64-wheels: | |
runs-on: ubuntu-latest | |
outputs: | |
job_number: ${{ steps.aarch64-job-number.outputs.job_number }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Trigger circleci build for ARM | |
id: aarch64-job-number | |
run: | | |
export JOB_NUMBER=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }}) | |
echo "job_number=$JOB_NUMBER" >> $GITHUB_OUTPUT | |
build_wheels: | |
name: Build wheels on ${{ matrix.cibw.build }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" | |
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}" | |
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}" | |
CIBW_ARCHS_WINDOWS: "${{ matrix.cibw.arch || 'auto' }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-11 | |
name: mac-cpython | |
cibw: | |
arch: x86_64 | |
build: "cp36-macosx_x86_64" | |
- os: macos-11 | |
name: mac-cpython-arm | |
cibw: | |
arch: arm64 | |
build: "cp38-macosx_arm64" | |
- os: macos-11 | |
name: mac-pypy | |
cibw: | |
arch: x86_64 | |
build: "pp37-macosx_x86_64" | |
- os: ubuntu-20.04 | |
name: manylinux-x86_64 | |
cibw: | |
arch: x86_64 | |
build: "cp36-manylinux_x86_64" | |
- os: ubuntu-20.04 | |
name: manylinux-i686 | |
cibw: | |
arch: i686 | |
build: "cp36-manylinux_i686" | |
- os: ubuntu-20.04 | |
name: manylinux-pypy-x86_64 | |
cibw: | |
arch: x86_64 | |
build: "pp37-manylinux_x86_64" | |
- os: windows-2019 | |
name: win32 | |
cibw: | |
arch: x86 | |
build: "cp36-win32" | |
- os: windows-2019 | |
name: win_amd64 | |
cibw: | |
arch: AMD64 | |
build: "cp36-win_amd64" | |
- os: windows-2019 | |
name: win32-arm64 | |
cibw: | |
arch: ARM64 | |
build: "cp39-win_arm64" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
architecture: ${{ matrix.architecture }} | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: customize mac-arm-64 | |
if: contains(matrix.os, 'macos') && matrix.cibw.arch == 'arm64' | |
run: | | |
echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV" | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==2.12.0 | |
- name: list target wheels | |
run: | | |
python -m cibuildwheel cling --print-build-identifiers | |
- name: Build wheels | |
timeout-minutes: 600 | |
run: | | |
python -m cibuildwheel cling --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: cd cling && pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./cling/dist/*.tar.gz | |
upload_aarch64_wheel: | |
needs: [build_wheels, build-aarch64-wheels] # Just wait until this workflow is done - then aarch64 should be done | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Get wheel from CircleCI artifact | |
env: | |
JOB_NUMBER: ${{ needs.build-aarch64-wheels.outputs.job_number }} | |
run: | | |
export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER --token ${{ secrets.CIRCLE_API_TOKEN }}) | |
echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ env.wheel_path }} |