Log Zed build sha in release builds.
Also ensure that curl commands for nightly uploads return 200 (fail otherwise).
This commit is contained in:
parent
1c850f495c
commit
0dc02b8354
2 changed files with 15 additions and 5 deletions
|
@ -27,10 +27,20 @@ fn main() {
|
||||||
// Populate git sha environment variable if git is available
|
// Populate git sha environment variable if git is available
|
||||||
if let Ok(output) = Command::new("git").args(["rev-parse", "HEAD"]).output() {
|
if let Ok(output) = Command::new("git").args(["rev-parse", "HEAD"]).output() {
|
||||||
if output.status.success() {
|
if output.status.success() {
|
||||||
println!(
|
let git_sha = String::from_utf8_lossy(&output.stdout);
|
||||||
"cargo:rustc-env=ZED_COMMIT_SHA={}",
|
let git_sha = git_sha.trim();
|
||||||
String::from_utf8_lossy(&output.stdout).trim()
|
|
||||||
);
|
println!("cargo:rustc-env=ZED_COMMIT_SHA={git_sha}");
|
||||||
|
|
||||||
|
if let Ok(build_profile) = std::env::var("PROFILE") {
|
||||||
|
if build_profile == "release" {
|
||||||
|
// This is currently the best way to make `cargo build ...`'s build script
|
||||||
|
// to print something to stdout without extra verbosity.
|
||||||
|
println!(
|
||||||
|
"cargo:warning=Info: using '{git_sha}' hash for ZED_COMMIT_SHA env var"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ function uploadToSpaces
|
||||||
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${SPACE}/${space_path}/${file_name}"
|
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${SPACE}/${space_path}/${file_name}"
|
||||||
signature=$(echo -en "${string}" | openssl sha1 -hmac "${DIGITALOCEAN_SPACES_SECRET_KEY}" -binary | base64)
|
signature=$(echo -en "${string}" | openssl sha1 -hmac "${DIGITALOCEAN_SPACES_SECRET_KEY}" -binary | base64)
|
||||||
|
|
||||||
curl -vv -s -X PUT -T "$file_to_upload" \
|
curl --fail -vv -s -X PUT -T "$file_to_upload" \
|
||||||
-H "Host: ${SPACE}.${REGION}.digitaloceanspaces.com" \
|
-H "Host: ${SPACE}.${REGION}.digitaloceanspaces.com" \
|
||||||
-H "Date: $date" \
|
-H "Date: $date" \
|
||||||
-H "Content-Type: $content_type" \
|
-H "Content-Type: $content_type" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue