Skip to content

Switching to scikit-build-core instead of meson for building #153

Switching to scikit-build-core instead of meson for building

Switching to scikit-build-core instead of meson for building #153

Workflow file for this run

name: Release
on:
release:
types: [published]
push:
branches: [main]
pull_request:
jobs:
build_wheels:
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-22.04, manylinux, x86_64]
- [macos-latest, macosx, universal2]
- [windows-2019, win, AMD64]
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python[1]}}
# - name: Set up Windows
# run: |
# choco install rtools -y --no-progress --force --version=4.0.0.20220206
# echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
# if: ${{ runner.os == 'Windows' }}
- name: Set up macOS
run: brew unlink gfortran && brew link --overwrite gfortran
if: ${{ runner.os == 'macOS' }}
- uses: pypa/cibuildwheel@v2.14.0
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
CIBW_TEST_COMMAND_LINUX: "SPS_HOME={project}/src/fsps/libfsps python {project}/tests/simple.py"
SPS_HOME: ${{ github.workspace }}/src/fsps/libfsps
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.9"
- name: Build sdist
run: |
python -m pip install -U pip
python -m pip install -U build
python -m build --sdist .
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.8.7
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/