Optimize release workflow: add caching and fix v-prefixed tag handling #2783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the two major issues with the release workflow identified in https://github.com/BoundaryML/baml/actions/runs/19959566319:
1. Slow Build Times 🚀
The release workflow was taking 40+ minutes due to missing or misconfigured caching:
Swatinem/rust-cache@v2and enabled uv caching for Python dependenciesenable-cache: false)v6-rust-ts-${{ matrix._.target }})Expected Impact: 30-50% reduction in build times after initial cache warmup. Subsequent builds should see significant speedups in dependency compilation.
2. v-Prefixed Tag Handling 🏷️
The
determine-versionjob only recognized tags matching^[0-9]+\.[0-9]+\.[0-9]+$(e.g.,0.214.0), causing publish jobs to be skipped for v-prefixed tags (e.g.,v0.214.0) required by Go modules:X.Y.ZandvX.Y.Zformats:^v?[0-9]+\.[0-9]+\.[0-9]+$vprefix from version string for consistency across artifactsis_release_tagis set correctly for both tag formatsImpact: Publish jobs will now run correctly for both
0.2xx.0andv0.2xx.0tags, eliminating upload step failures.Changes
.github/workflows/release.yml: Updated tag regex and version extraction logic.github/workflows/build-python-release.reusable.yaml: Added Rust and uv caching.github/workflows/build-typescript-release.reusable.yaml: Improved cache key specificity.github/workflows/build-cli-release.reusable.yaml: Enabled Rust cachingTesting Plan
v0.xxx.0tag → verifyis_release_tag=trueand publish jobs run0.xxx.0tag → verifyis_release_tag=trueand publish jobs runPerformance Baseline
From run https://github.com/BoundaryML/baml/actions/runs/19959566319:
build-cli(macOS aarch64): 41.3 minutesbuild-typescript-release(Windows x64): 40.9 minutesbuild-python-release(Linux aarch64): 22.8 minutesAfter cache warmup, these should drop significantly (target: 15-25 minutes for slowest jobs).