Skip to content

Commit 9202a5d

Browse files
authored
feat: centralize SemVer versioning with nightly/stable pipeline support (#349)
Centralizes SemVer versioning so nightly and stable releases get proper version numbers, with all platform builds in the same pipeline run guaranteed to use the same version. ### Changes - Add `version`, `edition` to `[workspace.package]` in root `Cargo.toml` — single source of truth - All 26 sub-crates inherit via `version.workspace = true` - New `set-version.ps1` script: reads base version from `Cargo.toml`, optionally appends a pre-release suffix - Pre-release pipeline calls `./set-version.ps1 -Suffix "dev.$(Build.BuildId)"` — `Build.BuildId` is pipeline-scoped, ensuring all platform agents get the same version - Stable pipeline uses the version from `Cargo.toml` as-is (no script call needed) - Suffix parameter validated with `[ValidatePattern('^[a-zA-Z0-9._-]+$')]` to prevent TOML injection ### Usage ```powershell # Stable: explicit version bump (edit Cargo.toml, or use the script) ./set-version.ps1 -Version 1.0.0 # Nightly: auto-reads base version, appends deterministic suffix ./set-version.ps1 -Suffix "dev.$(Build.BuildId)" ``` Fixes #348
1 parent d5fcd19 commit 9202a5d

File tree

29 files changed

+158
-77
lines changed

29 files changed

+158
-77
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6+
version = "0.1.0"
7+
edition = "2021"
68
license = "MIT"
79

810
[profile.release]

azure-pipelines/pre-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ extends:
5252
preBuildSteps:
5353
- pwsh: Rename-Item -Path "./.cargo/config.toml.disabled" -NewName "config.toml"
5454
displayName: "Enable Azure Build config for Rust"
55+
- pwsh: ./set-version.ps1 -Suffix "dev.$(Build.BuildId)"
56+
displayName: "Set nightly version"

crates/pet-conda/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-conda"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-core"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-env-var-path/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-env-var-path"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-fs/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-fs"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-global-virtualenvs/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-global-virtualenvs"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-homebrew/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-homebrew"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-jsonrpc/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-jsonrpc"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

crates/pet-linux-global-python/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "pet-linux-global-python"
3-
version = "0.1.0"
4-
edition = "2021"
5-
license = "MIT"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
66

77
[target.'cfg(target_os = "windows")'.dependencies]
88
msvc_spectre_libs = { version = "0.1.1", features = ["error"] }

0 commit comments

Comments
 (0)