From 1b14c5b909dc42f7c104d07b5eb7d82f6b1b2615 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Fri, 14 Jul 2017 23:48:55 -0600 Subject: chore(travis): reproducible archives Ensure the tar archives are reproducible across builds on Travis, based on the instructions from reproducible-builds.org[0]. Unfortunately, Go's tooling seems to include metadata from $GOROOT and $GOPATH into the resulting binaries, so care must be taken in setting up the build tool chain. Rebuilds in Travis, and those configured similarly, do result in the same archive. [0]: https://archive.is/CjjIl --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 48a19e9..450a0de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: go +dist: trusty +sudo: false go: - 1.8.x install: @@ -12,9 +14,10 @@ jobs: - stage: Build and Deploy go: 1.8.x script: + - export SOURCE_DATE_EPOCH=$(git show -s --format=%ci ${TRAVIS_TAG:-${TRAVIS_COMMIT}}) - go build github.com/terinjokes/bakelite - "./bakelite github.com/terinjokes/bakelite" - - for i in bakelite-*; do tar -czf $i.tar.gz $i; done + - for i in bakelite-*; do tar --mtime="${SOURCE_DATE_EPOCH}" --owner=0 --group=0 --numeric-owner -c $i | gzip -n - > $i.tar.gz; done - shasum -a 512 bakelite-*.tar.gz | tee sha512sum.txt deploy: provider: releases -- cgit v1.2.3