Skip to content

Commit

Permalink
feat: improve transfers handling
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
lgalabru committed Feb 12, 2024
2 parents 9da8b6b + 2a4ce1f commit 21ce9ca
Show file tree
Hide file tree
Showing 30 changed files with 1,268 additions and 892 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Expand Up @@ -109,6 +109,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./dockerfiles/components/ordhook.dockerfile
build-args: |
GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
Expand Down
101 changes: 95 additions & 6 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions components/ordhook-cli/Cargo.toml
Expand Up @@ -24,9 +24,11 @@ clap = { version = "3.2.23", features = ["derive"], optional = true }
clap_generate = { version = "3.0.3", optional = true }
toml = { version = "0.5.6", features = ["preserve_order"], optional = true }
ctrlc = { version = "3.2.2", optional = true }
tcmalloc2 = { version = "0.1.2+2.13", optional = true }

[features]
default = ["cli"]
cli = ["clap", "clap_generate", "toml", "ctrlc", "hiro-system-kit/log"]
debug = ["hiro-system-kit/debug"]
release = ["hiro-system-kit/release"]
tcmalloc = ["tcmalloc2"]
29 changes: 29 additions & 0 deletions components/ordhook-cli/build.rs
@@ -0,0 +1,29 @@
use std::process::Command;

fn current_git_hash() -> Option<String> {
if option_env!("GIT_COMMIT") == None {
let commit = Command::new("git")
.arg("log")
.arg("-1")
.arg("--pretty=format:%h") // Abbreviated commit hash
.current_dir(env!("CARGO_MANIFEST_DIR"))
.output();

if let Ok(commit) = commit {
if let Ok(commit) = String::from_utf8(commit.stdout) {
return Some(commit);
}
}
} else {
return option_env!("GIT_COMMIT").map(String::from);
}

None
}

fn main() {
// note: add error checking yourself.
if let Some(git) = current_git_hash() {
println!("cargo:rustc-env=GIT_COMMIT={}", git);
}
}

0 comments on commit 21ce9ca

Please sign in to comment.