Migrate to meson build system with PPL 1.2 #59
Workflow file for this run
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: Distributions | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| tags: [ "*" ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| sdist: | |
| name: Build sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgmp-dev libmpfr-dev libmpc-dev | |
| - name: Build sdist | |
| run: | | |
| pip install build | |
| python -m build --sdist | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-sdist | |
| path: dist/*.tar.gz | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: sdist | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - macos-15-intel | |
| - ubuntu-24.04-arm | |
| env: | |
| CIBW_BUILD: "cp312-* cp313-* cp314-* cp314t-*" | |
| CIBW_ENABLE: "cpython-freethreading" | |
| CIBW_BEFORE_BUILD_LINUX: >- | |
| (command -v apk > /dev/null && apk add --no-cache m4 g++ || true) && | |
| cd /tmp && | |
| tar xJf {project}/gmp-6.3.0.tar.xz && | |
| cd gmp-6.3.0 && | |
| ./configure --disable-shared --enable-static --enable-cxx --with-pic --prefix=/usr/local && | |
| make -j$(nproc) && | |
| make install && | |
| cd /tmp && | |
| tar xzf {project}/glpk-5.0.tar.gz && | |
| cd glpk-5.0 && | |
| ./configure --disable-shared --enable-static --with-pic --prefix=/usr/local && | |
| make -j$(nproc) && | |
| make install | |
| CIBW_ENVIRONMENT_LINUX: >- | |
| LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH | |
| CPATH=/usr/local/include:$CPATH | |
| PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH | |
| CIBW_BEFORE_BUILD_MACOS: >- | |
| brew install gmp glpk && | |
| rm -f $(brew --prefix gmp)/lib/libgmp*.dylib $(brew --prefix gmp)/lib/libgmpxx*.dylib && | |
| rm -f $(brew --prefix glpk)/lib/libglpk*.dylib | |
| CIBW_ENVIRONMENT_MACOS: >- | |
| MACOSX_DEPLOYMENT_TARGET=15.0 | |
| CPATH=$(brew --prefix gmp)/include:$(brew --prefix glpk)/include:$CPATH | |
| LIBRARY_PATH=$(brew --prefix gmp)/lib:$(brew --prefix glpk)/lib:$LIBRARY_PATH | |
| CIBW_BUILD_FRONTEND: build | |
| CIBW_TEST_COMMAND: >- | |
| python {project}/tests/runtests.py | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Download GMP & GLPK source | |
| run: | | |
| curl -fL --retry 3 --connect-timeout 30 -o gmp-6.3.0.tar.xz https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz | |
| curl -fL --retry 3 --connect-timeout 30 -o glpk-5.0.tar.gz https://ftp.gnu.org/gnu/glpk/glpk-5.0.tar.gz | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| with: | |
| output-dir: wheelhouse | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| pypi_publish: | |
| name: Upload to PyPI | |
| needs: [sdist, build_wheels] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| skip-existing: true | |
| verbose: true |