Publish cross-platform ABI3 wheels

This commit is contained in:
glomatico
2026-07-09 23:45:16 -03:00
parent 81ab4579fd
commit c5b6392779
2 changed files with 48 additions and 8 deletions
+47 -7
View File
@@ -11,12 +11,13 @@ name: Upload Python Package
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
release-build:
build-sdist:
runs-on: ubuntu-latest
steps:
@@ -28,21 +29,59 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- name: Build release distributions
- name: Build source distribution
run: |
python -m pip install maturin
maturin build --release --sdist --out dist
maturin sdist --out dist
- name: Upload distributions
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: release-dists
name: dist-sdist
path: dist/
build-wheels:
name: Build wheel (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
- name: windows-x86_64
os: windows-latest
- name: macos-x86_64
os: macos-13
- name: macos-arm64
os: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: dtolnay/rust-toolchain@stable
- name: Build wheel
run: |
python -m pip install maturin
maturin build --release --out dist
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.name }}
path: dist/
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
- build-sdist
- build-wheels
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
@@ -62,8 +101,9 @@ jobs:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
pattern: dist-*
path: dist/
merge-multiple: true
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
+1 -1
View File
@@ -15,5 +15,5 @@ aes = "0.8"
cbc = { version = "0.1", features = ["block-padding"] }
ctr = "0.9"
cipher = "0.4"
pyo3 = { version = "0.23.5", features = ["extension-module"] }
pyo3 = { version = "0.23.5", features = ["extension-module", "abi3-py310"] }
tempfile = "3"