From b3fbdceecafffb7ef958c8a2c2730d253f1cfa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Wed, 23 Apr 2025 14:21:48 -0700 Subject: [PATCH] CI: add a simple tag-to-release config 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/ --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a17dfa --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }}