Skip to content

Commit 40a5464

Browse files
committed
actions: upload sourcemaps in staging
1 parent bed820d commit 40a5464

File tree

5 files changed

+282
-4
lines changed

5 files changed

+282
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ jobs:
4141
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
4242
with:
4343
apiToken: ${{ secrets.CF_API_TOKEN }}
44-
command: deploy --env staging
44+
command: deploy --env staging --outdir=./dist
45+
46+
- name: Upload sourcemaps for dist-worker-staging
47+
if: github.event_name == 'push'
48+
runs: |
49+
npx sentry-cli sourcemaps inject --org nodejs --project dist-worker-staging ./dist && sentry-cli sourcemaps upload --org nodejs --project dist-worker-staging ./dist
4550
4651
- name: Deploy to Production
4752
if: github.event_name == 'workflow_dispatch'
4853
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
4954
with:
5055
apiToken: ${{ secrets.CF_API_TOKEN }}
51-
command: deploy --env prod
52-
56+
command: deploy --env prod --outdir=./dist
57+
5358
- name: Alert on Failure
5459
if: failure() && github.repository == 'nodejs/release-cloudflare-worker'
5560
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3

.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: 265 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@eslint/eslintrc": "^3.2.0",
1919
"@eslint/js": "^9.32.0",
2020
"@reporters/github": "^1.7.2",
21+
"@sentry/cli": "^2.54.0",
2122
"@types/mustache": "^4.2.6",
2223
"@types/node": "^24.3.0",
2324
"@typescript-eslint/eslint-plugin": "^8.41.0",
@@ -41,4 +42,4 @@
4142
"mustache": "^4.2.0",
4243
"toucan-js": "^4.1.1"
4344
}
44-
}
45+
}

src/worker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export default {
4545
execution: ctx,
4646
};
4747

48+
if (env.ENVIRONMENT === 'staging' && request.url === '/_657ee98d-f9d3-46cd-837b-f58a88add70a') {
49+
throw new Error('sentry source map testing');
50+
}
51+
4852
return await router.handle(request, context);
4953
} catch (e) {
5054
// Send to sentry, if it's disabled this will just noop

0 commit comments

Comments
 (0)