Update project and build files #19
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, test wheels & Publish | |
| on: [push, pull_request] | |
| jobs: | |
| build_test_wheels: | |
| name: Build & test wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Used to host cibuildwheel | |
| - uses: actions/setup-python@v3 | |
| - name: Install cibuildwheel & build | |
| run: python -m pip install cibuildwheel==2.10.2 build | |
| - name: Build wheels & test | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BEFORE_ALL_LINUX: yum install -y lksctp-tools-devel | |
| #for now just a quick test of loopback | |
| CIBW_TEST_COMMAND: python3 {project}/test_loopback.py | |
| #skipping PyPy and musllinux builds | |
| CIBW_SKIP: "pp* *musllinux*" | |
| - name: Build sdist | |
| run: python -m build --sdist -o wheelhouse | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: | | |
| ./wheelhouse/*.whl | |
| ./wheelhouse/*.tar.gz | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' }} | |
| needs: | |
| - build_test_wheels | |
| steps: | |
| - name: setup python ${{ env.DEFAULT_PYTHON }} | |
| uses: actions/setup-python@v4 | |
| - name: download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist/ | |
| - name: publish built artifacts to test.pypi.org | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository_url: https://test.pypi.org/legacy/ | |
| skip_existing: true | |
| - name: publish built artifacts to pypi.org | |
| if: ${{ startsWith(github.ref, 'refs/tag') }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |