Skip to content

ci: add one-click release flow (3.x) - #18717

Merged
denolfe merged 24 commits into
3.xfrom
ci/one-click-v3
Oct 19, 2026
Merged

denolfe merged 24 commits into
3.xfrom
ci/one-click-v3

Conversation

@denolfe

@denolfe denolfe commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

This PR ports main's one-click release flow to the 3.x branch, for stable v3 patch and minor releases. A maintainer dispatches one workflow. CI then bumps the version, tags it, publishes to npm, and opens a draft GitHub release.

v3 releases today run from a maintainer's machine with pnpm release --tag latest. After v4 reaches GA, a v3 release must not move the npm latest dist-tag (the label a plain npm install resolves). Choosing the tag by hand on every release is easy to get wrong.

Actions > release-bump > Run workflow
  Use workflow from: 3.x
  bump:    patch | minor   (default: patch)
  dry_run: true | false

Local dry runs: pnpm release-bump --bump minor --dry-run and GITHUB_TOKEN=$(gh auth token) pnpm release-ci --dry-run (read-only). pnpm release stays as a guarded local fallback and refuses --tag.

Required before the first run (repo settings, outside this PR):

  • release environment: allow tag pattern v3.*.
  • bump environment: allow branch 3.x.
  • 3.x-branch-governance ruleset: add payload-release-bot to the bypass list.

Resolves PYLD-4381

