Skip to content

Commit

Permalink
patch: send sourcemap to sentry at build
Browse files Browse the repository at this point in the history
  • Loading branch information
aethernet committed Jan 12, 2023
1 parent 8cd6da1 commit 4018fde
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 23 deletions.
15 changes: 11 additions & 4 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ runs:
chmod +x "$(dirname "$(which node)")/resinci-deploy" && which resinci-deploy
fi
# FIXME: store sentry workflow is not documented
# https://github.com/product-os/resinci-deploy/blob/master/lib/sentry.ts
# https://github.com/getsentry/sentry-cli
# https://docs.sentry.io/api/projects/create-a-new-client-key/
# Upload sourcemaps to sentry
- name: Generate Sentry DSN
id: sentry
shell: bash --noprofile --norc -eo pipefail -x {0}
Expand Down Expand Up @@ -206,6 +203,16 @@ runs:
-name "latest*.yml" \
-exec yq -i e .stagingPercentage=\"$percentage\" {} \;
- name: Upload sourcemap to Sentry
shell: bash --noprofile --norc -eo pipefail -x {0}
run: |
VERSION=${{ steps.package_release.outputs.version }} npm run uploadSourcemap
env:
SENTRY_AUTH_TOKEN: ${{ fromJSON(inputs.secrets).SENTRY_AUTH_TOKEN }}
npm_config_SENTRY_ORG: balenaEtcher
npm_config_SENTRY_PROJECT: balenaetcher
npm_config_SENTRY_VERSION: ${{ steps.package_release.outputs.version }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
91 changes: 72 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"test-spectron": "mocha --recursive --reporter spec --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts tests/spectron/runner.spec.ts",
"test-windows": "npm run lint && npm run test-gui && npm run test-shared && npm run test-spectron && npm run sanity-checks",
"test": "echo npm run test-{linux,windows,macos}",
"uploadSourcemap": "sentry-cli releases files $npm_config_SENTRY_VERSION upload-sourcemaps ./generated/*.js.map --org $npm_config_SENTRY_ORG --project $npm_config_SENTRY_PROJECT",
"watch": "webpack serve --no-optimization-minimize --config ./webpack.dev.config.ts",
"webpack": "webpack"
},
Expand All @@ -53,6 +54,7 @@
"@balena/lint": "5.4.2",
"@balena/sudo-prompt": "9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534",
"@fortawesome/fontawesome-free": "5.15.4",
"@sentry/cli": "^2.11.0",
"@svgr/webpack": "5.5.0",
"@types/chai": "4.3.4",
"@types/copy-webpack-plugin": "6.4.3",
Expand Down
1 change: 1 addition & 0 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ const guiConfig = {
const mainConfig = {
...commonConfig,
target: 'electron-main',
devtool: 'source-map',
node: {
__dirname: false,
__filename: true,
Expand Down

0 comments on commit 4018fde

Please sign in to comment.