Release 0.4.7. #9
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 Polyglot Piranha | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| target: [linux-x86, linux-arm, macos-arm] | |
| runs-on: ${{ fromJSON('{"linux-x86":"ubuntu-latest","linux-arm":"ubuntu-24.04-arm","macos-arm":"macos-latest"}')[matrix.target] }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Rust targets for macOS for cross-compilation | |
| if: runner.os == 'macOS' | |
| run: rustup target add x86_64-apple-darwin aarch64-apple-darwin | |
| - name: Install cibuildwheel | |
| run: | | |
| python -m pip install cibuildwheel | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BUILD_VERBOSITY: 1 | |
| CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
| # For macOS, we directly build a universal binary. | |
| CIBW_ARCHS: ${{ fromJSON('{"linux-x86":"x86_64","linux-arm":"aarch64","macos-arm":"universal2"}')[matrix.target] }} | |
| # We do not need pypy and musllinux wheels. | |
| CIBW_SKIP: "pp* *-musllinux*" | |
| # This is the minimum macOS version the rust toolchain supports. | |
| MACOSX_DEPLOYMENT_TARGET: "10.13" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-${{ matrix.target }} | |
| path: ./wheelhouse/*.whl | |
| - name: Build source distribution once only on linux-x86 | |
| if: ${{ matrix.target == 'linux-x86' }} | |
| run: pipx run build --sdist --outdir ./wheelhouse | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.target == 'linux-x86' }} | |
| with: | |
| name: cibw-sdist | |
| path: ./wheelhouse/*.tar.gz | |
| upload: | |
| needs: build | |
| environment: pypi | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Pypi Release (only on tag push) | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| pip install twine | |
| twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | |
| - name: TestPyPI Release | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| pip install twine | |
| twine upload --repository testpypi --skip-existing -u __token__ -p ${{ secrets.TEST_PYPI_TOKEN }} dist/* | |
| - name: Create GitHub Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: dist/* |