Merge pull request #6 from aboyett/calculate-checksums

build: generate checksums for build files
This commit is contained in:
Sean Cross 2019-08-25 00:15:22 +02:00 committed by GitHub
commit 54c7f5ffd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -18,6 +18,9 @@ deploy:
file:
- output/*.tar.gz
- output/*.zip
- output/*.sha1
- output/*.sha256
- output/*.sha512
file_glob: true
skip_cleanup: true
on:

View File

@ -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}"