Compare commits

...

3 Commits

Author SHA1 Message Date
Bernhard M. Wiedemann
c354736392
Merge 54a7a5069c into 696110eae5 2024-10-26 12:04:51 +02:00
Adam Perkowski
696110eae5
refact(release): better categories (#876) 2024-10-25 15:44:41 -05:00
Bernhard M. Wiedemann
54a7a5069c
Allow to override build date with SOURCE_DATE_EPOCH
to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also use UTC to be independent of timezone.
2024-10-24 09:32:18 +02:00
2 changed files with 19 additions and 9 deletions

19
.github/release.yml vendored
View File

@ -1,20 +1,23 @@
changelog: changelog:
categories: categories:
- title: '🚀 Features' - title: '🚀 Features'
labels: label: 'enhancement'
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes' - title: '🐛 Bug Fixes'
labels: label: 'bug'
- 'fix' - title: '⚙️ Refactoring'
- 'bugfix' label: 'refactor'
- 'bug' - title: '🧩 UI/UX'
label: 'UI/UX'
- title: '📚 Documentation' - title: '📚 Documentation'
label: 'documentation' label: 'documentation'
- title: '🔒 Security' - title: '🔒 Security'
label: 'security' label: 'security'
- title: '🧰 GitHub Actions' - title: '🧰 GitHub Actions'
label: 'github actions' label: 'github_actions'
- title: '🦀 Rust'
label: 'rust'
- title: '📃 Scripting'
label: 'script'
exclude: exclude:
labels: labels:
- 'skip-changelog' - 'skip-changelog'

View File

@ -1,7 +1,14 @@
use chrono::{TimeZone, Utc};
use std::env;
fn main() { fn main() {
// Add current date as a variable to be displayed in the 'Linux Toolbox' text. // Add current date as a variable to be displayed in the 'Linux Toolbox' text.
let now = match env::var("SOURCE_DATE_EPOCH") {
Ok(val) => { Utc.timestamp_opt(val.parse::<i64>().unwrap(), 0).unwrap() }
Err(_) => Utc::now(),
};
println!( println!(
"cargo:rustc-env=BUILD_DATE={}", "cargo:rustc-env=BUILD_DATE={}",
chrono::Local::now().format("%Y-%m-%d") now.format("%Y-%m-%d")
); );
} }