Skip to content

Centralize SemVer versioning with nightly/stable pipeline support #348

@karthiknadig

Description

@karthiknadig

Problem

The version is hardcoded as 0.1.0 independently in each of the 26 sub-crate Cargo.toml files. There's no single place to set the version, and the CI pipelines don't stamp versions before building. This makes it impossible to distinguish nightly from stable builds, and version bumps require editing 26+ files.

Solution

  1. Centralize version in workspace Cargo.toml under [workspace.package]
  2. All sub-crates inherit via version.workspace = true
  3. Add a set-version.ps1 script that pipelines call in preBuildSteps
  4. Use $(Build.BuildId) as the nightly suffix to guarantee all platform builds in the same pipeline run get an identical version

Usage

# Stable release
./set-version.ps1 -Version 1.0.0

# Nightly (all platforms get same version via Build.BuildId)
./set-version.ps1 -Version 1.0.0 -Suffix "dev.$(Build.BuildId)"

Affected Files

  • Root Cargo.toml — add version, edition to [workspace.package]
  • All 26 crates/*/Cargo.toml — switch to version.workspace = true
  • New set-version.ps1 script
  • azure-pipelines/pre-release.yml and stable.yml — add version step to preBuildSteps

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions