From eca8ca367d8a818b8422ac2ac516d3e116048faf Mon Sep 17 00:00:00 2001 From: Jon Palmer Date: Sat, 23 May 2026 00:03:40 -0700 Subject: [PATCH] ci: add github-release job to python-publish workflow Agent-Id: agent-aa451ee5-71a4-4615-b875-078b204e672c --- .github/workflows/python-publish.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index ae67e28..ccb6856 100755 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -74,3 +74,37 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + + + github-release: + name: Create GitHub Release 📝 + if: startsWith(github.ref, 'refs/tags/') # only create release on tag pushes + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for creating GitHub Releases + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + "$GITHUB_REF_NAME" + --repo "$GITHUB_REPOSITORY" + --title "$GITHUB_REF_NAME" + --generate-notes + - name: Upload distribution artifacts to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release upload + "$GITHUB_REF_NAME" dist/** + --repo "$GITHUB_REPOSITORY"