mirror of https://github.com/astral-sh/ruff
Build ABI3 wheels and expand supported platforms
This commit is contained in:
parent
0cbcb982eb
commit
f55afba305
|
|
@ -5,36 +5,46 @@ on:
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
PACKAGE_NAME: ruff
|
||||||
|
PYTHON_VERSION: "3.7" # to build abi3 wheels
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
macos:
|
macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
architecture: x64
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
target: aarch64-apple-darwin
|
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
- name: Build wheels - x86_64
|
- name: Build wheels - x86_64
|
||||||
uses: messense/maturin-action@v1
|
uses: messense/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
target: x86_64
|
target: x86_64
|
||||||
args: -i python --release --out dist --sdist
|
args: --release --out dist --sdist
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
- name: Install built wheel - x86_64
|
- name: Install built wheel - x86_64
|
||||||
run: |
|
run: |
|
||||||
pip install ruff --no-index --find-links dist --force-reinstall
|
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
|
||||||
- name: Build wheels - universal2
|
- name: Build wheels - universal2
|
||||||
uses: messense/maturin-action@v1
|
uses: messense/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
args: -i python --release --universal2 --out dist
|
args: --release --universal2 --out dist
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
- name: Install built wheel - universal2
|
- name: Install built wheel - universal2
|
||||||
run: |
|
run: |
|
||||||
pip install ruff --no-index --find-links dist --force-reinstall
|
pip install dist/${{ env.PACKAGE_NAME }}-*universal2.whl --force-reinstall
|
||||||
- name: Upload wheels
|
- name: Upload wheels
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -47,13 +57,11 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: [x64, x86]
|
target: [x64, x86]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
architecture: ${{ matrix.target }}
|
architecture: ${{ matrix.target }}
|
||||||
- name: Update rustup
|
|
||||||
run: rustup self update
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -64,10 +72,12 @@ jobs:
|
||||||
uses: messense/maturin-action@v1
|
uses: messense/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
args: -i python --release --out dist
|
args: --release --out dist
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
- name: Install built wheel
|
- name: Install built wheel
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pip install ruff --no-index --find-links dist --force-reinstall
|
python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
|
||||||
- name: Upload wheels
|
- name: Upload wheels
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -80,87 +90,214 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: [x86_64, i686]
|
target: [x86_64, i686]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install Rust toolchain
|
- uses: actions/setup-python@v4
|
||||||
uses: actions-rs/toolchain@v1
|
with:
|
||||||
with:
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
toolchain: stable
|
architecture: x64
|
||||||
profile: minimal
|
- name: Build wheels
|
||||||
default: true
|
uses: messense/maturin-action@v1
|
||||||
- uses: actions/setup-python@v2
|
with:
|
||||||
with:
|
target: ${{ matrix.target }}
|
||||||
python-version: "3.10"
|
manylinux: auto
|
||||||
- name: Build Wheels
|
args: --release --out dist
|
||||||
uses: messense/maturin-action@v1
|
maturin-version: "v0.13.0"
|
||||||
with:
|
- name: Install built wheel
|
||||||
target: ${{ matrix.target }}
|
if: matrix.target == 'x86_64'
|
||||||
manylinux: auto
|
run: |
|
||||||
args: -i 3.10 --release --out dist
|
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
|
||||||
- name: Install built wheel
|
- name: Upload wheels
|
||||||
if: matrix.target == 'x86_64'
|
uses: actions/upload-artifact@v2
|
||||||
run: |
|
with:
|
||||||
pip install ruff --no-index --find-links dist --force-reinstall
|
name: wheels
|
||||||
- name: Upload wheels
|
path: dist
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: wheels
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
linux-cross:
|
linux-cross:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target: [aarch64, armv7, s390x, ppc64le]
|
target: [aarch64, armv7, s390x, ppc64le, ppc64]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Build Wheels
|
- uses: actions/setup-python@v4
|
||||||
uses: messense/maturin-action@v1
|
with:
|
||||||
with:
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
target: ${{ matrix.target }}
|
- name: Build wheels
|
||||||
manylinux: auto
|
uses: messense/maturin-action@v1
|
||||||
args: -i 3.10 --release --out dist
|
with:
|
||||||
- uses: uraimo/run-on-arch-action@v2.2.0
|
target: ${{ matrix.target }}
|
||||||
name: Install built wheel
|
manylinux: auto
|
||||||
with:
|
args: --release --out dist
|
||||||
arch: ${{ matrix.target }}
|
maturin-version: "v0.13.0"
|
||||||
distro: ubuntu20.04
|
- uses: uraimo/run-on-arch-action@v2.0.5
|
||||||
githubToken: ${{ github.token }}
|
if: matrix.target != 'ppc64'
|
||||||
dockerRunArgs: |
|
name: Install built wheel
|
||||||
--volume "${PWD}/dist:/artifacts"
|
with:
|
||||||
install: |
|
arch: ${{ matrix.target }}
|
||||||
apt-get update
|
distro: ubuntu20.04
|
||||||
apt-get install -y --no-install-recommends python3 python3-venv software-properties-common
|
githubToken: ${{ github.token }}
|
||||||
add-apt-repository ppa:deadsnakes/ppa
|
install: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y curl python3.7-venv python3.9-venv python3.10-venv
|
apt-get install -y --no-install-recommends python3 python3-pip
|
||||||
run: |
|
pip3 install -U pip
|
||||||
ls -lrth /artifacts
|
run: |
|
||||||
PYTHON=python3.10
|
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
|
||||||
$PYTHON -m venv venv
|
- name: Upload wheels
|
||||||
venv/bin/pip install -U pip
|
uses: actions/upload-artifact@v2
|
||||||
venv/bin/pip install ruff --no-index --find-links /artifacts --force-reinstall
|
with:
|
||||||
- name: Upload wheels
|
name: wheels
|
||||||
uses: actions/upload-artifact@v2
|
path: dist
|
||||||
with:
|
|
||||||
name: wheels
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
|
musllinux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x86_64-unknown-linux-musl
|
||||||
|
- i686-unknown-linux-musl
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
architecture: x64
|
||||||
|
- name: Build wheels
|
||||||
|
uses: messense/maturin-action@v1
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
manylinux: musllinux_1_2
|
||||||
|
args: --release --out dist
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
|
- name: Install built wheel
|
||||||
|
if: matrix.target == 'x86_64-unknown-linux-musl'
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
|
with:
|
||||||
|
image: alpine:latest
|
||||||
|
options: -v ${{ github.workspace }}:/io -w /io
|
||||||
|
run: |
|
||||||
|
apk add py3-pip
|
||||||
|
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links /io/dist/ --force-reinstall
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: wheels
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
musllinux-cross:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- target: aarch64-unknown-linux-musl
|
||||||
|
arch: aarch64
|
||||||
|
- target: armv7-unknown-linux-musleabihf
|
||||||
|
arch: armv7
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
- name: Build wheels
|
||||||
|
uses: messense/maturin-action@v1
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.platform.target }}
|
||||||
|
manylinux: musllinux_1_2
|
||||||
|
args: --release --out dist
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
|
- uses: uraimo/run-on-arch-action@master
|
||||||
|
name: Install built wheel
|
||||||
|
with:
|
||||||
|
arch: ${{ matrix.platform.arch }}
|
||||||
|
distro: alpine_latest
|
||||||
|
githubToken: ${{ github.token }}
|
||||||
|
install: |
|
||||||
|
apk add py3-pip
|
||||||
|
run: |
|
||||||
|
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: wheels
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
pypy:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
target: [x86_64, aarch64]
|
||||||
|
python-version:
|
||||||
|
- '3.7'
|
||||||
|
- '3.8'
|
||||||
|
- '3.9'
|
||||||
|
exclude:
|
||||||
|
- os: macos-latest
|
||||||
|
target: aarch64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: pypy${{ matrix.python-version }}
|
||||||
|
- name: Build wheels
|
||||||
|
uses: messense/maturin-action@v1
|
||||||
|
with:
|
||||||
|
maturin-version: "v0.13.0"
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
manylinux: auto
|
||||||
|
args: --release --out dist -i pypy${{ matrix.python-version }}
|
||||||
|
- name: Install built wheel
|
||||||
|
if: matrix.target == 'x86_64'
|
||||||
|
run: |
|
||||||
|
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: wheels
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# Lint on earliest and latest
|
||||||
|
python: ["3.7", "3.x"]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
default: true
|
||||||
|
- name: Lint
|
||||||
|
run: |
|
||||||
|
make lint
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- lint
|
||||||
|
- macos
|
||||||
|
- windows
|
||||||
|
- linux
|
||||||
|
- linux-cross
|
||||||
|
- musllinux
|
||||||
|
- musllinux-cross
|
||||||
|
- pypy
|
||||||
if: "startsWith(github.ref, 'refs/tags/')"
|
if: "startsWith(github.ref, 'refs/tags/')"
|
||||||
needs: [ macos, windows, linux, linux-cross ]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: wheels
|
name: wheels
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
with:
|
- name: Publish to PyPi
|
||||||
python-version: "3.10"
|
|
||||||
- name: Publish to PyPI
|
|
||||||
env:
|
env:
|
||||||
TWINE_USERNAME: __token__
|
TWINE_USERNAME: __token__
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade wheel pip setuptools twine
|
pip install --upgrade twine
|
||||||
twine upload --skip-existing *
|
twine upload --skip-existing *
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue