Skip to content

Commit 44df061

Browse files
authored
Create a GitHub release on PyPI publish. (#61)
1 parent ac9e572 commit 44df061

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/publish-to-pypi.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@ jobs:
7171
- name: Publish release to PyPI
7272
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
7373

74+
create-github-release:
75+
name: Create GitHub release
76+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
77+
needs: publish-to-pypi
78+
runs-on: ubuntu-latest
79+
permissions:
80+
contents: write
81+
82+
steps:
83+
- name: Create GitHub release
84+
env:
85+
GH_TOKEN: ${{ github.token }}
86+
shell: bash
87+
run: |
88+
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
89+
echo "Release ${GITHUB_REF_NAME} already exists"
90+
else
91+
gh release create "${GITHUB_REF_NAME}" \
92+
--repo "${GITHUB_REPOSITORY}" \
93+
--verify-tag \
94+
--generate-notes \
95+
--title "Livepeer Python Gateway SDK ${GITHUB_REF_NAME}"
96+
fi
97+
7498
publish-to-testpypi:
7599
name: Publish release to TestPyPI
76100
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)