ci: disable cross-compilation #249
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: Build | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.sys.os }} | |
runs-on: ${{ matrix.sys.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
sys: | |
- { os: windows-2019, shell: "msys2 {0}" } | |
- { os: ubuntu-22.04, shell: bash } | |
- { os: macos-14, shell: bash } | |
- { os: macos-14-arm64, shell: bash } | |
defaults: | |
run: | |
shell: ${{ matrix.sys.shell }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- if: runner.os == 'Windows' | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
path-type: inherit | |
install: >- | |
mingw-w64-x86_64-gcc-fortran | |
- name: Build wheels | |
run: | | |
if [[ "${{ runner.arch }}" == "ARM64" || "${{ runner.arch }}" == "arm64" ]]; then | |
export CIBW_ARCHS=arm64 | |
export CIBW_SKIP="*-macosx_x86_64" | |
else | |
export CIBW_ARCHS=x86_64 | |
export CIBW_SKIP="*-macosx_arm64" | |
fi | |
pipx run cibuildwheel | |
- name: Make wheels pythonless | |
run: | | |
pip install wheel>=0.40.0 | |
wheel tags --python-tag py3 --abi-tag none --remove ./wheelhouse/*.whl | |
- if: runner.os == 'Linux' | |
name: Build source distribution | |
run: | | |
pipx run build --sdist --outdir=wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-wheels-${{ matrix.sys.os }} | |
path: | | |
./wheelhouse/*.whl | |
./wheelhouse/*.tar.gz | |
publish: | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: python-wheels* | |
path: dist | |
merge-multiple: true | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 |