feat: Uv take 3, no pyproject.toml and with pinned setuptools and wheel #208
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: Library Release Build | |
| on: | |
| # TEMPORARY | |
| pull_request: | |
| # push: | |
| # branches: | |
| # - release-library/** | |
| # - test-release-library/** # For testing the release build | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RELAY_CARGO_ARGS: "--locked" | |
| jobs: | |
| linux: | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-arch: | |
| - x86_64 | |
| - aarch64 | |
| name: Python Linux ${{ matrix.build-arch }} | |
| runs-on: |- | |
| ${{fromJson('{ | |
| "x86_64": "ubuntu-latest", | |
| "aarch64": "ubuntu-24.04-arm" | |
| }')[matrix.build-arch] }} | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| submodules: recursive | |
| - name: Build in Docker | |
| run: scripts/docker-manylinux.sh | |
| env: | |
| TARGET: ${{ matrix.build-arch }} | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: artifact-linux-${{ matrix.build-arch }} | |
| path: py/dist/* | |
| if-no-files-found: "error" | |
| # since this artifact will be merged, compression is not necessary | |
| compression-level: "0" | |
| macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| py-platform: macosx-13_0_x86_64 | |
| - target: aarch64-apple-darwin | |
| py-platform: macosx-14_0_arm64 | |
| name: Python macOS ${{ matrix.py-platform }} | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust Toolchain | |
| run: | | |
| rustup set profile minimal | |
| rustup toolchain install stable | |
| rustup override set stable | |
| rustup target add --toolchain stable ${{ matrix.target }} | |
| - uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6 | |
| with: | |
| version: '0.8.2' | |
| # we just cache the venv-dir directly in action-setup-venv | |
| enable-cache: false | |
| - uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0 | |
| with: | |
| cache-dependency-path: uv.lock | |
| install-cmd: uv sync --frozen --only-dev --active | |
| - name: Build Wheel | |
| run: | | |
| python setup.py bdist_wheel -p ${{ matrix.py-platform }} | |
| # this verifies that the wheel has good metadata | |
| # if it fails then twine upload will not succeed; we want to find out sooner | |
| # and not during the release itself | |
| python tools/verify_wheel.py dist/*.whl | |
| working-directory: py | |
| env: | |
| # consumed by cargo and setup.py to obtain the target dir | |
| CARGO_BUILD_TARGET: ${{ matrix.target }} | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: artifact-macos-${{ matrix.py-platform }} | |
| path: py/dist/* | |
| if-no-files-found: "error" | |
| # since this artifact will be merged, compression is not necessary | |
| compression-level: "0" | |
| sdist: | |
| name: Python sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| submodules: recursive | |
| - uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6 | |
| with: | |
| version: '0.8.2' | |
| # we just cache the venv-dir directly in action-setup-venv | |
| enable-cache: false | |
| - uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0 | |
| with: | |
| cache-dependency-path: uv.lock | |
| install-cmd: uv sync --frozen --only-dev --active | |
| - name: Build sdist | |
| run: python setup.py sdist | |
| working-directory: py | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: artifact-sdist | |
| path: py/dist/* | |
| if-no-files-found: "error" | |
| # since this artifact will be merged, compression is not necessary | |
| compression-level: "0" | |
| merge: | |
| name: Create Release Artifact | |
| runs-on: ubuntu-latest | |
| needs: [linux, macos, sdist] | |
| steps: | |
| # Note: due to the immutability of artifacts in upload-artifact v4, | |
| # there cannot be mutliple upload-artifacts with the same name, in a sha's workflow runs. | |
| # However in this case it is fine because this only runs on release-library/** branches, | |
| # and the other runs on release/** branches. | |
| - uses: actions/upload-artifact/merge@v5 | |
| with: | |
| # Craft expects release assets to be a single artifact named after the sha. | |
| name: ${{ github.sha }} | |
| pattern: artifact-* | |
| delete-merged: true |