Skip to content

Manual Package Release - Linux #2

Manual Package Release - Linux

Manual Package Release - Linux #2

Workflow file for this run

# This file is autogenerated by maturin v1.12.6
# To update, run
#
# maturin generate-ci github
#
name: Manual Package Release - Linux
on:
# This adds the "Run workflow" button in the GitHub Actions UI
workflow_dispatch:
inputs:
target_env:
description: 'Where to publish?'
required: true
default: 'NONE'
type: choice
options:
- TEST_PYPI_API_TOKEN
- PYPI_API_TOKEN
- NONE
permissions:
contents: read
jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-22.04
target: armv7
- runner: ubuntu-22.04
target: s390x
- runner: ubuntu-22.04
target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i python3.10
sccache: false # ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: 2014
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i python3.14t
sccache: false # ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: 2014
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: github.event.inputs.target_env != 'NONE'
# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'wheels-*/*'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Publish to PyPI
run: uv publish 'wheels-*/*'
env:
UV_PUBLISH_TOKEN: ${{ secrets[github.event.inputs.target_env] }}
UV_PUBLISH_URL: ${{ github.event.inputs.target_env == 'TEST_PYPI_API_TOKEN' && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}