docs: Update README.md (#300) #134
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
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| name: release-please | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| release-type: python | |
| target-branch: main | |
| build-wheels: | |
| name: build wheels (${{ matrix.label }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.releases_created == 'true' && needs.release-please.outputs.tag_name != '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| label: linux-x86_64 | |
| target: x86_64-unknown-linux-gnu | |
| extra-args: "--compatibility manylinux_2_39" | |
| python-version: "3.13" | |
| - os: ubuntu-latest | |
| label: linux-aarch64 | |
| target: aarch64-unknown-linux-gnu | |
| extra-args: "--compatibility manylinux_2_39" | |
| python-version: "3.13" | |
| - os: macos-15-intel | |
| label: macos-x86_64 | |
| target: "" | |
| extra-args: "" | |
| python-version: "3.13" | |
| - os: macos-latest | |
| label: macos-aarch64 | |
| target: "" | |
| extra-args: "" | |
| python-version: "3.13" | |
| - os: windows-latest | |
| label: windows-x86_64 | |
| target: "" | |
| extra-args: "" | |
| python-version: "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install maturin | |
| run: uv tool install maturin | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Setup cross-compilation for Linux ARM64 | |
| if: matrix.label == 'linux-aarch64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
| - name: Build wheel | |
| run: uvx maturin build --release --out dist ${{ matrix.extra-args }} ${{ matrix.target && format('--target {0}', matrix.target) || '' }} | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.label }} | |
| path: dist/*.whl | |
| if-no-files-found: error | |
| build-sdist: | |
| name: build sdist | |
| runs-on: ubuntu-latest | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.releases_created == 'true' && needs.release-please.outputs.tag_name != '' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.13" | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install maturin | |
| run: uv tool install maturin | |
| - name: Build sdist | |
| run: uvx maturin sdist --out dist | |
| - name: Upload sdist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| if-no-files-found: error | |
| publish: | |
| name: publish release artifacts | |
| runs-on: ubuntu-latest | |
| needs: | |
| - release-please | |
| - build-wheels | |
| - build-sdist | |
| if: ${{ needs.release-please.outputs.releases_created == 'true' && needs.release-please.outputs.tag_name != '' }} | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: Upload binaries to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/* | |
| tag: ${{ needs.release-please.outputs.tag_name }} | |
| file_glob: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ |