@@ -37,13 +37,29 @@ jobs:
3737 git_committer_name : " github-actions"
3838 git_committer_email :
" [email protected] " 3939 changelog : " false"
40+ # Commit, tag, push and build, but don't create the GitHub release.
41+ # We create it ourselves in the next step so that the distributions
42+ # are attached before the release is published. See that step for why.
43+ vcs_release : " false"
4044
41- - name : Publish | Upload to GitHub Release Assets
42- uses :
python-semantic-release/[email protected] 45+ # This repo has immutable releases enabled, which freezes a release's
46+ # assets the moment it is published, so assets cannot be attached
47+ # afterwards. `gh release create` handles this by creating the release as
48+ # a draft, uploading the assets, and only then publishing it:
49+ # https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases
50+ - name : Publish | Create GitHub Release with Assets
4351 if : steps.release.outputs.released == 'true'
44- with :
45- github_token : ${{ secrets.GITHUB_TOKEN }}
46- tag : ${{ steps.release.outputs.tag }}
52+ env :
53+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+ RELEASE_NOTES : ${{ steps.release.outputs.release_notes }}
55+ TAG : ${{ steps.release.outputs.tag }}
56+ run : |
57+ printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md"
58+ gh release create "$TAG" \
59+ --verify-tag \
60+ --title "$TAG" \
61+ --notes-file "$RUNNER_TEMP/release_notes.md" \
62+ dist/*
4763
4864 - name : Upload dist artifacts
4965 if : steps.release.outputs.released == 'true'
0 commit comments