Skip to content

Updated release doc #203

Updated release doc

Updated release doc #203

Workflow file for this run

name: ci
on:
push:
branches:
- main
tags:
- '**'
pull_request: {}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install rust
uses: dtolnay/rust-toolchain@1.93.1
with:
components: rustfmt, clippy
- name: cache rust
uses: Swatinem/rust-cache@v2
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: '3.12'
- name: Install dependencies
run: uv sync --locked --all-extras --dev --group docs
- name: Lint Rust codebase
run: make lib-lint
- name: Lint Python codebase
run: make lint
test:
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version:
- '3.12'
- '3.13'
- '3.14'
- '3.15'
include:
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.93.1
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Build native extension
run: uvx maturin develop
- name: Run tests
run: make test
build-linux:
name: Build on Linux (${{ matrix.target }}, ${{ matrix.manylinux || 'auto' }})
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
manylinux: [auto]
include:
# musllinux
- target: x86_64
manylinux: musllinux_1_1
- target: aarch64
manylinux: musllinux_1_1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Build CPython Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
manylinux: ${{ matrix.manylinux || 'auto' }}
- name: Build PyPy wheels
if: ${{ matrix.manylinux == 'auto' && (matrix.target == 'x86_64' || matrix.target == 'aarch64') }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
sccache: 'true'
manylinux: ${{ matrix.manylinux || 'auto' }}
args: --release --out dist --interpreter pypy3.11
- run: ls -lah dist/
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }}
path: dist
if-no-files-found: error
build-macos:
name: Build on MacOS (${{ matrix.target }})
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')"
runs-on: macos-latest
strategy:
matrix:
target: [ x86_64, aarch64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build CPython Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Build PyPy wheels
if: ${{ matrix.target == 'x86_64' }}
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter pypy3.11
- run: ls -lah dist/
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.target }}
path: dist
if-no-files-found: error
build-windows:
name: Build on Windows (${{ matrix.target }})
if: "startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')"
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- run: dir dist/
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.target }}
path: dist
if-no-files-found: error
sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist
list-wheels:
needs: [build-linux, build-macos, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: get dist artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: get sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: list dist files
run: |
ls -lh dist/
echo "`ls dist | wc -l` files"
- name: extract and list sdist file
run: |
mkdir sdist-files
tar -xvf dist/*.tar.gz -C sdist-files
tree -a sdist-files
- name: extract and list wheel file
run: |
ls dist/*cp310-abi3-manylinux_2_17_x86_64*.whl | head -n 1
python -m zipfile --list `ls dist/*cp310-abi3-manylinux_2_17_x86_64*.whl | head -n 1`
- run: pip install twine
# - run: twine check dist/* TODO: investigate why it fails with "InvalidDistribution: Invalid distribution metadata: unrecognized or malformed field 'license-file'"
# Used for branch protection checks, see https://github.com/marketplace/actions/alls-green#why
checks:
if: always()
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
release:
name: Release
needs: [checks, build-linux, build-macos, build-windows, sdist]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install twine
- name: get dist artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: get sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- run: twine check dist/*
- name: upload to pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}