CI: add a simple tag-to-release config
Some checks failed
Python Formatting Check / formatting (push) Has been cancelled
Tests / Run tests (push) Has been cancelled

This adds a tag-to-release Actions config based around uv.

This is triggered by pushing a tag with a new version; it will
automatically kick off this job, which will publish the new
version to PyPI on completion. We can push that tag from a PR
or directly to master.

At the moment, this doesn't do anything to automatically create
a GitHub release from the tag; we can do that manually for now,
but if we're interested I can add something to automatically
generate the release too.

We don't need to provide a token to uv to publish; instead, we
just need to configure the repo for PyPI access using this:
https://docs.pypi.org/trusted-publishers/adding-a-publisher/
This commit is contained in:
Misty De Méo 2025-04-23 14:21:48 -07:00 committed by Misty De Méo
parent 42b4a88c96
commit b3fbdceeca

23
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Release
on:
pull_request:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
jobs:
publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Build package
run: uv build
- name: Publish package
run: uv publish
if: ${{ !github.event.pull_request }}