From 89c26908f2b1701f417b0506356edf081dd9e0f1 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Sat, 25 Jun 2022 17:51:16 +0300 Subject: [PATCH] Add to deploy logs, locale and skins. --- .github/workflows/android.yml | 2 +- .github/workflows/linux.yml | 2 +- .github/workflows/mingw.yml | 13 +++++++++++ .github/workflows/osx.yml | 13 +++++++++++ .github/workflows/wasm.yml | 4 ++-- .github/workflows/windows.yml | 2 +- deploy/prepare_deployment.py | 43 +++++++++++++++++++++++++++++++---- 7 files changed, 69 insertions(+), 10 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 3a1a777079..8716aacc63 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -91,7 +91,7 @@ jobs: - name: Prepare logs on failure if: ${{ failure() }} - run: 7z a -t7z -mx=9 deploy/logs.7z config.log android/BOINC/app/build/reports/ -r0 3rdParty/android/vcpkg/buildtrees/*.log + run: python ./deploy/prepare_deployment.py logs - name: Upload logs on failure if: ${{ failure() }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b8539eef69..4bc76e5e20 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -130,7 +130,7 @@ jobs: - name: Prepare logs on failure if: ${{ failure() }} - run: 7z a -t7z -mx=9 deploy/logs.7z config.log -r0 3rdParty/linux/vcpkg/buildtrees/*.log + run: python ./deploy/prepare_deployment.py logs - name: Upload logs on failure if: ${{ failure() }} diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index e9c8a37bc3..aa2c61c872 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -90,6 +90,19 @@ jobs: run: cmake --build build + - name: Prepare logs on failure + if: ${{ failure() }} + uses: edgarrc/action-7z@v1.0.4 + with: + args: python ./deploy/prepare_deployment.py logs + + - name: Upload logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: mingw_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }} + path: deploy/logs.7z + - name: Prepare artifacts for deploy if: success() && ! contains(matrix.type, 'libs') run: python ./deploy/prepare_deployment.py win_${{ matrix.type }} diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 33191be86e..3d076b860b 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -44,6 +44,19 @@ jobs: if: matrix.type == 'libs-cmake' run: osx/ci_build_libs_cmake.sh + - name: Prepare logs on failure + if: ${{ failure() }} + uses: edgarrc/action-7z@v1.0.4 + with: + args: python ./deploy/prepare_deployment.py logs + + - name: Upload logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: osx_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }} + path: deploy/logs.7z + - name: deploy if: success() && ! contains(matrix.type, 'libs') run: echo "Would start deployment now" diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 7d1f63efdb..cd02c3926c 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -68,7 +68,7 @@ jobs: if: ${{ failure() }} uses: edgarrc/action-7z@v1.0.4 with: - args: 7z a -t7z -mx=9 deploy/logs.7z config.log -r0 3rdParty/wasm/vcpkg/buildtrees/*.log + args: python ./deploy/prepare_deployment.py logs - name: Upload logs on failure if: ${{ failure() }} @@ -89,7 +89,7 @@ jobs: env: PULL_REQUEST: ${{ github.event.number }} PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} - run: 7z a -t7z -mx=9 deploy/wasm_${{ matrix.type }}.7z -r0 lib/*.cpp lib/*.h client/*.cpp client/*.h client/boinc_client.html client/boinc_client.js client/boinc_client.wasm + run: python ./deploy/prepare_deployment.py wasm_${{ matrix.type }} - name: Upload artifacts uses: actions/upload-artifact@v2 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 973d2fc43d..2748384a73 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -86,7 +86,7 @@ jobs: - name: Prepare logs on failure if: ${{failure()}} run: | - 7z.exe a -t7z -mx=9 deploy/logs.7z -r0 3rdParty/Windows/vcpkg/buildtrees/*.log + python ./deploy/prepare_deployment.py logs - name: Upload logs on failure if: ${{failure()}} diff --git a/deploy/prepare_deployment.py b/deploy/prepare_deployment.py index aa56facf23..ec7525faf6 100644 --- a/deploy/prepare_deployment.py +++ b/deploy/prepare_deployment.py @@ -43,7 +43,9 @@ linux_apps_list = [ ] linux_manager_list = [ - './clientgui/boincmgr' + './clientgui/boincmgr', + './clientgui/skins', + 'locale/*/*.mo', ] mingw_apps_list = [ @@ -181,7 +183,9 @@ windows_manager_list = [ './win_build/Build/x64/Release/boinctray.exe', './win_build/Build/x64/Release/boincmgr.exe', './win_build/Build/ARM64/Release/boinctray.exe', - './win_build/Build/ARM64/Release/boincmgr.exe' + './win_build/Build/ARM64/Release/boincmgr.exe', + './clientgui/skins', + 'locale/*/*.mo', ] wasm_client_list = [ @@ -191,15 +195,36 @@ wasm_client_list = [ './samples/wasm/index.html', ] +wasm_client_debug_folder_list = [ + 'lib/*.cpp', + 'lib/*.h', + 'client/*.cpp', + 'client/*.h', + 'client/boinc_client.html', + 'client/boinc_client.js', + 'client/boinc_client.wasm', +] + +logs_list = [ + 'config.log', + '3rdParty/wasm/vcpkg/buildtrees/*.log', + '3rdParty/linux/vcpkg/buildtrees/*.log', + '3rdParty/osx/vcpkg/buildtrees/*.log', + '3rdParty/android/vcpkg/buildtrees/*.log', + '3rdParty/mingw/vcpkg/buildtrees/*.log', + '3rdParty/Windows/vcpkg/buildtrees/*.log', + 'android/BOINC/app/build/reports/', +] + def prepare_7z_archive(archive_name, target_directory, files_list): os.makedirs(target_directory, exist_ok=True) archive_path = os.path.join(target_directory, archive_name + '.7z') - command = '7z a -t7z -mx=9 ' + archive_path + ' ' + ' '.join(files_list) + command = f'7z a -t7z -mx=9 {archive_path} {" ".join(files_list)}' os.system(command) def help(): print('Usage: python preprare_deployment.py BOINC_TYPE') - print('BOINC_TYPE : [linux_client | linux_client-vcpkg | linux_apps | linux_apps-vcpkg | linux_manager-with-webview | linux_manager-without-webview | win_apps-mingw | win_apps-mingw-vcpkg | android_manager | android_manager-vcpkg | android_apps | android_apps-vcpkg | win_apps | win_client | win_manager]') + print(f'BOINC_TYPE : [{" | ".join(boinc_types.keys())}]') def prepare_linux_client(target_directory): prepare_7z_archive('linux_client', target_directory, linux_client_list) @@ -256,6 +281,12 @@ def prepare_win_manager(target_directory): def prepare_wasm_client(target_directory): prepare_7z_archive('wasm_client', target_directory, wasm_client_list) +def prepare_wasm_client_debug(target_directory): + prepare_7z_archive('wasm_client-debug', target_directory, wasm_client_debug_folder_list) + +def prepare_logs(target_directory): + prepare_7z_archive('logs', target_directory, logs_list) + boinc_types = { 'linux_client': prepare_linux_client, 'linux_client-vcpkg': prepare_linux_client_vcpkg, @@ -273,7 +304,9 @@ boinc_types = { 'win_apps': prepare_win_apps, 'win_client': prepare_win_client, 'win_manager': prepare_win_manager, - 'wasm_client': prepare_wasm_client + 'wasm_client': prepare_wasm_client, + 'wasm_client-debug': prepare_wasm_client_debug, + 'logs': prepare_logs, } if (len(sys.argv) != 2):