Skip to content

fix(release): publish prereleases from a draft so assets upload - #333

Open
mayankpande88 wants to merge 1 commit into
mainfrom
fix/release-prerelease-assets
Open

fix(release): publish prereleases from a draft so assets upload#333
mayankpande88 wants to merge 1 commit into
mainfrom
fix/release-prerelease-assets

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Problem

Immutable releases reject asset uploads after publication, and a prerelease is published the moment it is created. So the binaries failed to attach on v0.1.7-rc.1, failing the whole release job even though the image had already been pushed:

Cannot upload asset nudgebee-node-agent-0.1.7-rc.1-arm64 to an immutable release.
GitHub only allows asset uploads before a release is published, but draft
prereleases publish with the release.published event instead of release.prereleased.

This is not specific to that tag — every RC fails the same way, and RCs are how this repo validates changes before a full release.

Confirmed by contrast: v0.1.7 (a full release) took the non-draft path and published cleanly with both binaries attached. Only prereleases are affected, which is why this went unnoticed until we started cutting RCs.

Fix

Prereleases are created as a draft, which stays writable long enough for the upload, then published in a following step. GitHub's own error message prescribes exactly this.

Full releases are unaffected and stay non-draft.

Downstream consumers should watch release.published, which fires for both paths.

Testing

YAML validated. The behaviour itself can only be exercised by pushing a real prerelease tag — the next -rc tag is the test. If it regresses, the symptom is identical to the one above and the image still publishes regardless, so the blast radius is a red job rather than a broken release.

Immutable releases reject asset uploads after publication, and a prerelease
is published the moment it is created. The binaries therefore failed to
attach on v0.1.7-rc.1, taking the whole release job to a failure even
though the image had already been pushed:

  Cannot upload asset nudgebee-node-agent-0.1.7-rc.1-arm64 to an immutable
  release. GitHub only allows asset uploads before a release is published,
  but draft prereleases publish with the release.published event instead of
  release.prereleased.

This is not specific to that tag — every RC would have failed the same way,
and RCs are how this repo validates changes before a full release.

Prereleases are now created as a draft, which stays writable for the
upload, then published in a following step. Full releases are unaffected
and stay non-draft, which is why only RCs ever broke. Downstream consumers
should watch release.published, which fires for both paths.
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant