2024-08-25 18:49:34 +08:00
|
|
|
name: "Build emu (Windows)"
|
2024-05-11 18:13:59 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
# needed since it allows this to become a reusable workflow
|
|
|
|
workflow_dispatch:
|
|
|
|
# allows manual trigger
|
|
|
|
|
|
|
|
permissions:
|
2024-08-25 18:49:34 +08:00
|
|
|
contents: "write"
|
2024-05-11 18:13:59 +08:00
|
|
|
|
2024-05-20 08:12:20 +08:00
|
|
|
env:
|
2024-08-25 18:49:34 +08:00
|
|
|
PREMAKE_ACTION: "vs2022"
|
|
|
|
DEPS_CACHE_KEY: "emu-deps-win"
|
|
|
|
DEPS_CACHE_DIR: "build/deps/win"
|
|
|
|
|
|
|
|
THIRD_PARTY_BASE_DIR: "third-party"
|
2024-05-20 08:12:20 +08:00
|
|
|
|
2024-05-11 18:13:59 +08:00
|
|
|
jobs:
|
|
|
|
deps:
|
2024-08-25 18:49:34 +08:00
|
|
|
name: "Restore or build deps"
|
2024-05-11 18:13:59 +08:00
|
|
|
if: ${{ !cancelled() }}
|
2024-08-25 18:49:34 +08:00
|
|
|
uses: "./.github/workflows/emu-deps-win.yml"
|
2024-05-11 18:13:59 +08:00
|
|
|
|
2024-05-20 08:12:20 +08:00
|
|
|
builds-matrix-win:
|
2024-08-25 18:49:34 +08:00
|
|
|
name: "build"
|
|
|
|
needs: ["deps"]
|
|
|
|
runs-on: "windows-2022"
|
2024-05-11 18:13:59 +08:00
|
|
|
if: ${{ !cancelled() }}
|
2024-05-20 09:05:53 +08:00
|
|
|
continue-on-error: true
|
2024-08-25 18:49:34 +08:00
|
|
|
|
2024-05-20 08:12:20 +08:00
|
|
|
strategy:
|
2024-05-20 09:05:53 +08:00
|
|
|
fail-fast: false
|
2024-05-20 08:12:20 +08:00
|
|
|
matrix:
|
2024-05-22 10:38:40 +08:00
|
|
|
prj: [
|
2024-08-25 18:49:34 +08:00
|
|
|
# regular api
|
|
|
|
"api_regular",
|
|
|
|
# (experimental) api + client
|
|
|
|
"api_experimental",
|
|
|
|
"steamclient_experimental_stub",
|
|
|
|
# client (experimental) + loader + extra dll + gameoverlaylib
|
|
|
|
"steamclient_experimental",
|
|
|
|
"steamclient_experimental_loader",
|
|
|
|
"steamclient_experimental_extra",
|
|
|
|
"lib_game_overlay_renderer",
|
|
|
|
# tools
|
|
|
|
"tool_lobby_connect",
|
|
|
|
"tool_generate_interfaces",
|
|
|
|
]
|
|
|
|
arch: ["x64", "Win32"]
|
|
|
|
cfg: ["debug", "release"]
|
|
|
|
|
2024-05-20 08:12:20 +08:00
|
|
|
steps:
|
2024-08-25 18:49:34 +08:00
|
|
|
# on Windows Git will auto change line ending to CRLF, not preferable
|
|
|
|
- name: "Ensure LF line ending"
|
|
|
|
shell: "cmd"
|
2024-08-26 00:08:23 +08:00
|
|
|
working-directory: "${{ github.workspace }}"
|
2024-05-20 08:12:20 +08:00
|
|
|
run: |
|
|
|
|
git config --local core.autocrlf false
|
|
|
|
git config --system core.autocrlf false
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# ensure we have msbuild
|
|
|
|
- name: "Add MSBuild to PATH"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# clone branch
|
|
|
|
- name: "Checkout branch"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# deps
|
|
|
|
- name: "Restore deps"
|
|
|
|
id: "emu-deps-cache-step"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
2024-08-25 18:49:34 +08:00
|
|
|
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
|
|
|
|
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
|
2024-05-20 08:12:20 +08:00
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# extra helpers/tools, these are not built inside the deps build dir
|
|
|
|
- name: "Clone third-party build helpers (common/win)"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-08-25 18:49:34 +08:00
|
|
|
ref: "third-party/common/win"
|
2024-05-20 08:12:20 +08:00
|
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
|
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
- name: "Clone third-party deps (build/win)"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-08-25 18:49:34 +08:00
|
|
|
ref: "third-party/build/win"
|
2024-05-20 08:12:20 +08:00
|
|
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
|
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# generate project files
|
|
|
|
- name: "Generate project files"
|
|
|
|
shell: "cmd"
|
|
|
|
working-directory: "${{ github.workspace }}"
|
2024-05-31 19:39:06 +08:00
|
|
|
run: |
|
2024-05-31 20:09:36 +08:00
|
|
|
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
|
2024-05-20 08:12:20 +08:00
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# build target
|
|
|
|
- name: "Build target"
|
|
|
|
shell: "cmd"
|
|
|
|
working-directory: "${{ github.workspace }}/build/project/vs2022/win"
|
2024-05-20 08:12:20 +08:00
|
|
|
run: |
|
2024-05-31 20:12:28 +08:00
|
|
|
msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln
|
2024-05-20 08:12:20 +08:00
|
|
|
|
2024-08-25 18:49:34 +08:00
|
|
|
# upload artifact/package to github Actions
|
|
|
|
- name: "Upload target package"
|
2024-05-20 08:12:20 +08:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
|
2024-06-03 01:43:17 +08:00
|
|
|
path: "build/win"
|
2024-08-25 18:49:34 +08:00
|
|
|
if-no-files-found: "error"
|
2024-05-20 08:12:20 +08:00
|
|
|
compression-level: 9
|
|
|
|
retention-days: 1
|