# Build uv on all platforms. # # Generates both wheels (for PyPI) and archived binaries (for GitHub releases). # # Called from: # - .github/workflows/ci.yml (when release-relevant files change) # - .github/workflows/release.yml (as a local artifacts job within `cargo-dist`) name: "Build release binaries" on: workflow_call: inputs: plan: required: false type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: PACKAGE_NAME: uv MODULE_NAME: uv PYTHON_VERSION: "3.11" CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 CARGO_TERM_COLOR: always RUSTUP_MAX_RETRIES: 10 permissions: {} jobs: sdist: name: sdist runs-on: depot-ubuntu-24.04-4 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} # uv - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi - name: "Build sdist" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 command: sdist args: --out dist - name: "Test sdist" run: | # We can't use `--find-links` here, since we need maturin, which means no `--no-index`, and without that option # we run the risk that pip pull uv from PyPI instead. pip install dist/${PACKAGE_NAME}-*.tar.gz --force-reinstall ${MODULE_NAME} --help python -m ${MODULE_NAME} --help uvx --help - name: "Upload sdist" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-sdist path: dist # uv-build - name: "Build sdist uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 command: sdist args: --out crates/uv-build/dist -m crates/uv-build/Cargo.toml - name: "Test sdist uv-build" run: | pip install crates/uv-build/dist/${PACKAGE_NAME}_build-*.tar.gz --force-reinstall ${MODULE_NAME}-build --help python -m ${MODULE_NAME}_build --help - name: "Upload sdist uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-sdist path: crates/uv-build/dist macos-x86_64: name: x86_64-apple-darwin runs-on: depot-macos-14 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels - x86_64" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: x86_64 args: --release --locked --out dist --features self-update --compatibility pypi - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-macos-x86_64 path: dist - name: "Archive binary" run: | TARGET=x86_64-apple-darwin ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-macos-x86_64 path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build - x86_64" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: x86_64 args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-macos-x86_64 path: crates/uv-build/dist macos-aarch64: name: aarch64-apple-darwin runs-on: depot-macos-14 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} architecture: arm64 - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels - aarch64" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: aarch64 manylinux: 2_17 args: --release --locked --out dist --features self-update --compatibility pypi - name: "Test wheel - aarch64" run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help python -m ${MODULE_NAME} --help uvx --help - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-aarch64-apple-darwin path: dist - name: "Archive binary" run: | TARGET=aarch64-apple-darwin ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-aarch64-apple-darwin path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build - aarch64" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: aarch64 args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - name: "Test wheel - aarch64" run: | pip install ${PACKAGE_NAME}_build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help python -m ${MODULE_NAME}_build --help - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-aarch64-apple-darwin path: crates/uv-build/dist windows: name: ${{ matrix.platform.target }} runs-on: ${{ matrix.platform.runner }} strategy: matrix: platform: - target: x86_64-pc-windows-msvc arch: x64 runner: github-windows-2022-x86_64-8 - target: i686-pc-windows-msvc arch: x86 runner: github-windows-2022-x86_64-8 - target: aarch64-pc-windows-msvc arch: arm64 runner: github-windows-11-aarch64-8 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} architecture: ${{ matrix.platform.arch }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} args: --release --locked --out dist --features self-update,windows-gui-bin --compatibility pypi - name: "Test wheel" shell: bash run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help python -m ${MODULE_NAME} --help uvx --help uvw --help - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_FILE=uv-${PLATFORM_TARGET}.zip 7z a $ARCHIVE_FILE ./target/${PLATFORM_TARGET}/release/uv.exe 7z a $ARCHIVE_FILE ./target/${PLATFORM_TARGET}/release/uvx.exe 7z a $ARCHIVE_FILE ./target/${PLATFORM_TARGET}/release/uvw.exe sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: PLATFORM_TARGET: ${{ matrix.platform.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.zip *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - name: "Test wheel uv-build" shell: bash run: | pip install ${PACKAGE_NAME}_build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help python -m ${MODULE_NAME}_build --help - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist linux: name: ${{ matrix.target }} runs-on: depot-ubuntu-latest-4 strategy: matrix: include: - { target: "i686-unknown-linux-gnu", cc: "gcc -m32" } - { target: "x86_64-unknown-linux-gnu", cc: "gcc" } steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.target }} # Generally, we try to build in a target docker container. In this case however, a # 32-bit compiler runs out of memory (4GB memory limit for 32-bit), so we cross compile # from 64-bit version of the container, breaking the pattern from other builds. container: quay.io/pypa/manylinux2014 manylinux: 2_17 args: --release --locked --out dist --features self-update --compatibility pypi # See: https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145 before-script-linux: | # Install the 32-bit cross target on 64-bit (noop if we're already on 64-bit) rustup target add ${{ matrix.target }} # If we're running on rhel centos, install needed packages. if command -v yum &> /dev/null; then yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic # If we're running on i686 we need to symlink libatomic # in order to build openssl with -latomic flag. if [[ ! -d "/usr/lib64" ]]; then ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so else # Support cross-compiling from 64-bit to 32-bit yum install -y glibc-devel.i686 libstdc++-devel.i686 fi else # If we're running on debian-based system. apt update -y && apt-get install -y libssl-dev openssl pkg-config fi env: CC: ${{ matrix.cc }} - name: "Test wheel" if: ${{ startsWith(matrix.target, 'x86_64') }} run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help python -m ${MODULE_NAME} --help uvx --help - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.target }} manylinux: 2_17 args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - name: "Test wheel uv-build" if: ${{ startsWith(matrix.target, 'x86_64') }} run: | pip install ${PACKAGE_NAME}_build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help python -m ${MODULE_NAME}_build --help - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.target }} path: crates/uv-build/dist linux-arm: name: ${{ matrix.platform.target }} runs-on: depot-ubuntu-24.04-8 timeout-minutes: 30 strategy: matrix: platform: - target: aarch64-unknown-linux-gnu arch: aarch64 # see https://github.com/astral-sh/ruff/issues/3791 # and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963 maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 # Build fails with 2_17 container: https://github.com/astral-sh/uv/actions/runs/20850906093/job/59905482208?pr=17358 manylinux: 2_28 - target: armv7-unknown-linux-gnueabihf arch: armv7 manylinux: 2_17 - target: arm-unknown-linux-musleabihf arch: arm # Special case: armv6l is linux_armv6l, no manylinux or musllinux. # "auto" instead of "off" to get the cross container manylinux: auto steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: ${{ matrix.platform.manylinux }} docker-options: ${{ matrix.platform.maturin_docker_options }} args: --release --locked --out dist --features self-update --compatibility pypi - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel" with: arch: ${{ matrix.platform.arch == 'arm' && 'armv6' || matrix.platform.arch }} distro: ${{ matrix.platform.arch == 'arm' && 'bullseye' || 'ubuntu20.04' }} install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME} --help uvx --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.platform.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: ${{ matrix.platform.manylinux }} docker-options: ${{ matrix.platform.maturin_docker_options }} args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel uv-build" with: arch: ${{ matrix.platform.arch == 'arm' && 'armv6' || matrix.platform.arch }} distro: ${{ matrix.platform.arch == 'arm' && 'bullseye' || 'ubuntu20.04' }} install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME}_build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME}_build --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist # Like `linux-arm`. linux-s390x: name: ${{ matrix.platform.target }} timeout-minutes: 30 runs-on: depot-ubuntu-latest-4 strategy: matrix: platform: - target: s390x-unknown-linux-gnu arch: s390x steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_17 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --release --locked --out dist --features self-update --compatibility pypi rust-toolchain: ${{ matrix.platform.toolchain || null }} - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel" with: arch: ${{ matrix.platform.arch }} distro: ubuntu20.04 install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME} --help uvx --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.platform.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_17 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel uv-build" with: arch: ${{ matrix.platform.arch }} distro: ubuntu20.04 install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME}-build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME}-build --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist # Like `linux-arm`, but install the `gcc-powerpc64-linux-gnu` package. linux-powerpc: name: ${{ matrix.platform.target }} runs-on: depot-ubuntu-24.04-4 strategy: matrix: platform: - target: powerpc64le-unknown-linux-gnu arch: ppc64le # see https://github.com/astral-sh/uv/issues/6528 maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_17 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --release --locked --out dist --features self-update --compatibility pypi before-script-linux: | if command -v yum &> /dev/null; then yum update -y yum -y install epel-release yum repolist yum install -y gcc-powerpc64-linux-gnu fi # TODO(charlie): Re-enable testing for PPC wheels. # - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 # name: "Test wheel" # with: # arch: ${{ matrix.platform.arch }} # distro: ubuntu20.04 # install: | # apt-get update # apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 # pip3 install -U pip # run: | # pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall # ${MODULE_NAME} --help # #(konsti) TODO: Enable this test on all platforms,currently `find_uv_bin` is failingto discover uv here. # # python -m ${MODULE_NAME} --helppython -m ${MODULE_NAME} --help # uvx --help - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.platform.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_17 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi before-script-linux: | if command -v yum &> /dev/null; then yum update -y yum -y install epel-release yum repolist yum install -y gcc-powerpc64-linux-gnu fi # TODO(charlie): Re-enable testing for PPC wheels. - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist # Like `linux-arm`. linux-riscv64: name: ${{ matrix.platform.target }} timeout-minutes: 30 runs-on: depot-ubuntu-latest-4 strategy: matrix: platform: - target: riscv64gc-unknown-linux-gnu arch: riscv64 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_31 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --release --locked --out dist --features self-update --compatibility pypi - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel" with: arch: ${{ matrix.platform.arch }} distro: ubuntu20.04 githubToken: ${{ github.token }} install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME} --help uvx --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.platform.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: 2_31 docker-options: ${{ matrix.platform.maturin_docker_options }} args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel uv-build" with: arch: ${{ matrix.platform.arch }} distro: ubuntu20.04 githubToken: ${{ github.token }} install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME}-build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME}-build --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist musllinux: name: ${{ matrix.target }} runs-on: depot-ubuntu-24.04-4 strategy: matrix: target: - x86_64-unknown-linux-musl - i686-unknown-linux-musl steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.target }} manylinux: musllinux_1_1 args: --release --locked --out dist --features self-update --compatibility pypi - name: "Test wheel" if: matrix.target == 'x86_64-unknown-linux-musl' run: | docker run --rm -v ${{ github.workspace }}:/io -w /io --env MODULE_NAME --env PACKAGE_NAME alpine:3.12 sh -c " apk add python3 py3-pip; python3 -m venv .venv; .venv/bin/pip install --upgrade pip; .venv/bin/pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall; .venv/bin/${MODULE_NAME} --help; # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # .venv/bin/python -m ${MODULE_NAME} --help; .venv/bin/uvx --help; " - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/release/uv $ARCHIVE_NAME/uv cp target/$TARGET/release/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.target }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels uv-build" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.target }} manylinux: musllinux_1_1 args: --profile minimal-size --locked --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi - name: "Test wheel uv-build" if: matrix.target == 'x86_64-unknown-linux-musl' run: | docker run --rm -v ${{ github.workspace }}:/io -w /io --env MODULE_NAME --env PACKAGE_NAME alpine:3.12 sh -c " apk add python3 py3-pip; python3 -m venv .venv; .venv/bin/pip install --upgrade pip; .venv/bin/pip install ${PACKAGE_NAME}-build --no-index --find-links crates/uv-build/dist --force-reinstall; .venv/bin/${MODULE_NAME}-build --help; # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # .venv/bin/python -m ${MODULE_NAME}_build --help; " - name: "Upload wheels uv-build" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.target }} path: crates/uv-build/dist musllinux-cross: name: ${{ matrix.platform.target }} runs-on: depot-ubuntu-24.04-8 strategy: matrix: platform: - target: aarch64-unknown-linux-musl arch: aarch64 maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 - target: armv7-unknown-linux-musleabihf arch: armv7 fail-fast: false steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" run: python scripts/transform_readme.py --target pypi # uv - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: musllinux_1_1 # Tag the musl builds as manylinux 2_17 fallback cause the aarch64 build only support 2_28 args: --release --locked --out dist --features self-update --compatibility 2_17 --compatibility pypi docker-options: ${{ matrix.platform.maturin_docker_options }} rust-toolchain: ${{ matrix.platform.toolchain || null }} - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel" with: arch: ${{ matrix.platform.arch }} distro: alpine_latest install: | apk add python3 run: | python -m venv .venv .venv/bin/pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall .venv/bin/${MODULE_NAME} --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # .venv/bin/python -m ${MODULE_NAME} --help .venv/bin/uvx --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel (manylinux)" if: matrix.platform.arch == 'aarch64' with: arch: aarch64 distro: ubuntu20.04 install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME} --no-index --find-links dist/ --force-reinstall ${MODULE_NAME} --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME} --help uvx --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv-${{ matrix.platform.target }} path: dist - name: "Archive binary" shell: bash run: | ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME cp target/$TARGET/$PROFILE/uv $ARCHIVE_NAME/uv cp target/$TARGET/$PROFILE/uvx $ARCHIVE_NAME/uvx tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 env: TARGET: ${{ matrix.platform.target }} PROFILE: ${{ matrix.platform.arch == 'ppc64le' && 'release-no-lto' || 'release' }} - name: "Upload binary" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifacts-${{ matrix.platform.target }} path: | *.tar.gz *.sha256 # uv-build - name: "Build wheels" uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0 with: maturin-version: v1.12.4 target: ${{ matrix.platform.target }} manylinux: musllinux_1_1 args: --profile minimal-size --locked ${{ matrix.platform.arch == 'aarch64' && '--compatibility 2_17' || ''}} --out crates/uv-build/dist -m crates/uv-build/Cargo.toml --compatibility pypi docker-options: ${{ matrix.platform.maturin_docker_options }} rust-toolchain: ${{ matrix.platform.toolchain || null }} - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel" with: arch: ${{ matrix.platform.arch }} distro: alpine_latest install: | apk add python3 run: | python -m venv .venv .venv/bin/pip install ${PACKAGE_NAME}-build --no-index --find-links crates/uv-build/dist --force-reinstall .venv/bin/${MODULE_NAME}-build --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # .venv/bin/python -m ${MODULE_NAME}_build --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1 name: "Test wheel (manylinux)" if: matrix.platform.arch == 'aarch64' with: arch: aarch64 distro: ubuntu20.04 install: | apt-get update apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pip3 install -U pip run: | pip install ${PACKAGE_NAME}-build --no-index --find-links crates/uv-build/dist --force-reinstall ${MODULE_NAME}-build --help # TODO(konsti): Enable this test on all platforms, currently `find_uv_bin` is failing to discover uv here. # python -m ${MODULE_NAME}_build --help env: | PACKAGE_NAME: ${{ env.PACKAGE_NAME }} MODULE_NAME: ${{ env.MODULE_NAME }} - name: "Upload wheels" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels_uv_build-${{ matrix.platform.target }} path: crates/uv-build/dist check-wheels: name: "Check wheel contents" runs-on: ubuntu-slim needs: - macos-x86_64 - macos-aarch64 - windows - linux - linux-arm - linux-s390x - linux-powerpc - linux-riscv64 - musllinux - musllinux-cross steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: "Install uv" uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: pattern: wheels_*-* path: wheels merge-multiple: true - name: "Check wheel contents" run: uv run scripts/check_uv_wheel_contents.py wheels/*