Skip to content

Commit c033950

Browse files
authored
Upload release wheels to GitHub releases (#415)
## Summary - add a post-PyPI publish step that creates the GitHub release when needed - upload built wheels to the release page with --clobber so reruns are idempotent - enable skip-existing for PyPI publish reruns after a partial release ## Validation - ruby -e 'require "yaml"; YAML.load_file(".github/workflows/release.yml"); puts "yaml ok"' - git diff --check - manually uploaded the v1.2.5 wheels from run 26184878430 to the release page and verified 16 assets
1 parent 6e1f5b6 commit c033950

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ jobs:
279279
if: startsWith(github.ref, 'refs/tags')
280280
runs-on: ubuntu-latest
281281
needs: [release-linux, release-macos, release-windows]
282+
permissions:
283+
actions: read
284+
contents: write
282285
steps:
283286
- uses: actions/download-artifact@v8
284287
with:
@@ -293,3 +296,14 @@ jobs:
293296
uses: pypa/gh-action-pypi-publish@release/v1
294297
with:
295298
password: ${{ secrets.PYPI_API_TOKEN }}
299+
skip-existing: true
300+
- name: Create GitHub release and upload wheels
301+
env:
302+
GH_TOKEN: ${{ github.token }}
303+
run: |
304+
gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1 || \
305+
gh release create "${GITHUB_REF_NAME}" \
306+
--title "${GITHUB_REF_NAME}" \
307+
--generate-notes \
308+
--verify-tag
309+
gh release upload "${GITHUB_REF_NAME}" dist/*.whl --clobber

0 commit comments

Comments
 (0)