mirror of
https://github.com/astral-sh/ruff.git
synced 2026-12-04 02:03:58 +08:00
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/setup-python](https://redirect.github.com/actions/setup-python) | action | minor | `v7.0.0` → `v7.1.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/10578) for more information. --- ### Release Notes <details> <summary>actions/setup-python</summary> ### [`v7.1.0`](https://redirect.github.com/actions/setup-python/releases/tag/v7.1.0) [Compare Source](https://redirect.github.com/actions/setup-python/compare/v7.0.0...v7.1.0) #### What's Changed ##### Enhancements - Add `mirror` and `mirror-token` inputs for custom Python distribution sources by [@​luhenry](https://redirect.github.com/luhenry) in [#​1302](https://redirect.github.com/actions/setup-python/pull/1302) - Improve error message clarity by [@​v-lmvysakh](https://redirect.github.com/v-lmvysakh) in [#​1351](https://redirect.github.com/actions/setup-python/pull/1351) ##### Dependency Upgrade - Upgrade browserslist from 4.28.2 to 4.28.9 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1353](https://redirect.github.com/actions/setup-python/pull/1353) - Upgrade [@​typescript-eslint/parser](https://redirect.github.com/typescript-eslint/parser) from 8.62.0 to 8.70.0 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1343](https://redirect.github.com/actions/setup-python/pull/1343) - Upgrade eslint-plugin-jest from 29.15.2 to 29.16.6 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1342](https://redirect.github.com/actions/setup-python/pull/1342) - Upgrade [@​vercel/ncc](https://redirect.github.com/vercel/ncc) from 0.44.0 to 0.45.0 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1357](https://redirect.github.com/actions/setup-python/pull/1357) - Upgrade [@​types/semver](https://redirect.github.com/types/semver) from 7.7.1 to 7.8.0 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1359](https://redirect.github.com/actions/setup-python/pull/1359) - Upgrade undici from 6.28.0 to 6.29.0 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1364](https://redirect.github.com/actions/setup-python/pull/1364) - Upgrade ts-jest from 29.4.11 to 29.4.14 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1361](https://redirect.github.com/actions/setup-python/pull/1361) - Upgrade brace-expansion from 5.0.9 to 5.0.12 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1365](https://redirect.github.com/actions/setup-python/pull/1365) - Upgrade prettier from 3.8.4 to 3.9.9 and package.json from 7.0.0 to 7.1.0 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1363](https://redirect.github.com/actions/setup-python/pull/1363) - Upgrade [@​typescript-eslint/eslint-plugin](https://redirect.github.com/typescript-eslint/eslint-plugin) from 8.62.0 to 8.71.1 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1369](https://redirect.github.com/actions/setup-python/pull/1369) - Upgrade actions/checkout from 7.0.0 to 7.0.1 by [@​dependabot](https://redirect.github.com/dependabot) in [#​1345](https://redirect.github.com/actions/setup-python/pull/1345) - Upgrade cache to 6.3.0 by [@​v-HarithaVattikuti](https://redirect.github.com/v-HarithaVattikuti) in [#​1370](https://redirect.github.com/actions/setup-python/pull/1370) - Resolve Basic Validation audit failures by [@​v-HarithaVattikuti](https://redirect.github.com/v-HarithaVattikuti) in [#​1347](https://redirect.github.com/actions/setup-python/pull/1347) - Resolve npm audit failures by [@​v-HarithaVattikuti](https://redirect.github.com/v-HarithaVattikuti) in [#​1350](https://redirect.github.com/actions/setup-python/pull/1350) #### New Contributors - [@​luhenry](https://redirect.github.com/luhenry) made their first contribution in [#​1302](https://redirect.github.com/actions/setup-python/pull/1302) **Full Changelog**: <https://github.com/actions/setup-python/compare/v7.0.0...v7.1.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 4am on Wednesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/ruff). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuMyIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
674 lines
26 KiB
YAML
674 lines
26 KiB
YAML
# Build ruff on all platforms.
|
|
#
|
|
# Generates both wheels (for PyPI) and archived binaries (for GitHub releases).
|
|
#
|
|
# Assumed to run as a subworkflow of .github/workflows/release.yml; specifically, as a local
|
|
# artifacts job within `cargo-dist`.
|
|
name: "Build binaries"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
plan:
|
|
required: true
|
|
type: string
|
|
pull_request:
|
|
paths:
|
|
# When we change pyproject.toml, we want to ensure that the maturin builds still work.
|
|
- pyproject.toml
|
|
# And when we change this workflow itself...
|
|
- .github/workflows/build-binaries.yml
|
|
- scripts/build_ruff_pgo.py
|
|
|
|
concurrency:
|
|
group: build-binaries-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
UV_LOCKED: 1
|
|
ACTIONS_CACHE_MODE: none
|
|
PACKAGE_NAME: ruff
|
|
MODULE_NAME: ruff
|
|
PYTHON_VERSION: "3.13"
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_NET_RETRY: 10
|
|
CARGO_TERM_COLOR: always
|
|
RUSTUP_MAX_RETRIES: 10
|
|
|
|
jobs:
|
|
sdist:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: depot-ubuntu-24.04-4
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build sdist"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
command: sdist
|
|
args: --out dist
|
|
- name: "Test sdist"
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: python:3.13-bookworm@sha256:933b46a028fd786c9c3d426ebabc237e29a15912231ea8de576e95f0e4f41a4c
|
|
artifacts: dist
|
|
rust-toolchain: rust-toolchain.toml
|
|
run: |
|
|
# pip builds outside /test, where the toolchain file no longer applies.
|
|
rustup default "$(rustup show active-toolchain | cut -d ' ' -f1)"
|
|
pip install /dist/"${PACKAGE_NAME}"-*.tar.gz --force-reinstall
|
|
"${MODULE_NAME}" --help
|
|
python -m "${MODULE_NAME}" --help
|
|
- name: "Upload sdist"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-sdist
|
|
compression-level: 0
|
|
path: dist
|
|
|
|
macos-x86_64:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'namespace-profile-macos-15' || 'macos-15' }}
|
|
steps:
|
|
- uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: x64
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels - x86_64"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: x86_64
|
|
args: --release --locked --out dist --compatibility pypi
|
|
env:
|
|
# Use Rust's bundled Mach-O LLD, which supports ICF.
|
|
# ICF reduces the macOS x86_64 ruff binary size by ~1.5%.
|
|
RUSTFLAGS: "-C linker=rust-lld -C linker-flavor=ld64.lld -C link-arg=--icf=safe"
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-macos-x86_64
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
run: |
|
|
TARGET=x86_64-apple-darwin
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-macos-x86_64
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
macos-aarch64:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'namespace-profile-macos-15' || 'macos-15' }}
|
|
env:
|
|
# Use Rust's bundled Mach-O LLD, which supports ICF.
|
|
# ICF reduces the macOS aarch64 ruff binary size by ~0.8%.
|
|
RUSTFLAGS: "-C linker=rust-lld -C linker-flavor=ld64.lld -C link-arg=--icf=safe"
|
|
steps:
|
|
- uses: astral-sh/github-actions/demudhra@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: arm64
|
|
- name: "Install LLVM profiling tools"
|
|
run: rustup component add llvm-tools-preview
|
|
- name: "Train PGO Ruff"
|
|
run: |
|
|
python scripts/build_ruff_pgo.py \
|
|
--target aarch64-apple-darwin \
|
|
--target-dir "${{ github.workspace }}/target/ruff-pgo" \
|
|
--train-only
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels - aarch64"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: aarch64
|
|
args: --release --locked --out dist --compatibility pypi
|
|
env:
|
|
RUSTFLAGS: "${{ env.RUSTFLAGS }} -Cprofile-use=${{ github.workspace }}/target/ruff-pgo/ruff.profdata"
|
|
# Apple Clang cannot consume profile data from rustc's LLVM version.
|
|
CFLAGS: "-fno-profile-generate -fno-profile-use"
|
|
CXXFLAGS: "-fno-profile-generate -fno-profile-use"
|
|
- name: "Test wheel - aarch64"
|
|
run: |
|
|
pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
|
|
ruff --help
|
|
python -m ruff --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-aarch64-apple-darwin
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
run: |
|
|
TARGET=aarch64-apple-darwin
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-aarch64-apple-darwin
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
windows:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'namespace-profile-windows-2022-x86-64-16x32' || 'windows-latest' }}
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- target: x86_64-pc-windows-msvc
|
|
arch: x64
|
|
- target: i686-pc-windows-msvc
|
|
arch: x86
|
|
- target: aarch64-pc-windows-msvc
|
|
arch: x64
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: ${{ matrix.platform.arch }}
|
|
- name: "Install LLVM profiling tools"
|
|
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
|
|
run: rustup component add llvm-tools-preview
|
|
- name: "Train PGO Ruff"
|
|
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
|
|
shell: bash
|
|
run: |
|
|
export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }-C target-feature=+crt-static"
|
|
|
|
python scripts/build_ruff_pgo.py \
|
|
--target "${{ matrix.platform.target }}" \
|
|
--target-dir "${{ github.workspace }}/target/ruff-pgo" \
|
|
--train-only
|
|
|
|
echo "RUSTFLAGS=${RUSTFLAGS:+${RUSTFLAGS} }-Cprofile-use=${{ github.workspace }}/target/ruff-pgo/ruff.profdata" >> "$GITHUB_ENV"
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: ${{ matrix.platform.target }}
|
|
args: --release --locked --out dist --compatibility pypi
|
|
env:
|
|
# aarch64 build fails, see https://github.com/PyO3/maturin/issues/2110
|
|
XWIN_VERSION: 16
|
|
- name: "Verify static Windows runtime"
|
|
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
|
|
shell: bash
|
|
run: |
|
|
LLVM_READOBJ="$(rustc --print sysroot)/lib/rustlib/${{ matrix.platform.target }}/bin/llvm-readobj.exe"
|
|
IMPORTS_FILE="$RUNNER_TEMP/ruff-coff-imports.txt"
|
|
"$LLVM_READOBJ" --coff-imports "target/${{ matrix.platform.target }}/release/ruff.exe" > "$IMPORTS_FILE"
|
|
|
|
if grep -Eiq 'vcruntime[[:digit:]_]*\.dll|api-ms-win-crt-' "$IMPORTS_FILE"; then
|
|
echo "Ruff must not dynamically link the Visual C++ runtime" >&2
|
|
exit 1
|
|
fi
|
|
- name: "Test wheel"
|
|
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
|
|
shell: bash
|
|
run: |
|
|
python -m pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
|
|
"${MODULE_NAME}" --help
|
|
python -m "${MODULE_NAME}" --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
ARCHIVE_FILE=ruff-${{ matrix.platform.target }}.zip
|
|
7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/ruff.exe
|
|
sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: |
|
|
*.zip
|
|
*.sha256
|
|
|
|
linux:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'depot-ubuntu-24.04-8' || 'depot-ubuntu-24.04-4' }}
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu
|
|
- i686-unknown-linux-gnu
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: x64
|
|
- name: "Install LLVM profiling tools"
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
run: rustup component add llvm-tools-preview
|
|
- name: "Train PGO Ruff"
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
run: |
|
|
python scripts/build_ruff_pgo.py \
|
|
--target "${{ matrix.target }}" \
|
|
--target-dir "${{ github.workspace }}/target/ruff-pgo" \
|
|
--train-only
|
|
|
|
echo "RUSTFLAGS=${RUSTFLAGS:+${RUSTFLAGS} }-Cprofile-use=${{ github.workspace }}/target/ruff-pgo/ruff.profdata" >> "$GITHUB_ENV"
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: ${{ matrix.target }}
|
|
manylinux: 2_17
|
|
args: --release --locked --out dist --compatibility pypi
|
|
- name: "Test wheel"
|
|
if: ${{ startsWith(matrix.target, 'x86_64') }}
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: python:3.13-bookworm@sha256:933b46a028fd786c9c3d426ebabc237e29a15912231ea8de576e95f0e4f41a4c
|
|
artifacts: dist
|
|
run: |
|
|
pip install /dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
|
|
"${MODULE_NAME}" --help
|
|
python -m "${MODULE_NAME}" --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-${{ matrix.target }}
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
TARGET=${{ matrix.target }}
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-${{ matrix.target }}
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
linux-aarch64:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: depot-ubuntu-24.04-arm-8
|
|
env:
|
|
# see https://github.com/astral-sh/ruff/issues/3791
|
|
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
|
|
JEMALLOC_SYS_WITH_LG_PAGE: "16"
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
- name: "Install LLVM profiling tools"
|
|
run: rustup component add llvm-tools-preview
|
|
- name: "Train PGO Ruff"
|
|
run: |
|
|
python scripts/build_ruff_pgo.py \
|
|
--target aarch64-unknown-linux-gnu \
|
|
--target-dir "${{ github.workspace }}/target/ruff-pgo" \
|
|
--train-only
|
|
|
|
echo "RUSTFLAGS=${RUSTFLAGS:+${RUSTFLAGS} }-Cprofile-use=${{ github.workspace }}/target/ruff-pgo/ruff.profdata" >> "$GITHUB_ENV"
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: aarch64-unknown-linux-gnu
|
|
manylinux: 2_17
|
|
docker-options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
|
args: --release --locked --out dist --compatibility pypi
|
|
- name: "Test wheel"
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: python:3.13-bookworm@sha256:933b46a028fd786c9c3d426ebabc237e29a15912231ea8de576e95f0e4f41a4c
|
|
platform: linux/arm64
|
|
artifacts: dist
|
|
run: |
|
|
pip install /dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
|
|
"${MODULE_NAME}" --help
|
|
python -m "${MODULE_NAME}" --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-aarch64-unknown-linux-gnu
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
TARGET=aarch64-unknown-linux-gnu
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-aarch64-unknown-linux-gnu
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
linux-cross:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: depot-ubuntu-24.04-4
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- target: armv7-unknown-linux-gnueabihf
|
|
test_image: arm32v7/ubuntu:20.04@sha256:d9a6ab6baaf86907ea1d46f0cbc87547920077c9c6017721faed6eeb51e9aa7e
|
|
test_platform: linux/arm/v7
|
|
manylinux: 2_17
|
|
- target: s390x-unknown-linux-gnu
|
|
test_image: s390x/ubuntu:20.04@sha256:221f5f8e28d896556d0e55605cd6936450e6231544e9d83d687beae2d0e71afd
|
|
test_platform: linux/s390x
|
|
manylinux: 2_17
|
|
maturin_docker_options: -e CFLAGS_s390x_unknown_linux_gnu=-march=z10
|
|
- target: powerpc64le-unknown-linux-gnu
|
|
manylinux: 2_17
|
|
# see https://github.com/astral-sh/ruff/issues/10073
|
|
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
|
- target: arm-unknown-linux-musleabihf
|
|
# Use the cross container, but tag as `linux_armv6l`
|
|
manylinux: auto
|
|
test_image: balenalib/rpi-raspbian:bullseye@sha256:851cfc48b26f6413a72a7f6873a7624ba2a427048976f6ab4483f72fe165d4f1
|
|
test_platform: linux/arm/v6
|
|
- target: riscv64gc-unknown-linux-gnu
|
|
test_image: riscv64/ubuntu:20.04@sha256:610bedb0c5d9aeae4b45e9064e820c4e0b0f6c1d2843116b0a1ae754890951ac
|
|
test_platform: linux/riscv64
|
|
# Minimum manylinux target for riscv64
|
|
manylinux: 2_31
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: ${{ matrix.platform.target }}
|
|
manylinux: ${{ matrix.platform.manylinux }}
|
|
docker-options: ${{ matrix.platform.maturin_docker_options }}
|
|
args: --release --locked --out dist --compatibility pypi
|
|
- name: "Test wheel"
|
|
if: ${{ matrix.platform.target != 'powerpc64le-unknown-linux-gnu' }}
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: ${{ matrix.platform.test_image }}
|
|
platform: ${{ matrix.platform.test_platform }}
|
|
artifacts: dist
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends python3 python3-pip libatomic1
|
|
python3 -m pip install --upgrade --require-hashes -r /pip-requirements.txt
|
|
python3 -m pip install "${PACKAGE_NAME}" --no-index --find-links /dist --force-reinstall
|
|
ruff --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
TARGET=${{ matrix.platform.target }}
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
musllinux:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: depot-ubuntu-24.04-4
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-musl
|
|
- i686-unknown-linux-musl
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: x64
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: ${{ matrix.target }}
|
|
manylinux: musllinux_1_2
|
|
args: --release --locked --out dist --compatibility pypi
|
|
- name: "Test wheel"
|
|
if: matrix.target == 'x86_64-unknown-linux-musl'
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: alpine:latest@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
|
|
artifacts: dist
|
|
run: |
|
|
apk add python3
|
|
python -m venv .venv
|
|
.venv/bin/pip3 install "${PACKAGE_NAME}" --no-index --find-links /dist --force-reinstall
|
|
.venv/bin/"${MODULE_NAME}" --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-${{ matrix.target }}
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
TARGET=${{ matrix.target }}
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-${{ matrix.target }}
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|
|
|
|
musllinux-cross:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
|
|
runs-on: depot-ubuntu-24.04-4
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- target: aarch64-unknown-linux-musl
|
|
test_platform: linux/arm64
|
|
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
|
- target: armv7-unknown-linux-musleabihf
|
|
test_platform: linux/arm/v7
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
with:
|
|
cache: ""
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
with:
|
|
sccache: false
|
|
maturin-version: v1.15.0
|
|
target: ${{ matrix.platform.target }}
|
|
manylinux: musllinux_1_2
|
|
args: --release --locked --out dist --compatibility pypi
|
|
docker-options: ${{ matrix.platform.maturin_docker_options }}
|
|
- name: "Test wheel"
|
|
uses: astral-sh/github-actions/release-smoke-test@67dc9ee1ddc113eccd8116e7b949fb6cdcd89889 # 2026.11.16.0
|
|
with:
|
|
image: alpine:latest@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
|
|
platform: ${{ matrix.platform.test_platform }}
|
|
artifacts: dist
|
|
run: |
|
|
apk add python3
|
|
python -m venv .venv
|
|
.venv/bin/pip3 install "${PACKAGE_NAME}" --no-index --find-links /dist --force-reinstall
|
|
.venv/bin/"${MODULE_NAME}" --help
|
|
- name: "Upload wheels"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: wheels-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: dist
|
|
- name: "Archive binary"
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
TARGET=${{ matrix.platform.target }}
|
|
ARCHIVE_NAME=ruff-$TARGET
|
|
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
|
|
|
|
mkdir -p $ARCHIVE_NAME
|
|
cp target/$TARGET/release/ruff $ARCHIVE_NAME/ruff
|
|
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
|
|
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
|
|
- name: "Upload binary"
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: artifacts-${{ matrix.platform.target }}
|
|
compression-level: 0
|
|
path: |
|
|
*.tar.gz
|
|
*.sha256
|