Skip to content

chore(python): Release 0.23.0 #95

chore(python): Release 0.23.0

chore(python): Release 0.23.0 #95

Workflow file for this run

name: Python Release
on:
push:
tags:
- python-v*
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PACKAGE_NAME: jsonschema_rs
jobs:
sdist:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: hynek/setup-cached-uv@v2
- run: uv python install "3.12"
- run: uv build --sdist --out-dir dist
working-directory: crates/jsonschema-py
- run: uv venv
working-directory: crates/jsonschema-py
- name: Install sdist
run: |
uv pip install dist/${{ env.PACKAGE_NAME }}-*.tar.gz --force-reinstall
working-directory: crates/jsonschema-py
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: crates/jsonschema-py/dist
macos-x86_64:
runs-on: macos-12
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels - x86_64
uses: messense/maturin-action@v1
with:
target: x86_64
args: --release -m crates/jsonschema-py/Cargo.toml --out dist --interpreter ${{ matrix.python-version }}
- name: Install built wheel - x86_64
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-x86_64-py${{ matrix.python-version }}
path: dist
macos-universal:
runs-on: macos-12
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels - universal2
uses: messense/maturin-action@v1
with:
args: --release -m crates/jsonschema-py/Cargo.toml --target universal2-apple-darwin --out dist --interpreter ${{ matrix.python-version }}
- name: Install built wheel - universal2
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*universal2.whl --force-reinstall
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-universal-py${{ matrix.python-version }}
path: dist
windows:
runs-on: windows-2022
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
target: [ x64, x86 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release -m crates/jsonschema-py/Cargo.toml --out dist --interpreter ${{ matrix.python-version }}
- name: Install built wheel
shell: bash
run: |
python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-windows-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
target: [ x86_64, i686, aarch64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release -m crates/jsonschema-py/Cargo.toml --out dist --interpreter ${{ matrix.python-version }}
- name: Install built wheel on native architecture
if: matrix.target == 'x86_64'
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
- uses: uraimo/run-on-arch-action@v2
if: matrix.target == 'aarch64'
name: Install built wheel on ARM architecture
with:
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
export TZ=UTC
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends software-properties-common gpg gpg-agent curl
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv
run: |
python${{ matrix.python-version }} -m venv venv
venv/bin/pip install -U pip wheel
venv/bin/pip install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-linux-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist
release:
name: Release
runs-on: ubuntu-22.04
needs:
- sdist
- macos-x86_64
- macos-universal
- windows
- linux
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/download-artifact@v4
with:
path: all
- name: Merge files
run: |
mkdir dist
mv all/*/* dist
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}