Changes

  • Release workflows
    • release-bump.yml takes bump and dry_run. It checks out 3.x and runs release-bump.ts.
    • publish-release.yml runs only on stable v3 tags (v3.*.*, excluding v3.*-*). It runs release-ci.ts in the release environment.
    • Publishing uses OIDC trusted publishing (npm auth from the workflow's GitHub identity token instead of a stored npm token).
    • publish-release.yml skips a tag whose commit message has [skip ci]. Only the local pnpm release commit carries it, and that path publishes on its own.
  • Bump guards
    • release-bump.ts accepts only a stable v3 version on 3.x with a patch or minor bump. It also stops if npm already has the next version.
    • Both checks run before any git write. The commit, tag, and branch go out in one atomic push (all refs land or none do).
    • If a merge lands on 3.x during the push, the bump rebases, retags, and pushes again.
    • The bump's command runner captures git's stderr. The retry reads git's rejection message from it.
  • Per-package dist-tag
    • A package publishes to latest while its npm latest is v3 or lower. It publishes to payload-3 once its npm latest is v4 or higher.
    • All tags are resolved before the build. Each package's npm latest, and payload-3 when chosen, is read again right before that package publishes.
    • A separate guard re-derives the rule on that fresh read.
    • The guard also refuses a tag that already points to a newer version than the one being published. This covers both latest and payload-3.
    • An older release can then never move either tag backwards.
    • Registry reads retry up to 3 times on 5xx, 429, network errors, and timeouts. Each attempt times out after 15 seconds.
    • A 404 or a malformed response is not retried.
    • If a read still fails, that package does not publish and the release stops. A read error never selects latest.
  • Partial publish and resume
    • A stop leaves the packages before it published. Because of the topological order, those are all dependencies of the remaining packages.
    • Re-running the failed publish-release job on the same tag resumes the release. It skips packages already on npm and reads each tag again.
    • Resuming an older version after a newer one shipped stops before the build, at the downgrade guard.
  • Publish order
    • publishList is in topological order (every dependency before its dependents). A spec checks the list against turbo's build graph.
    • getPackageDetails returns packages in list order. It used to return them in filesystem glob order, which published payload before translations.
  • Draft GitHub release
    • The draft targets 3.x. When payload publishes to payload-3, the draft request sends make_latest: false.
    • In that case the run also logs a reminder to untick "Set as the latest release" when you publish the draft.
    • The notes start at the newest published tag lower than the release version. A re-run of an older release after a newer one shipped keeps its own range.
  • Prereleases
    • publish-prerelease publishes only to internal and internal-debug.
  • Local fallback (release.ts)
    • It uses the same guards and tag selection as CI. It publishes in list order through the shared publish function.
    • Each package publishes with the bumped version. With the pre-bump version, the shared publish check would find it on npm and skip the package.
    • The shared function retries once and treats "already published" as success.
    • It stops at the first failure and prints resume steps for the same version. Re-running pnpm release would bump to a new version and split the release.
    • The resume steps push the tag, then confirm in Actions that no publish-release run started. Only then do they run release-ci locally.
    • On EOTP (npm's one-time-password error), the steps fall back to pnpm publish per package, in list order.
  • Shared releaser code
    • Workspace publish, registry checks, release notes, and draft upsert come from main, along with their specs.

Design Decisions

  • Tag per package, not per release. v3-only packages such as richtext-slate keep latest after v4 GA. Packages that also ship in v4 move to payload-3.
  • Own guard for each tag. An explicit --tag latest skips npm's "lower than current latest" check. npm has no such check for other tags. The releaser therefore runs its own check before each publish: no newer major on latest, and no lower version than the tag's current version on latest or payload-3.
  • Fail closed over finish. A registry read that keeps failing stops the release instead of guessing a tag. A partial publish can be resumed. A wrong latest reaches every new install.
  • payload-3 gap at GA. payload-3 does not exist until the first v3 release after GA. A manual dist-tag step at GA closes the gap. CI gets no dist-tag permission.
  • Environment as the branch gate. npm trusted publishing has no ref field. One publisher config serves both branches. The release environment's tag policy controls which tags can publish.
  • One publisher per release. A CI release and a local release never both publish the same tag. The [skip ci] check makes this explicit instead of relying on GitHub's skip handling for tag pushes.
  • Main has the same bugs. On main, getPackageDetails also returns glob order. The bump push retry on main also cannot see git's rejection text. A separate PR fixes main.

Overall Flow

The release moves out of a maintainer's terminal into two workflows, joined by a tag.

sequenceDiagram
  actor M as Maintainer
  participant B as release-bump.yml
  participant R as 3.x branch
  participant P as publish-release.yml
  participant N as npm
  participant G as GitHub Releases

  M->>B: dispatch on 3.x (bump, dry_run)
  B->>B: guard: 3.x, stable v3, patch/minor, not on npm
  B->>R: commit, tag v3.x.y, atomic push (rebase and retry if 3.x moved)
  R-->>P: tag push triggers publish
  P->>N: read dist-tags for every package
  P->>P: build
  loop each package in topological order
    P->>N: re-read dist-tags (retry transient errors), guard
    P->>N: publish --tag latest or payload-3
  end
  P->>G: upsert draft release (target 3.x)
  M->>G: review and publish draft
Loading

References / Links

🤖 Written with AI

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖

Meta File Out File Size (raw) Note
packages/next/meta_index.json esbuild/index.js 1.00 MB 🆕 Added
packages/payload/meta_index.json esbuild/index.js 1.47 MB 🆕 Added
packages/payload/meta_shared.json esbuild/exports/shared.js 202.78 KB 🆕 Added
packages/richtext-lexical/meta_client.json esbuild/exports/client_optimized/index.js 291.16 KB 🆕 Added
packages/ui/meta_client.json esbuild/exports/client_optimized/index.js 1.20 MB 🆕 Added
packages/ui/meta_shared.json esbuild/exports/shared_optimized/index.js 16.32 KB 🆕 Added
Largest paths These visualization shows top 20 largest paths in the bundle.

Meta file: packages/next/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████████████▌ }}}$ 82.4%, 820.17 KB
dist/views/Version ${{\color{Goldenrod}{ █▎ }}}$ 5.2%, 51.87 KB
dist/views/Dashboard ${{\color{Goldenrod}{ ▌ }}}$ 2.1%, 21.39 KB
dist/views/Document ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 16.71 KB
dist/views/List ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 11.42 KB
dist/views/Root ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 10.06 KB
dist/views/Versions ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 6.17 KB
dist/views/API ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 6.13 KB
dist/elements/Nav ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 5.96 KB
dist/views/Account ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 5.56 KB
dist/elements/DocumentHeader ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 4.84 KB
dist/views/ForgotPassword ${{\color{Goldenrod}{ }}}$ 0.4%, 4.45 KB
dist/views/Login ${{\color{Goldenrod}{ }}}$ 0.4%, 4.40 KB
dist/layouts/Root ${{\color{Goldenrod}{ }}}$ 0.3%, 3.19 KB
dist/views/CreateFirstUser ${{\color{Goldenrod}{ }}}$ 0.3%, 2.81 KB
dist/templates/Default ${{\color{Goldenrod}{ }}}$ 0.3%, 2.64 KB
dist/views/BrowseByFolder ${{\color{Goldenrod}{ }}}$ 0.3%, 2.61 KB
dist/views/CollectionFolders ${{\color{Goldenrod}{ }}}$ 0.2%, 2.44 KB
dist/views/ResetPassword ${{\color{Goldenrod}{ }}}$ 0.2%, 2.40 KB
dist/views/Logout ${{\color{Goldenrod}{ }}}$ 0.2%, 1.94 KB
(other) ${{\color{Goldenrod}{ ████▍ }}}$ 17.6%, 175.59 KB

Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████████▋ }}}$ 66.8%, 978.79 KB
dist/collections/operations ${{\color{Goldenrod}{ ▊ }}}$ 3.4%, 49.81 KB
dist/fields/hooks ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 47.38 KB
dist/versions/migrations ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 18.50 KB
dist/auth/operations ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 16.98 KB
dist/globals/operations ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 14.88 KB
dist/fields/config ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 14.17 KB
dist/queues/operations ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 13.15 KB
dist/utilities/configToJSONSchema.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 13.13 KB
dist/utilities/telemetry ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 11.40 KB
dist/fields/validations.js ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 10.63 KB
dist/collections/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 9.29 KB
dist/bin/generateImportMap ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 9.08 KB
dist/config/orderable ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 8.73 KB
dist/uploads/fetchAPI-multipart ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 8.35 KB
dist/index.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 7.57 KB
dist/database/migrations ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 7.54 KB
dist/auth/strategies ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 6.97 KB
dist/auth/endpoints ${{\color{Goldenrod}{ }}}$ 0.4%, 6.59 KB
dist/config/sanitize.js ${{\color{Goldenrod}{ }}}$ 0.4%, 6.30 KB
(other) ${{\color{Goldenrod}{ ████████▎ }}}$ 33.2%, 486.88 KB

Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ███████████████████▊ }}}$ 79.1%, 157.26 KB
dist/fields/validations.js ${{\color{Goldenrod}{ █▎ }}}$ 5.3%, 10.60 KB
dist/utilities/deepCopyObject.js ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 3.35 KB
dist/config/orderable ${{\color{Goldenrod}{ ▍ }}}$ 1.6%, 3.13 KB
dist/fields/baseFields ${{\color{Goldenrod}{ ▎ }}}$ 1.4%, 2.79 KB
dist/auth/cookies.js ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 1.55 KB
dist/utilities/flattenTopLevelFields.js ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 1.42 KB
dist/fields/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 1.28 KB
dist/utilities/getVersionsConfig.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 1.04 KB
dist/utilities/flattenAllFields.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 943 B
dist/folders/utils ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 916 B
dist/utilities/unflatten.js ${{\color{Goldenrod}{ }}}$ 0.4%, 850 B
dist/utilities/sanitizeUserDataForEmail.js ${{\color{Goldenrod}{ }}}$ 0.4%, 713 B
dist/utilities/getFieldPermissions.js ${{\color{Goldenrod}{ }}}$ 0.3%, 651 B
dist/utilities/fieldPath.js ${{\color{Goldenrod}{ }}}$ 0.3%, 639 B
dist/utilities/getSafeRedirect.js ${{\color{Goldenrod}{ }}}$ 0.3%, 632 B
dist/uploads/getFileTypeIdentity.js ${{\color{Goldenrod}{ }}}$ 0.3%, 625 B
dist/collections/config ${{\color{Goldenrod}{ }}}$ 0.3%, 570 B
dist/bin/generateImportMap ${{\color{Goldenrod}{ }}}$ 0.3%, 561 B
dist/utilities/formatAdminURL.js ${{\color{Goldenrod}{ }}}$ 0.3%, 531 B
(other) ${{\color{Goldenrod}{ █████▏ }}}$ 20.9%, 41.61 KB

Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
dist/features/blocks ${{\color{Goldenrod}{ ███▏ }}}$ 12.7%, 36.44 KB
dist/lexical/plugins ${{\color{Goldenrod}{ ██▊ }}}$ 11.4%, 32.93 KB
dist/lexical/ui ${{\color{Goldenrod}{ ██▏ }}}$ 8.5%, 24.36 KB
dist/features/experimental_table ${{\color{Goldenrod}{ ██ }}}$ 8.2%, 23.66 KB
dist/packages/@lexical ${{\color{Goldenrod}{ █▋ }}}$ 6.9%, 19.80 KB
dist/features/link ${{\color{Goldenrod}{ █▋ }}}$ 6.5%, 18.62 KB
dist/features/toolbars ${{\color{Goldenrod}{ █▍ }}}$ 5.6%, 16.08 KB
dist/features/upload ${{\color{Goldenrod}{ █▏ }}}$ 4.8%, 13.92 KB
dist/features/textState ${{\color{Goldenrod}{ ▉ }}}$ 3.8%, 11.08 KB
dist/features/relationship ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 9.10 KB
dist/lexical/utils ${{\color{Goldenrod}{ ▊ }}}$ 3.1%, 8.79 KB
dist/features/converters ${{\color{Goldenrod}{ ▋ }}}$ 2.9%, 8.40 KB
dist/features/debug ${{\color{Goldenrod}{ ▋ }}}$ 2.6%, 7.40 KB
dist/utilities/fieldsDrawer ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 7.18 KB
dist/lexical/config ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 5.08 KB
dist/features/lists ${{\color{Goldenrod}{ ▍ }}}$ 1.7%, 5.03 KB
dist/features/format ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 3.46 KB
dist/lexical/LexicalEditor.js ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 3.23 KB
dist/field/Field.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 2.80 KB
dist/lexical/nodes ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 2.66 KB
(other) ${{\color{Goldenrod}{ █████████████████████▊ }}}$ 87.3%, 251.41 KB

Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████▏ }}}$ 48.5%, 579.15 KB
dist/elements/FolderView ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 29.60 KB
dist/elements/BulkUpload ${{\color{Goldenrod}{ ▌ }}}$ 2.4%, 28.53 KB
dist/views/Edit ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 21.17 KB
dist/providers/Auth ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 17.62 KB
dist/elements/WhereBuilder ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 17.36 KB
dist/forms/Form ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 16.05 KB
dist/elements/Table ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 15.80 KB
dist/fields/Relationship ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 15.79 KB
dist/fields/Upload ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 14.25 KB
dist/fields/Blocks ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 13.90 KB
dist/elements/QueryPresets ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 10.36 KB
dist/elements/PublishButton ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.59 KB
dist/providers/Folders ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.46 KB
dist/elements/HTMLDiff ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 8.38 KB
dist/views/CollectionFolder ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 7.83 KB
dist/fields/Array ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.73 KB
dist/views/List ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.36 KB
dist/elements/ReactSelect ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.33 KB
dist/elements/ListHeader ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 7.12 KB
(other) ${{\color{Goldenrod}{ ████████████▉ }}}$ 51.5%, 615.37 KB

Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js

