From acb9ad3067d3a8b52ebfec5c90cb1b5f986984f0 Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Wed, 12 Aug 2026 09:26:28 -0700 Subject: [PATCH] Create a GitHub release on PyPI publish. --- .github/workflows/publish-to-pypi.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a032f26..df5c3be 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -71,6 +71,30 @@ jobs: - name: Publish release to PyPI uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 + create-github-release: + name: Create GitHub release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + needs: publish-to-pypi + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Create GitHub release + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then + echo "Release ${GITHUB_REF_NAME} already exists" + else + gh release create "${GITHUB_REF_NAME}" \ + --repo "${GITHUB_REPOSITORY}" \ + --verify-tag \ + --generate-notes \ + --title "Livepeer Python Gateway SDK ${GITHUB_REF_NAME}" + fi + publish-to-testpypi: name: Publish release to TestPyPI if: github.event_name == 'workflow_dispatch'