Skip to content

feat(release): versioned releases with one rolling draft - #3

Merged
codemug merged 1 commit into
mainfrom
feat/versioned-releases
Nov 23, 2026
Merged

codemug merged 1 commit into
mainfrom
feat/versioned-releases

Conversation

@codemug

@codemug codemug commented Nov 23, 2026

Copy link
Copy Markdown
Owner

WebPC releases become versioned. Every push to main keeps 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.0 first, bumped from the conventional-commit prefixes since the last published tag:

    • type!: or BREAKING CHANGE gives a major;
    • feat gives a minor;
    • anything else gives a patch.

    The logic is in scripts/release/versions.mjs, with a next and a notes command, and is tested in tests/release-versions.test.mjs.

  • On every push to main, scripts/release/publish-dist.sh keeps exactly one draft:

    • it creates the draft, or updates the existing one;
    • the same three assets as latest-dist, uploaded with --clobber;
    • the target moves to the pushed commit;
    • the notes are rewritten: one line per commit since the last published tag, capped at 100 lines;
    • when a feat lands 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.json now carries version next to commit and builtAt.

  • latest-dist is 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:
    • no tag gives v0.1.0;
    • patch, minor and major bumps;
    • non-semver tags such as latest-dist are ignored;
    • the highest tag wins in any order;
    • the notes cap with "and N more";
    • merge commits are left out.
  • node --test tests/*.test.mjs: 1119 pass, 0 fail.
  • bash -n scripts/release/publish-dist.sh: syntax ok.
  • Against this repo:
    • node scripts/release/versions.mjs next prints v0.1.0 (no published tag yet);
    • notes prints 62 lines, newest first;
    • a bad command prints usage and exits 1.
  • The gh behaviours were checked in gh's source (pkg/cmd/release):
    • FetchRelease finds a draft by its pending tag name, so upload and edit work on the draft;
    • edit has --tag, --target, --title and --notes-file;
    • create has --draft and --target;
    • list --json has isDraft and tagName.
  • Not run: the publish step itself, which runs only on main. The first push after merge creates the draft v0.1.0; check the run log and the releases page then.

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.
@codemug
codemug merged commit 05c6b97 into main Nov 23, 2026
1 check passed
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