Path Size
dist/graphics/Logo ${{\color{Goldenrod}{ █████ }}}$ 20.0%, 3.12 KB
../../node_modules ${{\color{Goldenrod}{ ████▎ }}}$ 17.0%, 2.65 KB
dist/graphics/Icon ${{\color{Goldenrod}{ ██▍ }}}$ 9.8%, 1.52 KB
dist/utilities/formatDocTitle ${{\color{Goldenrod}{ ██▏ }}}$ 8.5%, 1.32 KB
dist/providers/TableColumns ${{\color{Goldenrod}{ █▍ }}}$ 5.5%, 862 B
dist/utilities/groupNavItems.js ${{\color{Goldenrod}{ █▎ }}}$ 5.2%, 814 B
dist/utilities/getGlobalData.js ${{\color{Goldenrod}{ █▏ }}}$ 4.9%, 762 B
dist/utilities/api.js ${{\color{Goldenrod}{ █▏ }}}$ 4.8%, 756 B
dist/elements/Translation ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 493 B
dist/utilities/handleTakeOver.js ${{\color{Goldenrod}{ ▋ }}}$ 2.8%, 440 B
dist/utilities/traverseForLocalizedFields.js ${{\color{Goldenrod}{ ▋ }}}$ 2.6%, 399 B
dist/elements/withMergedProps ${{\color{Goldenrod}{ ▌ }}}$ 2.2%, 339 B
dist/utilities/getVisibleEntities.js ${{\color{Goldenrod}{ ▌ }}}$ 2.1%, 329 B
dist/utilities/getNavGroups.js ${{\color{Goldenrod}{ ▍ }}}$ 1.9%, 301 B
dist/elements/WithServerSideProps ${{\color{Goldenrod}{ ▍ }}}$ 1.5%, 232 B
dist/utilities/handleGoBack.js ${{\color{Goldenrod}{ ▎ }}}$ 1.2%, 180 B
dist/fields/mergeFieldStyles.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 159 B
dist/utilities/handleBackToDashboard.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 152 B
dist/forms/Form ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 147 B
dist/utilities/abortAndIgnore.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 146 B
(other) ${{\color{Goldenrod}{ ████████████████████ }}}$ 80.0%, 12.51 KB
Details

