Skip to content

Commit

Permalink
Merge pull request #4812 from talregev/TalR/deploy_folder_list
Browse files Browse the repository at this point in the history
  • Loading branch information
AenBleidd authored Jun 25, 2022
2 parents 11d8ea4 + 89c2690 commit e9d1224
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()}}
Expand Down
43 changes: 38 additions & 5 deletions deploy/prepare_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
]

linux_manager_list = [
'./clientgui/boincmgr'
'./clientgui/boincmgr',
'./clientgui/skins',
'locale/*/*.mo',
]

mingw_apps_list = [
Expand Down Expand Up @@ -181,7 +183,9 @@
'./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 = [
Expand All @@ -191,15 +195,36 @@
'./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)
Expand Down Expand Up @@ -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,
Expand All @@ -273,7 +304,9 @@ def prepare_wasm_client(target_directory):
'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):
Expand Down

0 comments on commit e9d1224

Please sign in to comment.