diff --git a/.travis.yml b/.travis.yml index c37675d..4a8aab2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ deploy: file: - output/*.tar.gz - output/*.zip + - output/*.sha1 + - output/*.sha256 + - output/*.sha512 file_glob: true skip_cleanup: true on: diff --git a/build.sh b/build.sh index fb63879..c34e0ae 100755 --- a/build.sh +++ b/build.sh @@ -23,12 +23,27 @@ base="$(pwd)" output_name="fomu-toolchain-${ARCH}-${TRAVIS_TAG}" output="${base}/output/${output_name}" input="${base}/input" + mkdir -p $output mkdir -p $input mkdir -p $output/bin echo "${TRAVIS_TAG}" > $output/VERSION +checksum_output() { + set +x + hashes="sha1 sha256 sha512" + local outfile hashfile + outfile=$output$1 + + for hash in $hashes ; do + hashfile=$outfile.$hash + ${hash}sum $outfile > $hashfile + echo -n "$hash: " ; cat $hashfile + done + set -x +} + case "${ARCH}" in "windows") # Python 3.7.3 (which matches the version in nextpnr) @@ -76,6 +91,7 @@ case "${ARCH}" in cd $base/output zip -r $output_name.zip $output_name + checksum_output .zip ;; "macos") @@ -108,6 +124,7 @@ case "${ARCH}" in cd $base/output zip -r $output_name.zip $output_name + checksum_output .zip ;; "linux_x86_64") @@ -140,6 +157,7 @@ case "${ARCH}" in cd $base/output tar cvzf $output_name.tar.gz $output_name + checksum_output .tar.gz ;; *) echo "Unrecognized architecture: ${ARCH}"