Skip to content

Use uv in first-party "publish" CI workflow #663

Use uv in first-party "publish" CI workflow

Use uv in first-party "publish" CI workflow #663

Workflow file for this run

name: Build package / publish
on:
pull_request: # Check that package can be built even on PRs
branches: [ main ]
push:
branches: [ main ]
tags: [ "v*" ]
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
python-version: "3.13"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ env.python-version }}
- name: Build
run: uv build
- name: Publish
# Performed on a new tag or release event
if: github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
run: uv publish --trusted-publishing=always