From eab0ea4eef09ef53369d4e2a638a0daa8d4b8a7e Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 3 Feb 2025 12:37:17 -0800 Subject: [PATCH] Upload sourcemaps by hash --- package.json | 2 +- sourcemaps.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 sourcemaps.sh diff --git a/package.json b/package.json index d2525b6..7ca1fd8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "vite dev", "build": "./build.sh", - "sourcemaps": "sentry-cli --url https://glitchtip.coracle.social --auth-token $GLITCHTIP_AUTH_TOKEN --api-key $VITE_GLITCHTIP_API_KEY sourcemaps --org coracle --project flotilla --release $(cat package.json|jq -r '.version') upload --url-prefix /_app/immutable/ build/_app/immutable", + "sourcemaps": "./sourcemaps.sh", "release:android": "cap build android --androidreleasetype APK --signing-type apksigner", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", diff --git a/sourcemaps.sh b/sourcemaps.sh new file mode 100755 index 0000000..dcd258a --- /dev/null +++ b/sourcemaps.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +hash=$(find build -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum | awk '{print $1}') + +sentry-cli \ + --url https://glitchtip.coracle.social \ + --auth-token $GLITCHTIP_AUTH_TOKEN \ + --api-key $VITE_GLITCHTIP_API_KEY \ + sourcemaps \ + --org coracle \ + --project flotilla \ + --release $hash \ + upload \ + --url-prefix /_app/immutable/ \ + build/_app/immutable