deploy.sh 774 B

1234567891011121314151617181920212223
  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. curl --data "apikey=$DOWNLOAD_APIKEY" \
  15. --data "url=$url" \
  16. --data "size=$size" \
  17. --data "branch=$(git branch --show-current)" \
  18. --data "shasum=$shasum" \
  19. -L -s https://download.supertux.org/submit.php
  20. done