sentry_upload 556 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. set -e
  3. echo "BRANCH_NAME=$BRANCH_NAME"
  4. echo "SENTRY_RELEASE=$SENTRY_RELEASE"
  5. if [[ "$BRANCH_NAME" == "main" ]]; then
  6. rm -rf sentry_upload
  7. mkdir sentry_upload
  8. tar --directory sentry_upload -xf build.tar
  9. cd sentry_upload/public
  10. sentry-cli releases new "$SENTRY_RELEASE"
  11. sentry-cli releases set-commits --auto "$SENTRY_RELEASE"
  12. sentry-cli sourcemaps upload --release="$SENTRY_RELEASE" .
  13. sentry-cli releases finalize "$SENTRY_RELEASE"
  14. cd ../..
  15. rm -rf sentry_upload
  16. else
  17. echo "Not on main branch. Skipping sentry upload."
  18. fi