@@ -51,16 +51,12 @@ jobs:
5151 ./vcpkg/bootstrap-vcpkg.sh
5252 fi
5353 ./vcpkg/vcpkg install
54- - name : Setup CMake
55- uses : jwlawson/actions-setup-cmake@v2
56- with :
57- cmake-version : ' 3.27.4'
5854 - name : Compilation
5955 run : |
6056 ./release.sh
6157 - name : Create archive
6258 run : |
63- zip -r linux_executables.zip r-type_client r-type_server
59+ zip -r linux_executables.zip r-type_client r-type_server assets server/config.json client/config.json shared/Scenarios
6460 - name : Upload Release Asset
6561 id : upload-release-asset-linux
6662 uses : actions/upload-release-asset@v1
@@ -72,39 +68,48 @@ jobs:
7268 asset_name : linux_executables.zip
7369 asset_content_type : application/zip
7470
75- # build_and_deploy_windows:
76- # name: Build and deploy (Windows)
77- # runs-on: windows-latest
78- # needs: create_release
79- # steps:
80- # - name: Checkout repository
81- # uses: actions/checkout@v4
82- # - name: Cache vcpkg
83- # uses: actions/cache@v4
84- # with:
85- # path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
86- # key: ${{ hashFiles('vcpkg.json') }}
87- # - name: Setup vcpkg
88- # run: |
89- # if (-not (Test-Path -Path "C:\vcpkg")) {
90- # git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
91- # .\vcpkg\bootstrap-vcpkg.bat
92- # }
93- # C:\vcpkg\vcpkg install
94- # - name: Compilation # ne fonctionne pas encore
95- # run: |
96- # cmake -S . -B build -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release
97- # cmake --build .
98- # - name: Create archive
99- # run: |
100- # Compress-Archive -Path r-type_client.exe, r-type_server.exe -DestinationPath windows_executables.zip
101- # - name: Upload Release Asset
102- # id: upload-release-asset-windows
103- # uses: actions/upload-release-asset@v1
104- # env:
105- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106- # with:
107- # upload_url: ${{ needs.create_release.outputs.upload_url }}
108- # asset_path: ./windows_executables.zip
109- # asset_name: windows_executables.zip
110- # asset_content_type: application/zip
71+ build_and_deploy_windows :
72+ name : Build and deploy (Windows)
73+ runs-on : windows-latest
74+ needs : create_release
75+ steps :
76+ - name : Checkout repository
77+ uses : actions/checkout@v4
78+ - name : Cache vcpkg
79+ uses : actions/cache@v4
80+ with :
81+ path : C:\Users\runneradmin\AppData\Local\vcpkg\archives
82+ key : ${{ hashFiles('vcpkg.json') }}
83+ - name : Setup vcpkg
84+ run : |
85+ if (-not (Test-Path -Path "C:\vcpkg")) {
86+ git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
87+ .\vcpkg\bootstrap-vcpkg.bat
88+ }
89+ C:\vcpkg\vcpkg install
90+ - name : Setup Ninja
91+ uses : seanmiddleditch/gha-setup-ninja@master
92+ - name : Setup MSVC
93+ 94+ - name : Compilation
95+ run : |
96+ mkdir cmake-build-windows
97+ cd cmake-build-windows
98+ cmake .. --preset=windows-from-windows -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
99+ cmake --build .
100+ - name : Create archive
101+ run : |
102+ Get-ChildItem -Path .\server\* | Where-Object { $_.Name -ne 'config.json' } | Remove-Item -Recurse -Force
103+ Get-ChildItem -Path .\client\* | Where-Object { $_.Name -ne 'config.json' } | Remove-Item -Recurse -Force
104+ Get-ChildItem -Path .\shared\* | Where-Object { $_.Name -ne 'Scenarios' } | Remove-Item -Recurse -Force
105+ Compress-Archive -Path r-type_client.exe, r-type_server.exe, *.dll, assets, server, client, shared -DestinationPath windows_executables.zip
106+ - name : Upload Release Asset
107+ id : upload-release-asset-windows
108+ uses : actions/upload-release-asset@v1
109+ env :
110+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
111+ with :
112+ upload_url : ${{ needs.create_release.outputs.upload_url }}
113+ asset_path : ./windows_executables.zip
114+ asset_name : windows_executables.zip
115+ asset_content_type : application/zip
0 commit comments