Skip to content

Bump version to 1.7.1 #85

Bump version to 1.7.1

Bump version to 1.7.1 #85

Workflow file for this run

name: release
on:
push:
tags:
- v*.*.*
env:
PY_ALL: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: pyo3/maturin-action@v1
with:
rust-toolchain: stable
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
wheels:
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
target: [x86_64, aarch64]
manylinux: [auto]
include:
- os: ubuntu
platform: linux
# FIXME: for some unknown reasons PGO builds are failing on Linux
# - os: ubuntu
# platform: linux
# target: x86_64
# manylinux: auto
# interpreter: pypy3.9 pypy3.10
- os: macos
target: x86_64
interpreter: pypy3.9 pypy3.10
- os: macos
target: aarch64
interpreter: pypy3.9 pypy3.10
- os: ubuntu
platform: linux
target: aarch64
container: messense/manylinux_2_24-cross:aarch64
- os: ubuntu
platform: linux
target: x86_64
manylinux: musllinux_1_1
- os: ubuntu
platform: linux
target: aarch64
manylinux: musllinux_1_1
- os: windows
target: x86_64
interpreter: pypy3.9 pypy3.10
exclude:
- os: windows
target: aarch64
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
# NOTE: we don't use jemalloc anymore
# - name: Set jemalloc for aarch64 Linux
# if: matrix.target == 'aarch64' && matrix.os == 'ubuntu'
# run: |
# echo "JEMALLOC_SYS_WITH_LG_PAGE=16" >> $GITHUB_ENV
- uses: pyo3/maturin-action@v1
with:
rust-toolchain: stable
command: build
args: --release --out dist --interpreter ${{ matrix.interpreter || env.PY_ALL }}
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
docker-options: -e CI
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
wheels-pgo:
name: pgo-wheel ${{ matrix.platform || matrix.os }} (${{ matrix.interpreter}})
strategy:
fail-fast: false
matrix:
# FIXME: for some unknown reasons PGO builds are failing on Linux
# os: [ubuntu-latest, macos-13, macos-14, windows-latest]
os: [macos-13, macos-14, windows-latest]
manylinux: [auto]
interpreter: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
# - os: ubuntu-latest
# platform: linux
- os: windows-latest
platform: windows
runs-on: ${{ matrix.os }}
env:
UV_PYTHON: ${{ matrix.interpreter }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
enable-cache: false
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: prepare profiling directory
shell: bash
run: mkdir -p ${{ github.workspace }}/profdata
- name: Build initial wheel
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
command: build
args: --release --out pgo_wheel --interpreter ${{ matrix.interpreter }}
manylinux: ${{ matrix.manylinux || 'auto' }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
- run: |
RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/$RUST_HOST/bin/llvm-profdata >> "$GITHUB_ENV"'
shell: bash
- name: Generate PGO data
shell: bash
run: |
uv python install ${{ env.UV_PYTHON }}
uv venv .venv
uv pip install -r .github/workflows/_pgo_deps.txt
uv pip install granian --no-index --no-deps --find-links pgo_wheel --force-reinstall
PGO_RUN=y LLVM_PROFILE_FILE=${{ github.workspace }}/profdata/granian_%m_%p.profraw uv run --no-sync pytest tests
- name: merge PGO data
run: ${{ env.LLVM_PROFDATA }} merge --failure-mode=all -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
- name: Build PGO wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist --interpreter ${{ matrix.interpreter }}
manylinux: ${{ matrix.manylinux || 'auto' }}
rust-toolchain: stable
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
release:
runs-on: ubuntu-latest
needs: [ sdist, wheels, wheels-pgo ]
environment:
name: pypi
url: https://pypi.org/p/granian
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish package to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true