Repository navigation
feat(release): versioned releases with one rolling draft - #3
Merged
Merged
Conversation
Each push to main now keeps one draft release for the next version, next to the rolling latest-dist build. The draft gets the same three assets, its target moves to the pushed commit, and its notes list the commits since the last published version. - The version is a semver tag, v0.1.0 first, bumped from the commit prefixes since the last published tag: type! or BREAKING CHANGE is a major, feat a minor, anything else a patch. When a feat lands after the draft was cut, the draft moves to the new version. - Publishing stays manual. Un-drafting creates the tag, and a host site can then pin that version. webpc-build.json now names the version too. - latest-dist keeps updating unchanged until the site pins a version. - CI checks out the full history and tags, which the version and the notes need. The gh calls were checked against gh's source: drafts are found by their pending tag name, and edit takes --tag, --target, --title and --notes-file.
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.
WebPC releases become versioned. Every push to
mainkeeps one draft release for the next version, and publishing that draft makes a pinnable version.What changes
The next version is a semver tag,
v0.1.0first, bumped from the conventional-commit prefixes since the last published tag:type!:orBREAKING CHANGEgives a major;featgives a minor;The logic is in
scripts/release/versions.mjs, with anextand anotescommand, and is tested intests/release-versions.test.mjs.On every push to
main,scripts/release/publish-dist.shkeeps exactly one draft:latest-dist, uploaded with--clobber;featlands after the draft was cut, the draft's tag and title move to the new version.Publishing is manual: un-draft it in the GitHub UI, or run
gh release edit v0.1.0 --draft=false --repo codemug/webpc. That creates the git tag, since a draft only holds a pending tag.webpc-build.jsonnow carriesversionnext tocommitandbuiltAt.latest-distis unchanged and keeps updating, so the host site works until it pins a version.CI checks out the full history and tags (
fetch-depth: 0,fetch-tags: true), which the version and the notes need.How it was checked
node --test tests/release-versions.test.mjs: 9 pass. Covered:latest-distare ignored;node --test tests/*.test.mjs: 1119 pass, 0 fail.bash -n scripts/release/publish-dist.sh: syntax ok.node scripts/release/versions.mjs nextprintsv0.1.0(no published tag yet);notesprints 62 lines, newest first;ghbehaviours were checked in gh's source (pkg/cmd/release):FetchReleasefinds a draft by its pending tag name, souploadandeditwork on the draft;edithas--tag,--target,--titleand--notes-file;createhas--draftand--target;list --jsonhasisDraftandtagName.main. The first push after merge creates the draftv0.1.0; check the run log and the releases page then.