mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 16:50:47 +08:00
http: Update env vars for build process
Use the standard `SOURCE_DATE_EPOCH` instead of `GIT_COMMIT_TIME`. Set `GIT_HEAD` properly.
This commit is contained in:
@@ -27,8 +27,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
"pre-release".to_owned()
|
||||
};
|
||||
|
||||
// Set a build-time `GIT_COMMIT_TIME` env var which includes the commit time.
|
||||
let commit_time = env::var("GIT_COMMIT_TIME").unwrap_or_else(|_| {
|
||||
// Set a build-time `SOURCE_DATE_EPOCH` env var which includes the commit time.
|
||||
let commit_time = env::var("SOURCE_DATE_EPOCH").unwrap_or_else(|_| {
|
||||
Command::new("git")
|
||||
.arg("log")
|
||||
.arg("-1")
|
||||
@@ -47,7 +47,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
});
|
||||
|
||||
println!("cargo::rustc-env=RADICLE_VERSION={version}");
|
||||
println!("cargo::rustc-env=GIT_COMMIT_TIME={commit_time}");
|
||||
println!("cargo::rustc-env=SOURCE_DATE_EPOCH={commit_time}");
|
||||
println!("cargo::rustc-env=GIT_HEAD={hash}");
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -8,6 +8,7 @@ ARG TZ
|
||||
ARG LC_ALL
|
||||
ARG SOURCE_DATE_EPOCH
|
||||
ARG RADICLE_VERSION
|
||||
ARG GIT_HEAD
|
||||
|
||||
# Copy cargo configuration we're going to use to specify compiler options.
|
||||
RUN mkdir -p .cargo && cp build/config.toml .cargo/config.toml
|
||||
|
||||
@@ -53,6 +53,7 @@ main() {
|
||||
--build-arg TZ \
|
||||
--build-arg LC_ALL \
|
||||
--build-arg RADICLE_VERSION=$version \
|
||||
--build-arg GIT_HEAD=$rev \
|
||||
--arch aarch64 --tag $image -f ./build/Dockerfile - <$gitarchive
|
||||
|
||||
echo "Creating container (radicle-build-container).."
|
||||
|
||||
Reference in New Issue
Block a user