-
Notifications
You must be signed in to change notification settings - Fork 1
automatically set release version #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,8 @@ env: | |
| jobs: | ||
| release: | ||
| name: Release - ${{ matrix.platform.os_name }} | ||
| env: | ||
| COMAN_RELEASE_VERSION: ${{ github.event.release.tag_name }} | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
|
|
@@ -53,6 +55,8 @@ jobs: | |
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Strip version leading v | ||
| run: echo "COMAN_RELEASE_VERSION=${COMAN_RELEASE_VERSION##v}" >> $GITHUB_ENV | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The command to strip 'v' prefix might fail if tag_name is empty or malformed. #ai-review-inline |
||
| - name: Install toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| [package] | ||
| name = "coman" | ||
| version = "0.8.9" | ||
| edition = "2024" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version field was removed, ensure this is intentional and that versioning is handled elsewhere. #ai-review-inline |
||
| description = "Compute Manager for managing HPC compute" | ||
| authors = ["Ralf Grubenmann <ralf.grubenmann@sdsc.ethz.ch>"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,10 @@ use anyhow::Result; | |||||||||||||
| use vergen_gix::{BuildBuilder, CargoBuilder, Emitter, GixBuilder}; | ||||||||||||||
|
|
||||||||||||||
| fn main() -> Result<()> { | ||||||||||||||
| if let Ok(val) = std::env::var("COMAN_RELEASE_VERSION") { | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding error handling for the environment variable parsing to avoid unexpected behavior if the variable is not a valid string.
Suggested change
#ai-review-inline |
||||||||||||||
| println!("cargo:rustc-env=CARGO_PKG_VERSION={}", val); | ||||||||||||||
| } | ||||||||||||||
| println!("cargo:rerun-if-env-changed=COMAN_RELEASE_VERSION"); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rerun-if-env-changed instruction should be placed before any conditional logic to ensure proper dependency tracking.
Suggested change
#ai-review-inline |
||||||||||||||
| let build = BuildBuilder::all_build()?; | ||||||||||||||
| let gix = GixBuilder::all_git()?; | ||||||||||||||
| let cargo = CargoBuilder::all_cargo()?; | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -485,14 +485,7 @@ pub enum CscsSystemCommands { | |||||
|
|
||||||
| pub const COMAN_VERSION: &str = env!("CARGO_PKG_VERSION"); | ||||||
|
|
||||||
| const VERSION_MESSAGE: &str = concat!( | ||||||
| env!("CARGO_PKG_VERSION"), | ||||||
| "-", | ||||||
| env!("VERGEN_GIT_DESCRIBE"), | ||||||
| " (", | ||||||
| env!("VERGEN_BUILD_DATE"), | ||||||
| ")" | ||||||
| ); | ||||||
| const VERSION_MESSAGE: &str = concat!(env!("CARGO_PKG_VERSION"), " (", env!("VERGEN_BUILD_DATE"), ")"); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The VERSION_MESSAGE now omits the git describe information which might reduce debuggability.
Suggested change
#ai-review-inline |
||||||
|
|
||||||
| pub fn version() -> String { | ||||||
| // let current_exe_path = PathBuf::from(clap::crate_name!()).display().to_string(); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable COMAN_RELEASE_VERSION is set but may not be used elsewhere in the workflow.
#ai-review-inline