Skip to content

wheels

wheels #9

Workflow file for this run

name: wheels
on:
workflow_dispatch:
inputs:
# Manual dispatch allows optional upload of wheels to PyPI
upload_dest:
type: choice
description: Upload wheels to
options:
- No Upload
- PyPI
- Test PyPI
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
# For PyPI Trusted Publisher
id-token: write
jobs:
publish_PyPI:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make README links absolute
run: |
tools/make_readme_links_absolute.sh > README-PyPI.md
rm README.md
mv README-PyPI.md README.md
- name: Build
run: pipx run build
- name: Check
run: pipx run twine check dist/*
# Upload to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')
with:
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}
# Upload to Test PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI'
with:
verbose: true
repository-url: https://test.pypi.org/legacy/