Skip to content

fix(release): draft releases until assets are attached - #201

Open
Swaagie wants to merge 3 commits into
mainfrom
fix/release-install-404-race
Open

fix(release): draft releases until assets are attached#201
Swaagie wants to merge 3 commits into
mainfrom
fix/release-install-404-race

Conversation

@Swaagie

@Swaagie Swaagie commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Fixes a race where curl -fsSL https://github.com/godaddy/cli/releases/latest/download/install.sh | bash returns 404 during a release.

release-please published each GitHub Release as non-draft immediately on merge, so releases/latest/download/… began redirecting to the new tag before the build + attach jobs finished. For that multi-minute window, every asset URL 404'd — including install.sh itself, which the one-liner fetches — so a fresh install could hard-fail. This was hit live during the v0.2.4 release.

Fix

  • release-please-config.json — set "draft": true on the rust package so each Release is created as a draft.
  • .github/workflows/release.yml — after gh release upload …, publish with gh release edit "$TAG" --draft=false --latest, i.e. only once all assets are attached.

How draft releases close the race

Per GitHub's docs on creating a release:

If you're ready to publicize your release, click Publish release. To work on the release later, click Save draft.

A draft release is not public and is never served as latest — GitHub only resolves releases/latest/download/… to published releases. So while the new draft is being built and its assets uploaded, the latest pointer keeps resolving to the previous, fully-populated release (a brief "installs previous version", never a 404). Publishing with --draft=false --latest then flips the pointer atomically to a release that is already complete.

Fail-safe bonus: if build/attach fail, the release stays a draft and is never exposed to users. Re-run the upload/publish via the existing publish_only workflow_dispatch input.

Test plan

  • release-please-config.json is valid JSON; release.yml parses as YAML.
  • On the next release, confirm the Release appears as Draft during build, flips to Latest only after attach, and the install one-liner never 404s mid-release.

release-please published each GitHub Release as non-draft immediately on
merge, so releases/latest/download/... began redirecting to the new tag
before the build+attach jobs uploaded any assets. During that multi-minute
window every asset URL 404'd — including install.sh itself, which the
install one-liner fetches — so a fresh install could fail.

Create the release as a draft (release-please 'draft: true') and publish it
(gh release edit --draft=false --latest) only after all assets are attached.
A draft is never served as 'latest', so the pointer stays on the previous,
fully-populated release until the new one is complete. If build/attach fail,
the release stays a draft and is never exposed to users.
Copilot AI lite review requested due to automatic review settings August 11, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a release-time race condition where releases/latest/download/... can temporarily point at a new tag before its assets are uploaded, causing install scripts (and other assets) to 404 during the build/attach window. It does so by ensuring GitHub Releases are created as drafts until all assets are uploaded, then publishing and marking the release as latest only at the end of the workflow.

Changes:

  • Configure release-please to create the rust package GitHub Release as a draft.
  • Update the release workflow to publish (--draft=false) and mark --latest only after uploading all release assets.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
release-please-config.json Sets draft: true for the rust release so new releases aren’t publicly “latest” until explicitly published.
.github/workflows/release.yml Publishes the release after assets upload to avoid latest/download redirecting to an incomplete release.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release.yml
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.

2 participants