Repository navigation
Conversation
…hing it With `create-release = false`, dist uploads into an existing draft GitHub Release and then always undrafts it. `undraft-release = false` (default true) keeps the upload and skips the `gh release edit --draft=false`, so another tool that owns the release can attach more assets and publish it itself. Uploads use `--clobber` in this mode so re-runs are idempotent.
11 tasks
3 tasks
10 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2520.
What
A new global-only setting, next to
create-release:With
create-release = falseandundraft-release = false, the publish step uploads dist's artifacts into the existing draft GitHub Release (gh release upload <tag> artifacts/* --clobber) and does not rungh release edit <tag> --draft=false. The release stays a draft, so another tool that owns it can attach more assets and publish it later. The default (true) leaves generated CI byte-for-byte unchanged.Changes
undraft-releasemaps to v1hosts.github.undraft(in the layer, the final config andApplyLayer), with the usual "only accepted in workspace.metadata" warning.dist initround-trips the key.backend/ci/github.rs: exposesundraft_releaseto the templates.release_commandis unchanged.partials/publish_github.yml.j2: adds an upload-only branch forcreate-release = falseplusundraft-release = false. It uses--clobberso re-runs are idempotent, and passes--repo "$REPO"whengithub-releases-repois set.release_commandis rendered only when creating or undrafting.release.yml.j2: the header comment no longer claims the release will be undrafted in this mode.undraft-releaseentry in the config reference, and a note inci/customizing.md.axolotlsay_edit_existing_no_undraftsnapshot, the same config asaxolotlsay_edit_existingplusundraft-release = false. Against theaxolotlsay_edit_existingsnapshot, the diff is exactly the header comment plusupload … --clobberreplacingupload …+gh release edit … --draft=false. The existing snapshot is unchanged.Testing
cargo test --workspace -- --test-threads=1(no nextest, per CONTRIBUTING): everything passes exceptaxolotlsay_basic. That test fails identically on unmodifiedmainon my machine, becausedist build -aglobalreports missing packaging tools.cargo clippy --workspace --all-targetsandcargo fmt --checkare clean.ci = "github",create-release = false,undraft-release = false):dist generateemitsgh release upload … --clobber, with zero occurrences of--draft=false.dist generate --checkis clean, anddist init --yeskeeps the key.github-release = "announce"and withgithub-releases-repo(where the upload gets--repo "$REPO").ghmodelling an immutable-once-published draft. With the new option, two consecutive runs both succeed and the release stays a draft. With the default, the release is undrafted and a re-run hitsHTTP 422: Cannot upload assets to an immutable release, which is the failure mode that motivated this.Notes for review
undraft-releasemirrorscreate-release. Happy to rename (e.g.github-release-undraft).CHANGELOG.mdalone, since it looks maintainer-written at release time.gh release uploaddoesn't pass--repo "$REPO"whengithub-releases-repois set, so it uploads to the current repo. I haven't changed that path, to keep this PR scoped; I can send a separate fix if you'd like.