Meta: Include docs and Makefile #49
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 wheels, sdist, and upload to PyPI (only on release!) | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "rc-v*.*.*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-20.04, macOS-11, macOS-12] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Used to host cibuildwheel | |
| - uses: actions/setup-python@v2 | |
| - name: Install pkgconfig | |
| run: python -m pip install pkgconfig | |
| - name: Install packaging | |
| run: python -m pip install packaging | |
| - name: Get libsemigroups version | |
| id: libsemigroups_version | |
| run: echo "::set-output name=version::$(python etc/libsemigroups_version.py)" | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel==2.11.3 | |
| - name: Build wheels | |
| env: | |
| CIBW_BEFORE_ALL: > | |
| curl -L -O https://github.com/libsemigroups/libsemigroups/releases/download/v${{ steps.libsemigroups_version.outputs.version }}/libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| tar -xf libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| rm -f libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| cd libsemigroups-${{ steps.libsemigroups_version.outputs.version }} && | |
| ./configure --disable-hpcombi && | |
| make -j4 && make install | |
| CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig | |
| CIBW_ARCHS_MACOS: x86_64 | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: wheels | |
| path: wheelhouse/*.whl | |
| make_sdist: | |
| name: Make source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v2 | |
| - name: Install pkgconfig | |
| run: python -m pip install pkgconfig | |
| - name: Install packaging | |
| run: python -m pip install packaging | |
| - name: Get libsemigroups version | |
| id: libsemigroups_version | |
| run: echo "::set-output name=version::$(python etc/libsemigroups_version.py)" | |
| - name: Install libsemigroups | |
| run: | | |
| curl -L -O https://github.com/libsemigroups/libsemigroups/releases/download/v${{ steps.libsemigroups_version.outputs.version }}/libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| tar -xf libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| rm -f libsemigroups-${{ steps.libsemigroups_version.outputs.version }}.tar.gz && | |
| cd libsemigroups-${{ steps.libsemigroups_version.outputs.version }} && | |
| ./configure --disable-hpcombi && | |
| make -j4 && sudo make install | |
| - name: Build SDist | |
| run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| upload: | |
| if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} | |
| needs: [build_wheels, make_sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download wheels artifact | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: wheels | |
| path: dist | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: List directory contents | |
| run: ls dist | |
| - name: Publish | |
| uses: pypa/gh-action-pypi-publish@v1.4.2 | |
| with: | |
| user: ${{ secrets.PYPI_USERNAME }} | |
| password: ${{ secrets.PYPI_PASSWORD }} |