From e5a874560c5bf50d6a254fae7fa4bbc4fed97d23 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 25 Aug 2026 23:42:22 +0100 Subject: [PATCH] Upload release assets with the GitHub CLI Release assets are now attached by gh release upload in the build job, replacing the third-party action that ran in the publish job. They are attached before publishing to PyPI, so a failure there still leaves a complete release, and --clobber makes the step safe to re-run. --- .github/workflows/harp.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/harp.yml b/.github/workflows/harp.yml index e595f6d..e6711a7 100644 --- a/.github/workflows/harp.yml +++ b/.github/workflows/harp.yml @@ -57,6 +57,9 @@ jobs: name: Build release distributions needs: tests if: github.event_name == 'release' && github.event.action == 'published' + permissions: + # gh release upload attaches the distributions to the release. + contents: write steps: - uses: actions/checkout@v7 @@ -89,6 +92,11 @@ jobs: name: dist path: dist/ + - name: Upload release assets + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload --repo ${{ github.repository }} ${{ github.event.release.tag_name }} dist/* --clobber + # ---- Publish to PyPI ---- publish-to-pypi: runs-on: ubuntu-latest @@ -98,8 +106,6 @@ jobs: permissions: # uv publish exchanges this token with PyPI trusted publishing. id-token: write - # action-gh-release attaches the distributions to the release. - contents: write steps: - name: Download wheels artifact uses: actions/download-artifact@v8 @@ -114,11 +120,6 @@ jobs: - name: Publish to PyPI run: uv publish - - name: Upload wheels to GitHub release - uses: softprops/action-gh-release@v3 - with: - files: dist/* - # ---- Build docs ---- build-docs: name: Build documentation