Skip to content

Conversation

@mendral-app
Copy link
Contributor

@mendral-app mendral-app bot commented Dec 8, 2025

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:

  • build-python-release: Added Rust dependency caching using Swatinem/rust-cache@v2 and enabled uv caching for Python dependencies
  • build-cli-release: Enabled Rust caching (was previously disabled with enable-cache: false)
  • build-typescript-release: Improved cache key specificity with target-specific prefixes (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-version job 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:

  • Updated regex to match both X.Y.Z and vX.Y.Z formats: ^v?[0-9]+\.[0-9]+\.[0-9]+$
  • Strips v prefix from version string for consistency across artifacts
  • Ensures is_release_tag is set correctly for both tag formats

Impact: Publish jobs will now run correctly for both 0.2xx.0 and v0.2xx.0 tags, 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 caching

Testing Plan

  1. Caching: Monitor build times on subsequent workflow runs to verify cache effectiveness
  2. Tag Handling: Test with both tag formats:
    • Push v0.xxx.0 tag → verify is_release_tag=true and publish jobs run
    • Push 0.xxx.0 tag → verify is_release_tag=true and publish jobs run

Performance Baseline

From run https://github.com/BoundaryML/baml/actions/runs/19959566319:

  • build-cli (macOS aarch64): 41.3 minutes
  • build-typescript-release (Windows x64): 40.9 minutes
  • build-python-release (Linux aarch64): 22.8 minutes

After cache warmup, these should drop significantly (target: 15-25 minutes for slowest jobs).

This commit addresses two major issues in the release workflow:

1. **Slow Build Times (40+ minutes)**
   - Added Rust caching to build-python-release workflow using Swatinem/rust-cache
   - Enabled Rust caching in build-cli-release workflow (was disabled)
   - Improved cache keys for build-typescript-release with target-specific prefixes
   - Added uv caching for Python dependency management
   - Expected improvement: 30-50% reduction in build times after cache warmup

2. **v-Prefixed Tag Handling**
   - Fixed determine-version job to recognize both X.Y.Z and vX.Y.Z tag formats
   - Strips 'v' prefix from version string for consistency
   - Ensures publish jobs run correctly for both tag formats (required for Go modules)
   - Resolves upload step failures on v0.2xx.0 tags

Changes:
- .github/workflows/release.yml: Updated tag regex to match v?[0-9]+\.[0-9]+\.[0-9]+
- .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 caching
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
promptfiddle Error Error Dec 8, 2025 5:00pm


# Setup Rust with caching for faster builds
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'BAML Release - Build Python' step
Uses Step
uses 'dtolnay/rust-toolchain' with ref 'master', not a pinned commit hash
targets: ${{ matrix._.target }}

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'BAML Release - Build Python' step
Uses Step
uses 'Swatinem/rust-cache' with ref 'v2', not a pinned commit hash
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