Skip to content

Commit a593418

Browse files
committed
actions: upload sourcemaps to sentry
Signed-off-by: flakey5 <[email protected]>
1 parent b77e690 commit a593418

File tree

4 files changed

+248
-9
lines changed

4 files changed

+248
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,22 @@ jobs:
2121
uses: cloudflare/wrangler-action@7a5f8bbdfeedcde38e6777a50fe685f89259d4ca
2222
with:
2323
apiToken: ${{ secrets.CF_API_TOKEN }}
24-
command: deploy --env staging
24+
command: deploy --env staging --outdir=
25+
26+
- name: Upload sourcemaps for dist-worker-staging
27+
if: github.event_name == 'push'
28+
runs: |
29+
npm run sentry:sourcemaps:staging
2530
2631
- name: Deploy to Production
2732
if: github.event_name == 'workflow_dispatch'
2833
uses: cloudflare/wrangler-action@7a5f8bbdfeedcde38e6777a50fe685f89259d4ca
2934
with:
3035
apiToken: ${{ secrets.CF_API_TOKEN }}
31-
command: deploy --env prod
36+
command: deploy --env prod --outdir=dist
37+
38+
- name: Upload sourcemaps for dist-worker-prod
39+
if: github.event_name == 'workflow_dispatch'
40+
runs: |
41+
npm run sentry:sourcemaps:prod
3242

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ node_modules/
22
.wrangler/
33
dist/
44
.dev.vars
5+
6+
# Sentry Config File
7+
.sentryclirc

package-lock.json

Lines changed: 229 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"test": "npm run test:unit && npm run test:e2e",
1212
"test:unit": "node --test --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --import=tsx ./tests/unit/index.test.ts",
1313
"test:e2e": "wrangler deploy --dry-run --outdir=dist && node --test --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --import=tsx ./tests/e2e/index.test.ts",
14-
"build:handlebars": "node scripts/compile-handlebars.js"
14+
"build:handlebars": "node scripts/compile-handlebars.js",
15+
"sentry:sourcemaps:staging": "sentry-cli sourcemaps inject --org nodejs --project dist-worker-staging ./dist && sentry-cli sourcemaps upload --org nodejs --project dist-worker-staging ./dist",
16+
"sentry:sourcemaps:prod": "sentry-cli sourcemaps inject --org nodejs --project dist-worker-prod ./dist && sentry-cli sourcemaps upload --org nodejs --project dist-worker-prod ./dist"
1517
},
1618
"devDependencies": {
1719
"@cloudflare/workers-types": "^4.20250124.3",
@@ -35,6 +37,7 @@
3537
},
3638
"dependencies": {
3739
"@aws-sdk/client-s3": "^3.717.0",
40+
"@sentry/cli": "^2.41.1",
3841
"handlebars": "^4.7.8",
3942
"itty-router": "^5.0.18",
4043
"toucan-js": "^4.1.0"

0 commit comments

Comments
 (0)