Next to the size is how much the size has increased or decreased compared with the base branch of this PR.

  • ‼️: Size increased by 20% or more. Special attention should be given to this.
  • ⚠️: Size increased in acceptable range (lower than 20%).
  • ✅: No change or even downsized.
  • 🗑️: The out file is deleted: not found in base branch.
  • 🆕: The out file is newly found: will be added to base branch.

@denolfe
denolfe marked this pull request as ready for review October 14, 2026 17:12
@denolfe
denolfe requested a review from AlessioGr as a code owner October 14, 2026 17:12

@DanRibbens DanRibbens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written with AI

Requesting changes for two release-path bugs: the local fallback skips most packages using their pre-bump versions, and the CI bump cannot recognize real non-fast-forward push errors to retry.

Validation: 122 existing releaser tests passed in an isolated PR snapshot, along with targeted reproductions of both findings. The Turbo publish-order test was excluded.

Comment thread tools/releaser/src/release.ts Resolved
Comment thread tools/releaser/src/release-bump.ts Resolved
DanRibbens
DanRibbens previously approved these changes Oct 15, 2026
@denolfe denolfe added the v3 label Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d1fe480-4277-4e27-b844-5cc8b89a2d89

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@GermanJablo GermanJablo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only observation for now: it's now easier to pick the wrong bump. The local script compared your choice with the bump the commits suggest and asked you to confirm if they differed. Now it's just a dropdown that defaults to patch. #18729 fixes this for main; maybe we should do something similar here.

