PyPI #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Trigger this workflow manually while choosing a tag in order to publish the package. | |
# | |
# This is going to: | |
# - Build and publish the Python package | |
# | |
name: PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
default: false | |
required: false | |
description: Dry run | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Cache UV | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.uv-cache | |
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
uv-${{ runner.os }} | |
- name: Install UV tools | |
run: make install-tools | |
- name: Build Python package | |
run: uvx --from build pyproject-build --installer uv -s | |
- name: Publish Python package | |
if: ${{ github.event.inputs.dry-run != 'true' }} | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: uvx twine upload dist/* |