Skip to content

feat(release): one v-tag per release, carrying the GitHub release notes - #49

Merged
stefanoverna merged 2 commits into
masterfrom
feat/single-version-tag-and-github-release
Aug 25, 2026
Merged

feat(release): one v-tag per release, carrying the GitHub release notes#49
stefanoverna merged 2 commits into
masterfrom
feat/single-version-tag-and-github-release

Conversation

@stefanoverna

Copy link
Copy Markdown
Member

Follow-up to #48, now that the first release on the new tooling (v2.2.7) has
shown what it looks like in practice.

What changed

changeset publish tags every package separately — datocms-plugin-sdk@2.2.7,
datocms-react-ui@2.2.7. That's the right default for independent versioning,
but our two packages are a fixed group: the tags always point at the same
commit and carry the same information, and the vX.Y.Z tag this repo used for
its first 222 tags stopped being created.

So changeset publish now runs with --no-git-tag, and the script creates
vX.Y.Z itself, right after the publish returns.

This doesn't weaken the ordering invariant from #48, it tightens it: a tag can
still only exist for a version that is actually on the registry, and now a
partial publish leaves no tag at all, instead of one tag for each package
that made it through.

GitHub releases

Only 6 of 222 tags ever got a release, and the one recent one (v2.2.1) was
composed by hand. But changesets now writes exactly that prose into the
CHANGELOG.mds, so the script reads each package's section for the version
being released and posts them as one release, one heading per package:

## datocms-plugin-sdk

### Patch Changes

- 5b90e51: Pin the `@datocms/cma-client` and `emoji-regex-xs` dependencies, ...

## datocms-react-ui

### Patch Changes

- Updated dependencies [5b90e51]
  - datocms-plugin-sdk@2.2.7

(That's the real output of the new release_notes helper against the v2.2.7
changelogs.) It's generated, not curated — if a release deserves a write-up like
v2.2.1 got, edit it afterwards.

A prerelease is marked --prerelease, so a publish-next can't take over the
repository's "Latest release" badge.

Preflight

gh and its auth are checked up front, next to npm whoami. A missing GitHub
CLI now stops the release before anything is mutated, rather than after npm has
already been published to.

How this was verified

No release was cut to test this, so here's what was actually checked:

  • --no-git-tag suppresses every tag, not just some. Read from the installed
    source: @changesets/cli/dist/publish.mjs:94 guards the tag-only path and
    :188 guards the successful-publish path, both with the same
    options?.gitTag ?? true. With the flag off, gitTagReleases stays empty and
    createGitTags receives nothing.
  • The flag parses, and composes with --tag. cac turns --no-git-tag into
    gitTag: false; verified by replaying the CLI's own option declaration
    (--git-tag, default true) through cac with --no-git-tag --tag next.
  • The release notes are real. release_notes was run against the actual
    v2.2.7 changelogs — that's the output quoted above.
  • gh release create --notes-file - reads stdin (gh release create --help).
  • Preflight still aborts off master.

Not verified: the gh release create call itself has never run. The first
release on this script will be the first time it executes.

`changeset publish` tags every package separately (`datocms-plugin-sdk@2.2.7`,
`datocms-react-ui@2.2.7`), which is the right default when packages move
independently. Ours don't: they're a `fixed` group, so the two tags always point
at the same commit and say the same thing — and the `vX.Y.Z` tag this repo used
for its first 222 tags stopped being created.

Publish now runs with `--no-git-tag` and the script tags `vX.Y.Z` itself,
*after* the publish returns. That keeps the invariant that made this rewrite
worth doing — a tag can only exist for a version that is actually on the
registry — and makes it slightly stronger: a partial publish now leaves no tag
at all, rather than one tag per package that made it.

The tag then carries the release notes. Only 6 of the 222 tags ever had a
GitHub release, because writing one meant composing it by hand; changesets has
already written that prose into the `CHANGELOG.md`s, so the script reads each
package's section for this version and posts them under one release. A
prerelease is marked as such, so a `next` publish can't take over the
repository's "Latest release" badge.

`gh` is checked in preflight, alongside npm auth, so a missing GitHub CLI stops
the release before anything is mutated rather than after npm has been published.
The link is read back with `gh release view` instead of being parsed out of
`gh release create`, so it's the same whether the release was just created or
was already there from an interrupted run — and a lookup that fails leaves the
success message intact rather than killing the script at the very last line.
@stefanoverna
stefanoverna merged commit a72b03b into master Aug 25, 2026
2 checks passed
@stefanoverna
stefanoverna deleted the feat/single-version-tag-and-github-release branch August 25, 2026 11:28
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