Skip to content

Commit

Permalink
Add SOURCE_DATE_EPOCH and TAR_OPTIONS for reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Dec 4, 2024
1 parent 63c8992 commit e17d90c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ create_dir() {
test -d "$1" || mkdir "$1"
}

# Determine the reference time used for determinism (overridable by environment)
export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name"

# We'll use a folder for the builds output and another one for the final assets.
RELEASE_DIR="$PWD/release_assets"
BUILD_DIR="$PWD/release_build"
Expand Down

0 comments on commit e17d90c

Please sign in to comment.