Skip to content

Commit

Permalink
feat: for nightly binaries check version based on date
Browse files Browse the repository at this point in the history
  • Loading branch information
loispostula committed Jul 5, 2024
1 parent 2277a60 commit f5d6d50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-fslabscli"
version = "1.5.1"
version = "1.6.0"
edition = "2021"
authors = ["FSLABS DevOps Gods"]
repository = "https://github.com/ForesightMiningSoftwareCorporation/fslabsci"
Expand Down Expand Up @@ -41,6 +41,7 @@ ignore = "0.4.22"
object_store = { version = "0.9.1", features = ["azure"]}
toml = "0.8.12"
convert_case = "0.6.0"
chrono = "0.4"
[dev-dependencies]
assert_fs = "1.1.1"
testcontainers = "0.15"
Expand Down
17 changes: 15 additions & 2 deletions src/commands/check_workspace/binary.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use chrono::prelude::*;
use indexmap::IndexMap;
use object_store::{
azure::{MicrosoftAzure, MicrosoftAzureBuilder},
Expand Down Expand Up @@ -99,9 +100,21 @@ impl PackageMetadataFslabsCiPublishBinary {
let Some(object_store) = store else {
return Ok(());
};
// Nightly version should be current date

let rc_version = match release_channel.as_ref() {
"nightly" => {
if name.ends_with("_launcher") {
version.clone()
} else {
Utc::now().date_naive().to_string()
}
}
_ => version.clone(),
};
log::debug!(
"BINARY: checking if version {} of {} already exists {:?}",
version,
rc_version,
name,
self
);
Expand All @@ -113,7 +126,7 @@ impl PackageMetadataFslabsCiPublishBinary {
};
let blob_path = Path::from(format!(
"{}/{}/{}-{}-{}-v{}{}",
name, release_channel, name, target, toolchain, version, extension
name, release_channel, name, target, toolchain, rc_version, extension
));
match object_store.get_client().head(&blob_path).await {
Ok(_) => {}
Expand Down

0 comments on commit f5d6d50

Please sign in to comment.