deploy.sh 791 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. shopt -s nullglob
  3. for file in upload/SuperTux*; do
  4. file_base=$(basename $file)
  5. echo "Uploading $file_base";
  6. url="https://supertux-ci-downloads.s3-us-west-2.amazonaws.com/${PREFIX}/$file_base"
  7. size=$(($(wc -c < "$file")))
  8. if [ $IS_WINDOWS = true ] ; then
  9. shasum=$(powershell -command "Get-FileHash \"$file\" -Algorithm SHA256 | Select-Object -ExpandProperty Hash")
  10. else
  11. shasum=$(shasum -a 256 "$file" | cut -d " " -f 1)
  12. fi
  13. echo "Checksum: $shasum";
  14. echo "Branch: $BRANCH_NAME";
  15. curl --data "apikey=$DOWNLOAD_APIKEY" \
  16. --data "url=$url" \
  17. --data "size=$size" \
  18. --data "branch=$BRANCH_NAME" \
  19. --data "shasum=$shasum" \
  20. -L -s https://download.supertux.org/submit.php
  21. done