From 9e4b3953ff897fde1a7c7ac3ca2ec03937058e77 Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 04:53:48 +1100 Subject: [PATCH 1/7] Attempt 1 --- .github/workflows/build-windows.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-windows.yml diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 00000000..8433ce4a --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,61 @@ +name: Build Project + +on: + workflow_dispatch: + push: + branches: + - windows-actions + +env: + CMAKE_PRESET: x64-Clang-Release + +jobs: + build: + name: Build Windows + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.ORG_TOKEN }} + + - name: Checkout private repository + uses: actions/checkout@v4 + with: + repository: ${{ secrets.ASSET_REPO }} + token: ${{ secrets.ASSET_REPO_TOKEN }} + path: .\private + + - name: Install dependencies + run: |- + choco install ninja + + - name: Configure Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + + - name: Prepare Project + run: | + cp -r .\private ..\RecompCiTest\UnleashedRecompLib + + - name: Configure Project + run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE + + - name: Build Project + run: cmake . --build + + - name: Pack Release + run: Compress-Archive -Path .\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\* -DestinationPath .\UnleashedRecomp-Windows.zip + + - name: Upload artifact to Discord + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + if: ${{ env.DISCORD_WEBHOOK != '' }} + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ env.DISCORD_WEBHOOK }} + content: | + Commit: ${{ github.sha }} + Branch: ${{ github.ref_name }} + filename: .\UnleashedRecomp-Windows.zip \ No newline at end of file From 57b3941088e572db2040749907cb5fc7eef1967c Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:12:45 +1100 Subject: [PATCH 2/7] Attempt 2 --- CMakePresets.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3c2d0987..72710ec3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,8 +23,7 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" - }, - "toolset": "ClangCL" + } }, { "name": "x64-Clang-Debug", From 4eb20908d82c60ee25a830b8cddb551632518339 Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:25:48 +1100 Subject: [PATCH 3/7] Attempt 3 --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 8433ce4a..3e1c2eae 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -43,7 +43,7 @@ jobs: run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE - name: Build Project - run: cmake . --build + run: cmake --build .\out\build\${{ env.CMAKE_PRESET }} - name: Pack Release run: Compress-Archive -Path .\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\* -DestinationPath .\UnleashedRecomp-Windows.zip From 2851d42311e78fc443f12fcf2bd95789336aaa35 Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:35:13 +1100 Subject: [PATCH 4/7] Attempt 4 --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 3e1c2eae..7f0309e6 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -37,7 +37,7 @@ jobs: - name: Prepare Project run: | - cp -r .\private ..\RecompCiTest\UnleashedRecompLib + cp -r .\private .\UnleashedRecompLib - name: Configure Project run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE From 82ba218abb5c4174a50467d709574cf96843faaf Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:46:51 +1100 Subject: [PATCH 5/7] Attempt 5 --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 7f0309e6..78a00e7f 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -37,7 +37,7 @@ jobs: - name: Prepare Project run: | - cp -r .\private .\UnleashedRecompLib + robocopy .\private .\UnleashedRecompLib\private - name: Configure Project run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE From 5acb6d2f651f211b997b40fef0ab4ea21a36ffae Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:54:23 +1100 Subject: [PATCH 6/7] Attempt 6 --- .github/workflows/build-windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 78a00e7f..2a2033e8 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -36,8 +36,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - name: Prepare Project - run: | - robocopy .\private .\UnleashedRecompLib\private + run: copy .\private\* .\UnleashedRecompLib\private - name: Configure Project run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE From c9887f1b3389dd0e33342523bf6fc222e9164bfd Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 22 Jan 2025 06:48:28 +1100 Subject: [PATCH 7/7] Attempt 7 --- .github/workflows/build-windows.yml | 37 +++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2a2033e8..6c07b0a1 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -28,24 +28,50 @@ jobs: token: ${{ secrets.ASSET_REPO_TOKEN }} path: .\private + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ccache-${{ runner.os }} + + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: | + ./thirdparty/vcpkg/downloads + ./thirdparty/vcpkg/packages + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} + - name: Install dependencies - run: |- + run: | choco install ninja + Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue - name: Configure Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1 - name: Prepare Project - run: copy .\private\* .\UnleashedRecompLib\private + run: | + $commitMessage = git log -1 --pretty=%s + Add-Content -Path $env:GITHUB_ENV -Value "commit_message=$commitMessage" + copy .\private\* .\UnleashedRecompLib\private - name: Configure Project - run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE + run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache - name: Build Project - run: cmake --build .\out\build\${{ env.CMAKE_PRESET }} + run: cmake --build .\out\build\${{ env.CMAKE_PRESET }} --target UnleashedRecomp - name: Pack Release - run: Compress-Archive -Path .\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\* -DestinationPath .\UnleashedRecomp-Windows.zip + run: | + New-Item -ItemType Directory -Path .\release + New-Item -ItemType Directory -Path .\release\D3D12 + + Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\D3D12\D3D12Core.dll" -Destination ".\release\D3D12\D3D12Core.dll" + Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxcompiler.dll" -Destination ".\release\dxcompiler.dll" + Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxil.dll" -Destination ".\release\dxil.dll" + Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.exe" -Destination ".\release\UnleashedRecomp.exe" + + Compress-Archive -Path .\release\* -DestinationPath .\UnleashedRecomp-Windows.zip - name: Upload artifact to Discord env: @@ -55,6 +81,7 @@ jobs: with: webhook-url: ${{ env.DISCORD_WEBHOOK }} content: | + Summary: ${{ env.commit_message }} Commit: ${{ github.sha }} Branch: ${{ github.ref_name }} filename: .\UnleashedRecomp-Windows.zip \ No newline at end of file