Skip to content

Commit

Permalink
Improve Windows GitHub Actions
Browse files Browse the repository at this point in the history
1. Use sccache, because ccache isn't fully compatible with Windows yet.
   ccache/ccache#1023
2. Package Xbox One build correctly (all the `*.appx` files at archive
   root)
  • Loading branch information
glebm committed Jul 10, 2022
1 parent 3d08f95 commit 4d41246
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Windows_MSVC_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
variant: sccache

- name: Install latest CMake
uses: lukka/get-cmake@latest
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/xbox_one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
variant: sccache

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
Expand All @@ -30,12 +31,18 @@ jobs:
cd ${{ github.workspace }}\Packaging\xbox-one
build.bat
- name:
run: >
New-Item -Path build-uwp-project -Name pkg -ItemType Directory -Force &&
Copy-Item -File -Recurse
-Path uwp-project\AppxPackages, uwp-project\Release
-Include Microsoft.VCLibs.x64.*.appx, devilutionX_*_x64.appx
- Destination build-uwp-project\pkg\
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: devilutionx-xbox-one.zip
if-no-files-found: error
path: |
build/uwp-project/AppxPackages/**/Microsoft.VCLibs.x64.*.appx
build/uwp-project/Release/**/devilutionX_*_x64.appx
path: build/uwp-project/pkg/
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,16 @@ if(PIE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif()

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
find_program(SCCACHE_PROGRAM sccache)
if(SCCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}")
else()
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
endif()

if(DEVILUTIONX_DISABLE_RTTI)
Expand Down

0 comments on commit 4d41246

Please sign in to comment.