better sentry upload

This commit is contained in:
Eugene Pankov 2021-01-04 20:44:24 +01:00
parent cdc3623986
commit 5e06b2248b
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
4 changed files with 27 additions and 12 deletions

View File

@ -41,8 +41,7 @@ jobs:
- name: Upload symbols
run: |
sudo npm install -g @sentry/cli --unsafe-perm
sentry-cli releases new ${{ github.ref }} || true
sentry-cli upload-dif app/node_modules
./scripts/sentry-upload.js
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

View File

@ -76,12 +76,7 @@ jobs:
- name: Upload symbols
run: |
sudo npm install -g @sentry/cli --unsafe-perm
dsymutil app/node_modules/@serialport/bindings/build/Release/bindings.node
dsymutil app/node_modules/@terminus-term/node-pty/build/Release/pty.node
dsymutil app/node_modules/fontmanager-redux/build/Release/fontmanager.node
dsymutil app/node_modules/macos-native-processlist/build/Release/native.node
sentry-cli releases new ${{ github.ref }} || true
sentry-cli upload-dif app/node_modules
./scripts/sentry-upload.js
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

View File

@ -37,10 +37,7 @@ jobs:
- name: Upload symbols
run: |
npm install @sentry/cli
node_modules/.bin/sentry-cli.cmd upload-dif app/node_modules
node_modules/.bin/sentry-cli.cmd releases new ${{ github.ref }} || true
node_modules/.bin/sentry-cli.cmd releases set-commits --auto ${{ github.ref }}
node_modules/.bin/sentry-cli.cmd releases files ${{ github.ref }} upload-sourcemaps app/dist terminus-core/dist terminus-terminal/dist terminus-serial/dist terminus-ssh/dist terminus-settings/dist terminus-plugin-manager/dist
node scripts/sentry-upload.js
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

24
scripts/sentry-upload.js Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env node
const sh = require('shelljs')
const vars = require('./vars')
const sentryCli = process.platform === 'win32' ? 'node_modules\\.bin\\sentry-cli.cmd' : 'sentry-cli'
sh.exec(`${sentryCli} releases new ${vars.version}`)
if (process.platform === 'darwin') {
for (const path of [
'app/node_modules/@serialport/bindings/build/Release/bindings.node',
'app/node_modules/@terminus-term/node-pty/build/Release/pty.node',
'app/node_modules/fontmanager-redux/build/Release/fontmanager.node',
'app/node_modules/macos-native-processlist/build/Release/native.node',
]) {
sh.exec('dsymutil ' + path)
}
}
sh.exec(`${sentryCli} upload-dif app/node_modules`)
sh.exec(`${sentryCli} releases set-commits --auto ${vars.version}`)
for (const p of vars.builtinPlugins) {
sh.exec(`${sentryCli} releases files ${vars.version} upload-sourcemaps app/dist ${p}/dist -u ${p}/dist/ -d ${process.platform}`)
}