Build distribution #67
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 distribution | |
| on: [workflow_dispatch] | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm, macOS-14, macOS-13] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| if: matrix.os == 'macOS-13' || matrix.os == 'macOS-14' | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build package | |
| uses: pypa/[email protected] | |
| with: | |
| output-dir: wheelhouse | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 13.0 | |
| CIBW_BEFORE_ALL_MACOS: | |
| brew update && | |
| brew upgrade cmake && | |
| brew install boost && | |
| pip install --upgrade pip | |
| CIBW_BEFORE_ALL_LINUX: " | |
| { yum makecache && yum install -y boost-devel; } || | |
| { apt-get update && apt-get install libboost-all-dev; } | |
| " | |
| CIBW_ARCHS_MACOS: "native" | |
| CIBW_ARCHS_LINUX: "native" | |
| CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13" | |
| CIBW_SKIP: "pp* *musllinux*" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| - name: Build sdist | |
| env: | |
| CIBW_PROJECT_REQUIRES_PYTHON: "3.9" | |
| run: pip install --upgrade pip && pip install build && python -m build --sdist --outdir dist && touch dist/empty.txt | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: source-dist | |
| path: | | |
| dist/*.tar.gz | |
| empty.txt | |
| # upload_pypi: | |
| # needs: [build_wheels, build_sdist] | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'push' | |
| # # if: github.event_name == 'release' && github.event.action == 'published' | |
| # steps: | |
| # - uses: actions/download-artifact@v3 | |
| # with: | |
| # name: artifact | |
| # path: dist | |
| # - uses: pypa/[email protected] | |
| # with: | |
| # user: __token__ | |
| # password: ${{ secrets.pypi_test_password }} | |
| # repository_url: https://test.pypi.org/legacy/ | |
| # verify_metadata: false |