update github workflows #66
This file contains hidden or 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: main | |
on: | |
push: | |
tags: | |
- '[0-9]*.[0-9]*.[0-9]*' | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
cibw_archs: 'native' | |
- os: ubuntu-arm-2core | |
cibw_archs: 'aarch64' | |
if: startsWith(github.ref, 'refs/tags/') | |
- os: windows-latest | |
cibw_archs: 'native ARM64' | |
if: startsWith(github.ref, 'refs/tags/') | |
- os: macos-latest | |
cibw_archs: 'native arm64' | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Clone Suitesparse | |
run: make suitesparse | |
- name: Clone XLA | |
run: make xla | |
- name: Clone Pybind11 | |
run: make pybind11 | |
- name: Build Wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_SKIP: "*-musllinux* pp*" | |
# CIBW_BEFORE_TEST: "pip install pytest" | |
# CIBW_TEST_COMMAND: "python {project}/.github/run_tests.py" | |
- name: Upload Wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
overwrite: true | |
release: | |
name: Create Release | |
needs: | |
- build-wheels | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Download Linux (x86) wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-ubuntu-latest | |
path: dist | |
- name: Download Linux (ARM) wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: gfp-wheels-ubuntu-arm-2core | |
path: dist | |
- name: Download Windows wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-windows-latest | |
path: dist | |
- name: Download MacOS wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-latest | |
path: dist | |
- name: Release to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* |