init new project #8
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
name: Build and publish to PyPI | |
on: | |
# Triggers the workflow when a release is created | |
release: | |
types: [created] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
target_branch: | |
description: 'Branch to build and publish' | |
required: true | |
default: 'main' | |
jobs: | |
upload: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out repository under $GITHUB_WORKSPACE | |
- name: "Checkout repository and submodules" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{inputs.target_branch}} | |
fetch-tags: true | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.1" | |
pyproject-file: pyproject.toml | |
- name: Install the project | |
run: uv sync | |
- name: Build | |
run: uv build | |
- name: Upload to PyPI | |
run: uv publish | |
env: | |
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} |