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'