Skip to content

Manual Package Release - sdist #3

Manual Package Release - sdist

Manual Package Release - sdist #3

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 - sdist
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:
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: wheels-sdist
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: [sdist]
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/' || '' }}