2024-05-20 04:05:53 +03:00
|
|
|
name: Build emu (Windows)
|
2024-05-11 13:13:59 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
|
|
|
workflow_dispatch:
|
|
|
|
# allows manual trigger
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
env:
|
|
|
|
DEPS_CACHE_KEY: emu-deps-win
|
|
|
|
DEPS_CACHE_DIR: build/deps/win
|
|
|
|
|
|
|
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
|
|
|
|
2024-05-11 13:13:59 +03:00
|
|
|
jobs:
|
|
|
|
deps:
|
|
|
|
name: Restore or build deps
|
|
|
|
if: ${{ !cancelled() }}
|
2024-05-11 15:18:05 +03:00
|
|
|
uses: ./.github/workflows/emu-deps-win.yml
|
2024-05-11 13:13:59 +03:00
|
|
|
|
2024-05-20 03:12:20 +03:00
|
|
|
builds-matrix-win:
|
2024-05-20 04:18:53 +03:00
|
|
|
name: build
|
2024-05-11 13:13:59 +03:00
|
|
|
needs: [ deps ]
|
2024-05-20 03:12:20 +03:00
|
|
|
runs-on: windows-2022
|
2024-05-11 13:13:59 +03:00
|
|
|
if: ${{ !cancelled() }}
|
2024-05-20 04:05:53 +03:00
|
|
|
continue-on-error: true
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
strategy:
|
2024-05-20 04:05:53 +03:00
|
|
|
fail-fast: false
|
2024-05-20 03:12:20 +03:00
|
|
|
matrix:
|
2024-05-20 13:07:01 +02:00
|
|
|
prj: [ 'regular', 'experimental', 'steamclient_experimental', 'steamnetworkingsockets', 'tool_lobby_connect', 'GenerateInterfaces', 'experimental_client_win', 'GameOverlayRenderer', ]
|
2024-05-20 03:12:20 +03:00
|
|
|
arch: [ 'x64', 'Win32', ]
|
2024-05-20 13:07:01 +02:00
|
|
|
cfg: [ 'debug', 'release', ]
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
### on Windows Git will auto change line ending to CRLF, not preferable
|
|
|
|
- name: Ensure LF line ending
|
|
|
|
shell: cmd
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
git config --local core.autocrlf false
|
|
|
|
git config --system core.autocrlf false
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
|
|
|
|
### ensure we have msbuild
|
|
|
|
- name: Add MSBuild to PATH
|
|
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
|
|
|
|
### clone branch
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
### deps
|
|
|
|
- name: Restore deps
|
|
|
|
id: emu-deps-cache-step
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
key: ${{ env.DEPS_CACHE_KEY }}
|
|
|
|
path: ${{ env.DEPS_CACHE_DIR }}
|
|
|
|
|
|
|
|
## extra helpers/tools, these are not built inside the deps build dir
|
|
|
|
- name: Clone third-party build helpers (common/win)
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: 'third-party/common/win'
|
|
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
|
|
|
|
|
|
|
|
- name: Clone third-party deps (build/win)
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: 'third-party/build/win'
|
|
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
|
|
|
|
|
|
|
|
### generate project files
|
|
|
|
## TODO gen proto action is broken, always returns error = 1
|
|
|
|
- name: Generate project files
|
|
|
|
shell: cmd
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
2024-05-21 23:37:37 +03:00
|
|
|
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --os=windows genproto
|
|
|
|
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --emubuild=${{ github.sha }} --os=windows vs2022
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
### build target(s)
|
|
|
|
- name: Build target(s)
|
|
|
|
shell: cmd
|
2024-05-20 13:13:44 +02:00
|
|
|
working-directory: ${{ github.workspace }}/build/project/vs2022/win
|
2024-05-20 03:12:20 +03:00
|
|
|
run: |
|
2024-05-20 03:27:51 +03:00
|
|
|
msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:d /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} GBE.sln
|
2024-05-20 03:12:20 +03:00
|
|
|
|
|
|
|
### upload artifact/package to github Actions (for targets)
|
|
|
|
- name: Upload build package (for targets)
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
|
2024-05-20 13:25:09 +02:00
|
|
|
path: "build/win/vs2022/${{ matrix.cfg }}"
|
2024-05-20 03:12:20 +03:00
|
|
|
if-no-files-found: 'error'
|
|
|
|
compression-level: 9
|
|
|
|
retention-days: 1
|