Skip to content

Commit

Permalink
chore(travis): reproducible archives
Browse files Browse the repository at this point in the history
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
  • Loading branch information
terinjokes committed Jul 15, 2017
1 parent d5b1fc4 commit 1b14c5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: go
dist: trusty
sudo: false
go:
- 1.8.x
install:
Expand All @@ -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
Expand Down

0 comments on commit 1b14c5b

Please sign in to comment.