Skip to content

feat(cli): embed release version via build.rs instead of CI string replacement#989

Open
Nobody9512 wants to merge 2 commits intovoidzero-dev:mainfrom
Nobody9512:feat/embed-release-version
Open

feat(cli): embed release version via build.rs instead of CI string replacement#989
Nobody9512 wants to merge 2 commits intovoidzero-dev:mainfrom
Nobody9512:feat/embed-release-version

Conversation

@Nobody9512
Copy link

Summary

  • Add build.rs to vite_global_cli that resolves the version at compile time through a 3-layer fallback: VITE_PLUS_VERSION env var → git describe --tagsCARGO_PKG_VERSION
  • Replace env!("CARGO_PKG_VERSION") with env!("VITE_PLUS_VERSION") in the 3 call sites within vite_global_cli
  • Update CI release workflow to pass VITE_PLUS_VERSION env var and remove the now-unnecessary string replacement for vite_global_cli/Cargo.toml

This allows distro packagers (Nix, Homebrew, AUR) to build from source with the correct version by setting VITE_PLUS_VERSION=x.y.z, and local dev builds in a git checkout will automatically pick up the version from git tags instead of showing vp v0.0.0.

Closes #976

@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 787cb19
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69bab57ee1578800089bd05a

@fengmk2 fengmk2 requested review from Boshen and Brooooooklyn March 17, 2026 09:17
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.

Embed release version in source instead of relying on CI string replacement

1 participant