Skip to content

refactor(ci): extract preview release into separate workflow and fix native binary cache#682

Merged
theoephraim merged 7 commits into
mainfrom
fix/ci-native-binary-cache
May 1, 2026
Merged

refactor(ci): extract preview release into separate workflow and fix native binary cache#682
theoephraim merged 7 commits into
mainfrom
fix/ci-native-binary-cache

Conversation

@theoephraim

@theoephraim theoephraim commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Extract preview release from test.yaml into its own release-preview.yaml workflow, triggered by workflow_run after the CI test suite passes
  • Simplify test.yaml — now just lint, typecheck, build, and test (no more native binary builds or preview publishing)
  • Fix native binary cache keys — normalize Rust source hash across OSes, add cache-miss fallbacks
  • Preview workflow warns instead of failing hard when native binary caches are cold

Motivation

The preview release logic was coupled into the test workflow, which meant:

  • Tests were gated on native binary builds even when they weren't needed
  • Cache misses for native binaries caused CI failures on unrelated PRs
  • The test workflow was slow and complex

Now the test workflow runs fast and focused. Preview releases happen in a separate workflow that only runs after tests pass.

Test plan

  • test.yaml should pass on PRs without needing native binaries
  • release-preview.yaml triggers after test suite completes on PRs
  • Preview packages publish correctly from cache

The hashFiles glob `swift/**` included .build/ artifacts on macOS runners,
producing a different hash than clean Ubuntu checkouts — so cache restores
never matched. Narrowed to Package.swift + Sources/** to stabilize the key.

Also: trigger native builds when their workflow YAML changes, fall back to
building when the cache misses (instead of failing), and use
needs.*.result to decide artifact-vs-cache in release-preview.
hashFiles produces different results on Windows vs Linux, so Rust binary
caches saved from Windows runners couldn't be restored on Ubuntu. Fix by:
- Computing the Rust source hash once on Ubuntu and passing it to the
  build-native-rust workflow as an input for cache key consistency
- Checking all 3 platform caches (linux-x64, linux-arm64, win32-x64)
  before deciding whether to skip the Rust build
- Using the pre-computed hash for cache restores in release-preview
Comment thread .github/workflows/release-preview.yaml Fixed
Comment thread .github/workflows/release-preview.yaml Fixed
Comment thread .github/workflows/release-preview.yaml Fixed
Comment thread .github/workflows/release-preview.yaml Fixed
@theoephraim theoephraim changed the title fix(ci): fix native binary cache key and add fallbacks refactor(ci): extract preview release into separate workflow and fix native binary cache May 1, 2026
Comment thread .github/workflows/release-preview.yaml Fixed
@theoephraim theoephraim force-pushed the fix/ci-native-binary-cache branch from 9a26eb7 to d26a6cd Compare May 1, 2026 06:56
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
varlock-docs-mcp d26a6cd May 01 2026, 06:56 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website d26a6cd Commit Preview URL

Branch Preview URL
May 01 2026, 06:58 AM

Move check-release-packages into build-and-test job and use its output
to skip all native binary checks/builds when varlock is not part of
the preview release. This avoids expensive macOS/Rust builds on PRs
that only change integrations or other packages.
Instead of manually diffing files and mapping them to packages, use
bumpy's `inCurrentBranch` flag to determine which packages are being
bumped in this PR. This correctly handles bump files (which live at
the repo root, not inside package dirs) and avoids publishing previews
for packages with pending bumps already on main.
@pkg-pr-new

pkg-pr-new Bot commented May 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/varlock@682

commit: 9aa7d1c

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

bumpy-frog

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

patch Patch releases

  • varlock 1.0.0 → 1.0.1

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim merged commit dec2fc0 into main May 1, 2026
24 checks passed
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.

2 participants