diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9075f88..15c19f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -276,7 +276,14 @@ jobs: # Write and read notes from a file to avoid quoting breaking things echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt - gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* + # The plan job runs `dist host --steps=create` which pre-creates the draft release. + # If the release already exists, edit it in place; otherwise create it fresh. + if gh release view "${{ needs.plan.outputs.tag }}" > /dev/null 2>&1; then + gh release edit "${{ needs.plan.outputs.tag }}" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" + gh release upload "${{ needs.plan.outputs.tag }}" artifacts/* --clobber + else + gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* + fi custom-publish-homebrew: needs: