mirror of https://github.com/Nonannet/copapy.git
89 lines
2.1 KiB
YAML
89 lines
2.1 KiB
YAML
name: Build and Publish Wheels
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_stencils:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install cross compilers
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
gcc-12-aarch64-linux-gnu \
|
|
gcc-12-arm-linux-gnueabihf \
|
|
gcc-12-mips-linux-gnu \
|
|
gcc-12-riscv64-linux-gnu
|
|
|
|
- name: Build object files
|
|
run: bash src/copapy/obj/crosscompile.sh
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: stencil-object-files
|
|
path: src/copapy/obj/*.o
|
|
|
|
build_wheels:
|
|
needs: [build_stencils]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-20.04, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: stencil-object-files
|
|
path: src/copapy/obj
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
# Only needed for Linux ARM builds
|
|
- name: Set up QEMU
|
|
if: runner.os == 'Linux'
|
|
uses: docker/setup-qemu-action@v2
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install --upgrade pip cibuildwheel cython setuptools wheel
|
|
|
|
- name: Build wheels
|
|
run: cibuildwheel --output-dir wheelhouse
|
|
env:
|
|
# Multi-arch builds
|
|
CIBW_ARCHS_LINUX: "x86_64 aarch64 armv7" # ppc64le s390x
|
|
CIBW_ARCHS_MACOS: "universal2" # x86_64 arm64
|
|
CIBW_ARCHS_WINDOWS: "AMD64 x86"
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wheels
|
|
path: wheelhouse/*.whl
|
|
|
|
# publish:
|
|
# needs: [build_wheels]
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: wheels
|
|
# path: wheelhouse
|
|
|
|
# - name: Publish to PyPI
|
|
# uses: pypa/gh-action-pypi-publish@v1.8.6
|
|
# with:
|
|
# user: __token__
|
|
# password: ${{ secrets.PYPI_API_TOKEN }}
|