diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 4368b9c..39fd5d2 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -29,7 +29,7 @@ jobs: - name: Get short SHA id: short_sha - run: echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)" + run: echo "sha=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v6 diff --git a/Cargo.toml b/Cargo.toml index edcf267..5004059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,6 @@ version = "0.4.0-dev" edition = "2021" publish = false -build = "build.rs" - [dependencies] # Logging tracing-subscriber = { version = "0.3.18", features = ["env-filter", "chrono"] } diff --git a/Dockerfile b/Dockerfile index 3a12a18..425a7a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ ## Chef # FROM clux/muslrust:stable AS chef -FROM rust:1.81.0-alpine3.20 as chef +FROM rust:1.81.0-alpine3.20 AS chef USER root -RUN apk add musl-dev libressl-dev +RUN apk add --no-cache musl-dev libressl-dev RUN cargo install cargo-chef WORKDIR /build diff --git a/build.rs b/build.rs deleted file mode 100644 index 886e677..0000000 --- a/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -use std::process::Command; - -fn main() { - let output = match Command::new("git").args(&["rev-parse", "HEAD"]).output() { - Ok(d) => d, - Err(err) => { - eprintln!("Can't run git and get last commit due: {err:?}"); - println!("cargo:rustc-env=GIT_HASH=0000000000000000000000000000000000000000"); - return - } - }; - let mut git_hash = String::from_utf8(output.stdout).unwrap(); - if &git_hash == "HEAD" || git_hash.len() < 7 { - git_hash = String::from("0000000000000000000000000000000000000000"); - } - println!("cargo:rustc-env=GIT_HASH={}", git_hash); -} \ No newline at end of file diff --git a/src/consts.rs b/src/consts.rs index 1f4f170..05295ac 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -8,7 +8,6 @@ pub const AVATARS_ENV: &'static str = "AVATARS_FOLDER"; // Instance info pub const SCULPTOR_VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub const REPOSITORY: &'static str = "shiroyashik/sculptor"; -pub const GIT_HASH: &'static str = env!("GIT_HASH", "Can't run git or build.rs failing!"); // reqwest parameters pub const USER_AGENT: &'static str = "reqwest"; diff --git a/src/main.rs b/src/main.rs index 2f0682d..cdbe789 100644 --- a/src/main.rs +++ b/src/main.rs @@ -108,7 +108,7 @@ async fn main() -> Result<()> { })); // 3. Display info about current instance and check updates - tracing::info!("The Sculptor v{SCULPTOR_VERSION}+{} ({REPOSITORY})", &GIT_HASH[..7]); + tracing::info!("The Sculptor v{SCULPTOR_VERSION} ({REPOSITORY})"); // let _ = check_updates(REPOSITORY, SCULPTOR_VERSION).await; // Currently, there is no need to do anything with the result of the function match get_latest_version(REPOSITORY).await {