Skip to content

MAINT: Update

MAINT: Update #780

Workflow file for this run

# This CI run builds wheels using the cibuildwheel infrastructure.
# This means it:
# - Uses as old dependencies/infrastructure as possible:
# - An old manylinux docker container on Linux
# - An old MACOSX_DEPLOYMENT_TARGET on macOS
# - An old SYSTEM_VERSION target on Windows
# - Builds OpenMEEG
# - Creates wheels
# - Delocates them
# - Uploads them to TestPyPI (main) or PyPi (releases)
# Most of the config lives in `pyproject.toml` and build_tools/cibw_* scripts.
name: cibuildwheel
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
env:
BUILD_TYPE: Release
# https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions
jobs:
build_wheels:
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: macos-11
archs_macos: "x86_64"
- os: macos-11
archs_macos: "arm64"
- os: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4 # to make before-all work properly
with:
python-version: '3.10'
- uses: hendrikmuhs/ccache-action@v1.2
if: matrix.os != 'ubuntu-20.04'
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.archs_macos }}
- name: Cache vcpkg
if: matrix.os != 'ubuntu-20.04'
uses: actions/cache@v3
with:
path: |
vcpkg
build/vcpkg_installed
key: ${{ github.job }}-${{ hashFiles('**/vcpkg.json') }}-${{ matrix.os }}-${{ matrix.archs_macos }}-0
- uses: pypa/cibuildwheel@v2.16.2
with:
package-dir: ./wrapping/python
output-dir: wheelhouse
env:
CIBW_ARCHS_MACOS: "${{matrix.archs_macos}}"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_test_pypi:
name: Upload to TestPyPI
needs: [build_wheels]
runs-on: ubuntu-latest
# upload to Test PyPI for every commit on main branch
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.OPENMEEG_TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
upload_pypi:
name: Upload to PyPI
needs: [build_wheels]
runs-on: ubuntu-latest
# upload to PyPI on every tag (we assume these are releases!)
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.OPENMEEG_PYPI_TOKEN }}