feat: mark release as draft until all artifacts are uploaded

Previously, the releases were created and then artifacts (if any)
were added to them. This broke when GitHub released "immutable"
releases, which disallow changes after the release is published.

Make it so that releases are always marked as "draft" when being
worked on by the action, and unmarked as draft (if desired) once
the action is completed.

Fixes #653
This commit is contained in:
jj 2025-11-18 15:26:08 +00:00
parent 5be0e66d93
commit f0aaee5ca0
No known key found for this signature in database
4 changed files with 67 additions and 8 deletions

View file

@ -49,6 +49,7 @@ describe('github', () => {
getReleaseByTag: () => Promise.reject('Not implemented'),
createRelease: () => Promise.reject('Not implemented'),
updateRelease: () => Promise.reject('Not implemented'),
finalizeRelease: () => Promise.reject('Not implemented'),
allReleases: async function* () {
yield { data: [mockRelease] };
},
@ -254,11 +255,12 @@ describe('github', () => {
name: 'test',
body: 'test',
target_commitish: 'main',
draft: false,
draft: true,
prerelease: false,
assets: [],
},
}),
finalizeRelease: async () => {},
allReleases: async function* () {
yield {
data: [