Skip to content

Release PyPI

Release PyPI #3

Workflow file for this run

name: Release PyPI
on:
push:
tags:
- "**[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-14
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# portable SIMD floor (x86-64-v3/AVX2, apple-m1) - never target-cpu=native for wheels
- name: Use portable cargo config
run: mv .cargo/config-portable.toml .cargo/config.toml
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
args: -m deacon-py/Cargo.toml --out dist --target ${{ matrix.target }}
sccache: "true"
manylinux: auto
env:
# abi3-py312 built with whatever Python the runner has
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.target }}
path: dist/*
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: -m deacon-py/Cargo.toml --out dist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*
publish:
needs: [build, sdist]
runs-on: ubuntu-latest
# PyPI Trusted Publishing (OIDC), no API token needed
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist