gbe_fork/.github/workflows/emu-build-all-win.yml

115 lines
3.5 KiB
YAML
Raw Normal View History

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-11 13:13:59 +03:00
2024-05-20 03:12:20 +03:00
env:
PREMAKE_ACTION: "vs2022"
DEPS_CACHE_KEY: "emu-deps-win"
DEPS_CACHE_DIR: "build/deps/win"
THIRD_PARTY_BASE_DIR: "third-party"
2024-05-20 03:12:20 +03:00
2024-05-11 13:13:59 +03:00
jobs:
deps:
name: "Restore or build deps"
2024-05-11 13:13:59 +03:00
if: ${{ !cancelled() }}
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:
name: "build"
needs: ["deps"]
runs-on: "windows-2022"
2024-05-11 13:13:59 +03:00
if: ${{ !cancelled() }}
continue-on-error: true
2024-05-20 03:12:20 +03:00
strategy:
fail-fast: false
2024-05-20 03:12:20 +03:00
matrix:
2024-05-22 05:38:40 +03:00
prj: [
# 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 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"
2024-08-25 18:08:23 +02:00
working-directory: "${{ github.workspace }}"
2024-05-20 03:12:20 +03:00
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"
2024-05-20 03:12:20 +03:00
uses: microsoft/setup-msbuild@v2
# clone branch
- name: "Checkout branch"
2024-05-20 03:12:20 +03:00
uses: actions/checkout@v4
# deps
- name: "Restore deps"
id: "emu-deps-cache-step"
2024-05-20 03:12:20 +03:00
uses: actions/cache@v4
with:
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
2024-05-20 03:12:20 +03:00
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party build helpers (common/win)"
2024-05-20 03:12:20 +03:00
uses: actions/checkout@v4
with:
ref: "third-party/common/win"
2024-05-20 03:12:20 +03:00
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
- name: "Clone third-party deps (build/win)"
2024-05-20 03:12:20 +03:00
uses: actions/checkout@v4
with:
ref: "third-party/build/win"
2024-05-20 03:12:20 +03:00
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
# generate project files
- name: "Generate project files"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
"${{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 03:12:20 +03:00
# build target
- name: "Build target"
shell: "cmd"
working-directory: "${{ github.workspace }}/build/project/vs2022/win"
2024-05-20 03:12:20 +03:00
run: |
2024-05-31 15:12:28 +03:00
msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln
2024-05-20 03:12:20 +03:00
# upload artifact/package to github Actions
- name: "Upload target package"
2024-05-20 03:12:20 +03:00
uses: actions/upload-artifact@v4
with:
name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
2024-06-02 20:43:17 +03:00
path: "build/win"
if-no-files-found: "error"
2024-05-20 03:12:20 +03:00
compression-level: 9
retention-days: 1