From 0d1f2a49ffd6da58b12e0ea3429fe6bc93aff970 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 5 Apr 2021 15:26:56 -0400 Subject: [PATCH] CI: Separate & upload debug info for Linux/macOS --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++-- ci/build-appimage.sh | 2 +- ci/upload-debug-linux.sh | 7 +++++++ ci/upload-debug-macos.sh | 8 ++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100755 ci/upload-debug-linux.sh create mode 100755 ci/upload-debug-macos.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 215ca0c82..ff38f9e42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,7 @@ jobs: zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \ libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \ libcurl4-openssl-dev + yarn global add @sentry/cli # free up disk space # https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173 echo Before @@ -63,6 +64,13 @@ jobs: working-directory: ${{github.workspace}}/build run: cmake --build . --config $BUILD_TYPE + - name: Upload debug information + if: matrix.name == "Clang" + env: + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + SENTRY_URL: ${{secrets.SENTRY_URL}} + run: ci/upload-debug-linux.sh + - name: Generate AppImage run: ci/build-appimage.sh @@ -70,7 +78,9 @@ jobs: uses: actions/upload-artifact@v2 with: name: urde-${{env.URDE_VERSION}}-linux-${{matrix.cc}}-x86_64 - path: URDE-*.AppImage + path: | + URDE-*.AppImage + build/Binaries/*.dbg build-macos: name: Build macOS (AppleClang x86_64) @@ -83,7 +93,7 @@ jobs: - name: Install dependencies run: | - brew install ninja qt@5 graphicsmagick imagemagick + brew install ninja qt@5 graphicsmagick imagemagick getsentry/tools/sentry-cli brew link qt@5 yarn global add create-dmg @@ -101,6 +111,12 @@ jobs: working-directory: ${{github.workspace}}/build run: cmake --build . --config $BUILD_TYPE + - name: Upload debug information + env: + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + SENTRY_URL: ${{secrets.SENTRY_URL}} + run: ci/upload-debug-macos.sh + - name: Import signing certificate uses: devbotsxyz/xcode-import-certificate@master with: @@ -134,6 +150,7 @@ jobs: LLVM_VERSION: 10.0.1 Qt_VERSION: 5.15.2 # IPP_VERSION: 2021.2.0.210 + SENTRY_CLI_VERSION: 1.63.2 steps: - uses: actions/checkout@v2 with: @@ -156,6 +173,12 @@ jobs: (New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename") 7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename" + - name: Download sentry-cli + run: | + $TempDir = "$env:RUNNER_WORKSPACE\temp" + New-Item -Path "$TempDir" -ItemType Directory -ea 0 + (New-Object Net.WebClient).DownloadFile("https://github.com/getsentry/sentry-cli/releases/download/$env:SENTRY_CLI_VERSION/sentry-cli-Windows-x86_64.exe", "$TempDir\sentry-cli.exe") + # - name: Install Intel IPP # run: | # $TempDir = "$env:RUNNER_WORKSPACE\temp" @@ -189,6 +212,9 @@ jobs: working-directory: ${{github.workspace}}/build run: cmake --build . --config $BUILD_TYPE + - name: Upload debug information + run: + - name: Compress PDBs working-directory: ${{github.workspace}}/build/Binaries run: 7z a -t7z debug.7z urde.pdb hecl.pdb hecl-gui.pdb visigen.pdb diff --git a/ci/build-appimage.sh b/ci/build-appimage.sh index d7a192c40..430c17eac 100755 --- a/ci/build-appimage.sh +++ b/ci/build-appimage.sh @@ -8,7 +8,7 @@ chmod +x linuxdeploy-$(uname -m).AppImage linuxdeploy-plugin-qt-$(uname -m).AppI # Build AppImage mkdir -p appdir/usr/{bin,share/{applications,icons/hicolor}} cp build/Binaries/{hecl,hecl-gui,urde,visigen} appdir/usr/bin -strip -s appdir/usr/bin/{hecl,hecl-gui,urde,visigen} +strip -S appdir/usr/bin/{hecl,hecl-gui,urde,visigen} cp -r Editor/platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} appdir/usr/share/icons/hicolor cp Editor/platforms/freedesktop/urde.desktop appdir/usr/share/applications sed -i 's/Exec=.*/Exec=hecl-gui/' appdir/usr/share/applications/urde.desktop diff --git a/ci/upload-debug-linux.sh b/ci/upload-debug-linux.sh new file mode 100755 index 000000000..ea9629fc1 --- /dev/null +++ b/ci/upload-debug-linux.sh @@ -0,0 +1,7 @@ +#!/bin/bash -ex +cd build/Binaries +for f in hecl hecl-gui urde visigen; do + objcopy --only-keep-debug $f $f.dbg +done +strip -S hecl hecl-gui urde visigen +sentry-cli upload-dif --org axiodl --project urde {hecl,hecl-gui,urde,visigen}{,.dbg} --include-sources diff --git a/ci/upload-debug-macos.sh b/ci/upload-debug-macos.sh new file mode 100755 index 000000000..53f7b36ba --- /dev/null +++ b/ci/upload-debug-macos.sh @@ -0,0 +1,8 @@ +#!/bin/bash -ex +cd build/Binaries/hecl-gui.app/Contents/MacOS +for f in hecl hecl-gui urde visigen; do + dsymutil $f +done +strip -S hecl hecl-gui urde visigen crashpad_handler +sentry-cli upload-dif --org axiodl --project urde {hecl,hecl-gui,urde,visigen}{,.dSYM} --include-sources +rm -r -- *.dSYM