Skip to content

Commit

Permalink
have travis generate sha512sums after goreleaser produces archives
Browse files Browse the repository at this point in the history
  • Loading branch information
Jef Spaleta committed Nov 28, 2018
1 parent eb7a467 commit 802b572
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ builds:
- goos: linux
goarch: mips64le

checksum:
# You can change the name of the checksums file.
# Default is `{{ .ProjectName }}_{{ .Version }}_checksums.txt`.
name_template: "{{ .ProjectName }}_{{ .Version }}_sha256-checksums.txt"

archive:
format: tar.gz
files:
Expand Down
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ before_deploy:
- go get github.com/goreleaser/goreleaser
deploy:
skip_cleanup: true
provider: script
script: goreleaser
on:
tags: true
- #goreleaser
provider: script
script: goreleaser
on:
tags: true
- #checksum
provider: script
script: travis/generate-sha512sum.sh
on:
tags: true

env:
global:
secure: AAAAB3NzaC1yc2EAAAADAQABAAACAQDd8VD1c3Mno+WzqOC/4a59ersotUdAqOsQCdql8eVDlv49PWkFEUh/cKVmhnooGO68O+Qt3dcP7uqEo2DZtgxfTshd0JpT/IV6KLGqJbg8VWIbikY4AIlNZEov4PDjvGsyRogYfxbx5F71pr5TiYbvkyN4qYDZKJMmqfD1VcA5FYXrLg18SR3fuly+thfIQtD8yv9rHTMfk9KfcwoNbyLgmU28U6ZUHm0tz6x+UN9LT39oCSZAp3MvyLZvEmFZhyzSnfylhTzICi05F1gpPzD0CAvLHbtPGse7igXu1fupNEuM9f01g+uY/gsHNuxcgL026RcMd5EYvbr0F8chVrrZRTc7Emgd2QSqVGWZb0jVnIAF09FsIzHgt2nSQRkkEhNP80skOiDi3VthQ8b4XWO4hJ4bTm1C6DQGUN80Y8xtlNFYpHBA7GNV+zwIoTOGSb0vKP/786cVHx2E+hYZkP+03QXdv0zyeXevCS6s4TSKGyHv9apRg+6JZ1nGm6f1MPHB5OLEf582xi5RAkKtFGpKxDHyTv1KhcySzgOvbQTW488O2jPMUuTHAevp6HQvyOFe2OMYIyhu1xMK5rTBKzRMwMG8WH8Yf+9WqBJf2mmgqPuAX16KyXao9x/iyaFD9VnVyINqxxCO+LiTFGPvOU6uUNGm3Tm+HznOo7s13ueVEQ==
14 changes: 14 additions & 0 deletions travis/generate-sha512sum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash


if [ -d dist ]; then
files=( dist/*sha256-checksums.txt )
file=`basename ${files[0]}`
IFS=\_ read -r package prefix x <<< $file
if [ -n "$prefix" ]; then
echo "Generating sha512sum for ${package}_${prefix}"
cd dist
sha512sum *.tar.gz > "${package}_${prefix}_sha512-checksum.txt"
cat "${package}_${prefix}_sha512-checksum.txt"
fi
fi

0 comments on commit 802b572

Please sign in to comment.