Release CI #43
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: Release Actions | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.platform == 'native' && 'ubuntu-latest' || 'ubuntu-latest-arm' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [native, aarch64, armv7l] | |
| python: [cp37, cp38, cp39, cp310, cp311, cp312, cp313] | |
| tag: [manylinux, musllinux] | |
| steps: | |
| - name: Checkout Current Repo | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install dependencies | |
| if: matrix.platform == 'native' | |
| run: | | |
| sudo apt install python3-dev | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install -r requirements-build.txt | |
| - name: Set up QEMU | |
| if: matrix.platform == 'armv7l' | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build wheels with cibuildwheels | |
| uses: pypa/cibuildwheel@v2.23.3 | |
| env: | |
| CIBW_ARCHS_LINUX: ${{ matrix.platform }} | |
| CIBW_SKIP: pp* *ppc64le *s390x | |
| CIBW_BUILD_VERBOSITY: 1 | |
| CIBW_BUILD: '${{ matrix.python }}*${{ matrix.tag }}*' | |
| - name: Move cross-compiled wheels to dist folder | |
| run: | | |
| mkdir -p dist | |
| mv ./wheelhouse/*.whl ${{ github.workspace }}/dist/ | |
| - name: build source distributable wheel | |
| # only need to do this once, preferably on a native build. | |
| if: matrix.platform == 'native' && matrix.python == 'cp313' && matrix.tag == 'manylinux' | |
| # sdist for non-supported platforms will serve as a stub lib install | |
| run: | | |
| python -m pip install build | |
| python -m build -s | |
| - name: Save distributable wheels as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pyRF24_pkg_dist_${{ matrix.platform }}_${{ matrix.python }}_${{ matrix.tag }} | |
| path: ${{ github.workspace }}/dist | |
| upload-pypi: | |
| needs: [build] | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Current Repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: pyRF24_pkg_dist_* | |
| path: dist | |
| merge-multiple: true | |
| - name: Display uploaded distributions | |
| if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' | |
| run: ls -r dist/ | |
| - name: Publish package (to TestPyPI) | |
| if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' | |
| uses: pypa/gh-action-pypi-publish@v1.12.4 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| - name: Publish to PyPi | |
| # only upload distributions to PyPi when triggered by a published release | |
| if: github.event_name == 'release' | |
| uses: pypa/gh-action-pypi-publish@v1.12.4 |