Skip to content

feat: publish standalone CLI binaries with checksums on GitHub releases - #3374

Draft
RomanHotsiy wants to merge 1 commit into
mainfrom
feat/sea-product-runtime
Draft

RomanHotsiy wants to merge 1 commit into
mainfrom
feat/sea-product-runtime

Conversation

@RomanHotsiy

@RomanHotsiy RomanHotsiy commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

What/Why/How?

Redocly CLI needs Node.js and npm, and preview, eject, and translate spawn npx, so it can't run on a machine without them.
This PR attaches standalone binaries for Linux, macOS, and Windows, plus a SHA256SUMS file, to each @redocly/cli GitHub release.
In a binary, those three commands run their product package with bun x on the runtime built into the binary.

  • The binaries are compiled with Bun because it embeds both a runtime and a package installer, so a binary needs no npm next to it.
  • The CLI installed from npm still uses npx.
  • The binaries are uploaded after the npm publish, so a failed build can't block a release. The Binaries workflow can upload them again by hand for a given version.
  • The binaries are not signed with an Apple Developer ID or a Windows certificate. The installation page documents the macOS quarantine step.
  • The help output now always names the program redocly, because under Bun it would say bun. Four e2e snapshots change from index.js for this reason.

Measured on macOS arm64 with Bun 1.4.4 and Node 26, median of ten runs (preview: five rounds, same project and framework install):

Node 26 (npm install) Bun binary, single bundle Bun binary, --splitting (this PR)
Binary size — 118 MB 104 MB
--version 98 ms 177 ms 68 ms
lint resources/cafe.yaml 1.7 s 1.8 s 1.8 s
build-docs resources/cafe.yaml 1.8 s 2.0 s —
preview ready (first HTTP 200) 9.2 s 8.7 s —
preview hot reload 13 ms 6 ms —

build-docs and preview were not measured again on the split build. preview runs the framework in a child bun x process, so how the CLI is bundled doesn't affect it.
--bytecode cut --version to 47 ms but grew the binary to 149 MB, so this PR builds with --splitting only.
The first preview in a binary installs the framework with Bun's installer: about 20 s cold and 2 s cached on the earlier prototype.

Reference

Testing

Locally, unit, E2E, and a new binary smoke test on macOS arm64 and in an Alpine arm64 container. The Binaries workflow runs the smoke test for all eight binaries on each pull request.

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@RomanHotsiy RomanHotsiy self-assigned this Nov 5, 2026
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c2cb9cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@redocly/cli Minor
@redocly/openapi-core Minor
@redocly/recheck Minor
@redocly/respect-core Minor
@redocly/reunite-integration Minor
@redocly/client-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📝 Recheck Summary

⚠️ Warnings found • Scanned 2 changed file(s)

  • 0 error(s)
  • 2 warning(s)
  • 1 info

📋 Findings by rule

🟡 technical-english/sentence-length: 0 errors, 2 warnings, 0 info
🔵 technical-english/passive-voice: 0 errors, 0 warnings, 1 info

Errors fail the full-tree check. Warnings and info are a worklist and do not block the PR.

📖 Readability of changed files

Automated Readability Index (ARI): a U.S. grade level. Lower is easier to read.

File Base This PR Change
docs/@v2/commands/preview.md 5.8 6.1 🔴 +0.4 harder
docs/@v2/installation.md 10.0 8.3 🟢 -1.6 easier

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.65% (🎯 80%) 21956 / 26565
🔵 Statements 82.2% (🎯 80%) 23828 / 28987
🔵 Functions 84.42% (🎯 80%) 4259 / 5045
🔵 Branches 75.59% (🎯 75%) 16280 / 21535
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/commands/eject.ts 0% 0% 0% 0% 14-40
packages/cli/src/commands/translations.ts 0% 100% 0% 0% 12-27
packages/cli/src/commands/preview-project/index.ts 0% 0% 0% 0% 11-77
packages/cli/src/utils/notifier.ts 0% 0% 0% 0% 15-131
packages/cli/src/utils/platform.ts 100% 91.66% 100% 100%
Generated in workflow #13268 for commit c2cb9cd by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
latest ▓░░░░░░░░░░ 1.00x ± 0.01 ▓░░░░░░░░░░ 1.02x ± 0.01 ▓░░░░░░░░░░ 1.00x
next ▓░░░░░░░░░░ 1.00x ▓░░░░░░░░░░ 1.00x ▓░░░░░░░░░░ 1.02x ± 0.01

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