Skip to content

chore(release): per-package release flow and temporal first-release prep - #156

Open
piotrblaszczyk wants to merge 7 commits into
mainfrom
chore/temporal-release-prep
Open

piotrblaszczyk wants to merge 7 commits into
mainfrom
chore/temporal-release-prep

Conversation

@piotrblaszczyk

Copy link
Copy Markdown
Contributor

What this PR does

Prepares @workflowbuilder/temporal for its first npm publish and makes releases per-package, so that releasing one package never touches the others.

No package is published by this PR. Publishing still happens only when a maintainer pushes a @workflowbuilder/<pkg>@X.Y.Z tag.

Release flow (new)

  • pnpm release:version <pkg> (tools/release-version.mjs). Runs changeset version with --ignore for every publishable package you did not name, so their changesets stay in .changeset/. Refuses on main / release, for unknown or private packages, and when nothing is pending. --dry-run prints the plan.
  • pnpm release:tag <pkg> (tools/release-tag.mjs). Checks that HEAD is the tip of origin/release, the tree is clean, the CHANGELOG has a section for the version, no such tag exists and the workflow file is present. Asks, then pushes exactly one tag by name. Reports whether the version is already on npm (then the workflow only creates the GitHub Release).
  • .changeset/config.json: the static ignore list becomes privatePackages: { version: false, tag: false }. Same effect (every listed package was private), and it unblocks the CLI --ignore flag, which Changesets refuses while a config ignore list exists.
  • packages/RELEASE.md (moved from packages/sdk/, it covers all three packages): per-package procedure, a new section First release of a new package, and changeset tag is no longer used.

npm cannot register a trusted publisher for a package that does not exist yet. The first version is therefore published by hand from the release head, then the trusted publisher is added, then the tag runs the workflow, which skips publish and creates the GitHub Release.

Temporal package

  • private: true removed.
  • CHANGELOG.md reduced to the heading. Changesets inserts the new section right after the H1, and the old preamble would have leaked into the 0.1.0 release notes.
  • README trimmed to the npm landing page. The detail moved to activity-profiles.md and event-history-labels.md next to it. Deliberately not linked from the README yet: when the docs site gets pages for them, they move there and the README links out.
  • Seed changeset expanded to describe what ships in 0.1.0.

Release one package at a time. `pnpm release:version <pkg>` computes the
`changeset version --ignore` list from the workspace, so a release of one package
never bumps its siblings on `release`. `pnpm release:tag <pkg>` creates and pushes
exactly one scoped tag after checking that HEAD is the release head, the CHANGELOG
has the section and no tag exists yet. `.changeset/config.json` trades the static
`ignore` list for `privatePackages`, which is what frees the CLI `--ignore` flag.

Prepare `@workflowbuilder/temporal` for its first npm publish: drop `private`,
reset CHANGELOG.md to the bare heading so nothing leaks into release notes, trim
the README to the npm landing page (the detail moves to activity-profiles.md and
event-history-labels.md next to it, not linked until the docs site has pages), and
document the manual first publish. RELEASE.md moves from packages/sdk to packages/
because it covers all three published packages; `@workflowbuilder/ui` is not on npm
either and follows the same bootstrap.
…red module

Both scripts read as one block of statements with duplicated helpers and
hand-rolled argument parsing. The plumbing (fail, run, package names, workspace
listing, parseArgs) moves to tools/release-shared.mjs; each script is now a
short linear flow under section banners with a one-line comment per block.
release:tag prints each check as it runs instead of collecting them first.
Behaviour is unchanged.
`@temporalio/activity`, `client`, `workflow` and `worker` were regular dependencies on
`^1.23.0`, while a consumer's `@temporalio/worker` pins its siblings exactly. pnpm then
installs a second copy of `@temporalio/activity` next to the worker's own, and
`activityInfo()` reads an activity context that lives in the other copy. As peers they
resolve to the consumer's single copy (verified in a scratch consumer: old shape two
copies, new shape one). `@temporalio/plugin` stays a dependency, it has none of its own.
Node floor raised to 20.3.0 to match the SDK. README lists the four packages to install
and points at the two companion documents.
release:version refuses a changeset that names both a released and a skipped package,
a release of the SDK while UI (compiled into it) has pending changesets, and any branch
that is not `release-*` (the `release` branch blocks the `release/` namespace). It also
stops when git cannot report the branch. release:tag checks the exit code of
`ls-remote`, pushes with --no-verify so the pre-push formatter stays out of a release,
and reads the tag back from origin before it reports. The CHANGELOG heading rule is one
function with tests, mirrored by the awk in the release workflows: exact version token,
so a prerelease never passes for the release. pr-check lints, formats and tests tools/,
and its changeset guards count only changesets a PR adds, now also for the UI -> SDK
pair.
Release branches are `release-<pkg>-X.Y.Z`; the SDK/UI bundling pair and one-package
changesets are spelled out; pushing to `release` deploys the docs; the trusted-publisher
limitation cites its sources and asks for a check in the npm UI first; the UI CHANGELOG
keeps only the heading above its first section so nothing leaks into release notes.
… claims

The replay README requires every release of @workflowbuilder/temporal to record the
scenarios again under the version it ships, and the first release to retire the `v0-`
baseline; the runbook never said so, and its expected-diff list even contradicted it.
Both now agree, and the replay README no longer describes the package as private or
records under 1.0.0. The npm README gains the node-label sentence, a short "Failures and
retries" section for the two error classes the changeset advertises, and the statement
that the replay contract has no pre-1.0 exception. Corrected along the way: the lockfile
is never touched by a bump (`workspace:*` carries no version), `pnpm publish` rewrites
workspace devDependencies rather than stripping them, the breaking-change example points
at the consumed changeset in git history, a test comment names activity-profiles.md, the
SDK release title no longer repeats the package name, and CLAUDE.md speaks of all three
published packages.
release:tag read a failed git command as an empty answer, which the checks took for a
clean tree or a missing tag; the helper now stops the script with git's own message,
except for the Actions link printed after the push. The npm check told "not on npm" for
every failure, including a registry that could not be reached; it now distinguishes a
published version, a missing one (empty answer or E404) and a failed lookup, and says
which. release:version lists the replay-history recording among its next steps for the
package that carries a replay contract, with the version already filled in, so the
runbook and the tool name the same steps.
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.

3 participants