@denolfe

denolfe commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

My only observation for now: it's now easier to pick the wrong bump.

@GermanJablo The process right now is to review the commits and choose the correct bump. I do think this would be a good improvement. I'll do a followup PR once your PR merges into main, so they stay consistent.

@DanRibbens DanRibbens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@denolfe
denolfe merged commit 6964415 into 3.x Oct 19, 2026
174 of 176 checks passed
@denolfe
denolfe deleted the ci/one-click-v3 branch October 19, 2026 14:39
denolfe added a commit that referenced this pull request Oct 19, 2026
…8796)

A `release-bump` dry run shows the release notes that the real release
will get, on the run summary page. This PR also ports the release-flow
fixes from the 3.x port
([#18717](#18717)) and removes
the local `pnpm release` script.

All packages require npm trusted publishing (OIDC: npm accepts a
short-lived token from the CI job in place of a stored secret). A local
publish cannot authenticate, so the CI flow is the only release path.

```diff
 dispatch release-bump (dry_run: true)
   compute next version
   log git commands
+  generate release notes for base..HEAD, labeled with the next version
+  write notes to the run summary page
 review notes
   wrong: fix in a follow-up PR, dry run again
   right: dispatch release-bump (dry_run: false)
```

```diff
 release-bump
-  push rejected by a race: fail
+  push rejected by a race: rebase and retry
 npm registry checks
-  1 attempt, no timeout
+  3 attempts, 15 s timeout each
 release-ci publish order
-  glob order (payload before translations)
+  packagePublishList order (translations before payload)
-pnpm release (local publish)
```

## Changes

- **Release notes preview on dry run**
- A dry run finds the changelog base tag. It generates notes for
`base..HEAD`, labeled with the next version.
- The notes go to the log and to `$GITHUB_STEP_SUMMARY` (the Markdown
job summary on the run page).
  - A missing base tag fails the dry run. A real run skips the preview.
- **Release notes generation**
- `generateReleaseNotes` takes an optional `releaseTag`. It sets the
version in the heading, compare link, and release URL.
- The `chore(release): vX` commit filter applies to every range. Before,
it applied to tag ranges only.
- **Publish order**
- `getPackageDetails` returns packages in `packagePublishList` order. CI
publishes `translations` before `payload`.
- **Bump push retry**
- Git commands in `release-bump` run through a new `runCommand` helper.
It keeps git's stderr in the thrown error.
- A rejected push matches the non-fast-forward check. The bump rebases
and pushes again.
- **Registry reads**
- `isVersionPublished` retries network errors, timeouts, 429, and 5xx
responses. It makes 3 attempts with a 15 s timeout each.
- **Local release script removed**
- `tools/releaser/src/release.ts`, both `release` scripts, and the
`prompts` dependencies are deleted.
- **Cleanups**
  - The publish retry is a loop with the same log output.
  - Type guards replace the `as` casts in the draft-release code.

## Design Decisions

- The preview uses the same base-tag lookup (`listReleaseTags` and
`findChangelogBaseTag`) and the same notes function as `release-ci`. For
the same commits, the preview has the same entries as the CI draft.
- Two things can differ: the date in the heading, and commits merged
after the dry run.
- `release-ci` keeps its `toVersion: <tag>` call, so the publish path
does not change.
- The dry run fails closed. If a dry run passes, CI can produce notes.

## Overall Flow

The dry run generates notes and writes the job summary. Before, it only
logged the git commands.

```mermaid
sequenceDiagram
    participant M as Maintainer
    participant B as release-bump
    participant N as npm registry
    participant G as GitHub
    M->>B: dispatch (dry_run: true)
    B->>B: compute next version
    B->>N: version published? (with retries)
    B->>B: find base tag, generate notes for base..HEAD
    B->>G: write job summary
    M->>B: dispatch (dry_run: false)
    B->>G: push release commit and tag (rebase retry)
    G->>G: tag starts publish-release (release-ci)
```

## References / Links

- [Adding a job
summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary):
how `$GITHUB_STEP_SUMMARY` renders Markdown on the run page.
- [npm trusted publishing](https://docs.npmjs.com/trusted-publishers):
OIDC publishing from CI.

🤖 Written with AI
GermanJablo added a commit that referenced this pull request Oct 20, 2026
…ide (#18729)

## Why

The bump is chosen by hand and nothing checks it. A `patch` for a
release with `feat:` commits ships without any warning.

## What

`bump` now defaults to `auto`, which is computed from the commits and is
always `prerelease` on a prerelease line. Any other bump fails before
touching git unless `override_reason` is filled in. The reason is
recorded as a notice on the run.

Needs porting to `3.x` once
[#18717](#18717) lands.

Related: PYLD-4162

Co-authored-by: German Jablonski <[email protected]>
denolfe added a commit that referenced this pull request Oct 26, 2026
Ports [#18796](#18796) from
main to 3.x. A `release-bump` dry run now shows the release notes that
the real release will get. It also removes the local `pnpm release`
fallback.

```diff
 .github/workflows/
 └── publish-release.yml          # drops the [skip ci] check
 tools/releaser/src/
 ├── release-bump.ts              # dry run previews notes
 ├── release-ci.ts                # uses listReleaseTags
-├── release.ts                   # local release fallback
 ├── lib/
+│   ├── listReleaseTags.ts       # lists v3.* tags
+│   ├── writeStepSummary.ts      # appends to the job summary
-│   └── publishLocalRelease.ts
 └── utils/
     └── generateReleaseNotes.ts  # optional releaseTag
```

v3.92.0 was the first 3.x release from CI. Its dry run showed only the
git commands. The notes first appeared in the draft GitHub release,
after the npm publish.

## Changes

- **Release notes preview on dry run**
- A dry run finds the changelog base tag. It generates notes for
`base..HEAD`, labeled with the next version.
- The notes go to the log and to `$GITHUB_STEP_SUMMARY` (the Markdown
job summary on the run page).
  - A missing base tag fails the dry run. A real run skips the preview.
- **Release notes generation**
- `generateReleaseNotes` takes an optional `releaseTag`. It sets the
version in the heading, compare link, and release URL.
- The `chore(release): vX` commit filter applies to every range. Before,
it applied to tag ranges only.
- **Shared tag listing**
- `release-bump` and `release-ci` list `v3.*` tags through one
`listReleaseTags` helper.
- **Local release path**
- Deletes `release.ts`, `publishLocalRelease`, both `release` scripts,
and the `prompts` dependencies.
- Drops the `[skip ci]` check from `publish-release`. The check only
stopped a second publish after a local release.

## Design Decisions

- **Preview only from #18796.** That PR also brought the 3.x hardening
fixes to main: publish order, push rebase retry, and registry retries.
3.x already has them from
[#18717](#18717).
- **Local fallback removed.** The `Release tags` ruleset lets only the
release bot create `v3.*` tags. A local `pnpm release` cannot push its
tag. Its printed resume steps also tell the maintainer to push one.
- **Same notes as CI.** The preview uses the same base-tag lookup and
notes function as `release-ci`. Only the heading date and commits merged
after the dry run can differ.

## Overall Flow

```diff
 release-bump --dry-run
   compute next version
   check next version is not on npm
+  find base tag (newest published v3 tag below the next version)
+  generate notes for base..HEAD, labeled with the next version
+  write notes to the log and the job summary
   log git commands, push nothing
```

## References / Links

- [Adding a job
summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary):
how `$GITHUB_STEP_SUMMARY` renders Markdown on the run page.

🤖 Written with AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants