sum.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # shasum blows up in Azure, so using this
  3. # node package which has similar syntax and identical output
  4. if [[ "$CI_WINDOWS" == "True" ]]; then
  5. npm i -g checksum
  6. fi
  7. sum_file () {
  8. if [[ -f "$1" ]]; then
  9. if [[ "$CI_WINDOWS" == "True" ]]; then
  10. checksum -a sha256 "$1" > "$1".sha256
  11. checksum -a sha1 "$1" > "$1".sha1
  12. else
  13. shasum -a 256 "$1" > "$1".sha256
  14. shasum "$1" > "$1".sha1
  15. fi
  16. fi
  17. }
  18. if [[ "$SHOULD_BUILD" == "yes" ]]; then
  19. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  20. sum_file VSCodium-darwin-*.zip
  21. sum_file VSCodium*.dmg
  22. elif [[ "$CI_WINDOWS" == "True" ]]; then
  23. sum_file VSCodiumSetup-*.exe
  24. sum_file VSCodiumUserSetup-*.exe
  25. sum_file VSCodium-win32-*.zip
  26. else # linux
  27. if [[ "$BUILDARCH" == "x64" ]]; then
  28. deb_arch=amd64
  29. rpm_arch=x86_64
  30. # app image is x64 only
  31. sum_file vscode/out/*.AppImage
  32. cp vscode/out/*.{sha256,sha1} .
  33. elif [[ "$BUILDARCH" == "ia32" ]]; then
  34. deb_arch=i386
  35. rpm_arch=i386
  36. fi
  37. sum_file VSCodium-linux*.tar.gz
  38. sum_file vscode/.build/linux/deb/${deb_arch}/deb/*.deb
  39. sum_file vscode/.build/linux/rpm/${rpm_arch}/*.rpm
  40. cp vscode/.build/linux/deb/${deb_arch}/deb/*.{sha256,sha1} .
  41. cp vscode/.build/linux/rpm/${rpm_arch}/*.{sha256,sha1} .
  42. fi
  43. fi