From 18a425fd00bc848390ea1e71618c6de390929ff3 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 7 Oct 2024 23:21:27 +0100 Subject: [PATCH] Add automated release process (#372) --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3143aff..e29d48f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - '**' pull_request: concurrency: @@ -91,3 +93,26 @@ jobs: with: name: html-report path: htmlcov + + release: + needs: [coverage] + if: success() && startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-24.04 + environment: release + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - uses: astral-sh/setup-uv@v3 + + - name: Build + run: uv build + + - name: Verify + run: uvx twine check dist/* + + - uses: pypa/gh-action-pypi-publish@release/v1