-
Notifications
You must be signed in to change notification settings - Fork 237
123 lines (105 loc) · 3.94 KB
/
emu-build-all-win-vs22.yml
File metadata and controls
123 lines (105 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: "Build emu (Windows)"
on:
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger
permissions:
contents: "write"
env:
PREMAKE_ACTION: "vs2022"
DEPS_CACHE_KEY: "emu-deps-win"
DEPS_CACHE_DIR: "build/deps/win"
THIRD_PARTY_BASE_DIR: "third-party"
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
MAX_PARALLEL_JOBS: 4
jobs:
deps:
name: "Restore or build deps"
if: ${{ !cancelled() }}
uses: "./.github/workflows/emu-deps-win-vs22.yml"
builds-matrix-win:
name: "build"
needs: ["deps"]
runs-on: "windows-2022"
if: ${{ !cancelled() }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
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",
# steam old lib
"lib_steam_old",
# tools
"tool_lobby_connect",
"tool_generate_interfaces",
]
arch: ["x64", "Win32"]
cfg: ["debug", "release"]
exclude:
- prj: lib_steam_old
arch: x64
steps:
# clone branch
- name: "Checkout branch"
uses: actions/checkout@v6
# ensure we have msbuild
- name: "Add MSBuild to PATH"
uses: microsoft/setup-msbuild@v3
# 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
# deps
- name: "Restore deps"
id: "emu-deps-cache-step"
uses: actions/cache@v5
with:
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party build helpers (common/win)"
uses: actions/checkout@v6
with:
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
- name: "Clone third-party deps (build/win)"
uses: actions/checkout@v6
with:
ref: "third-party/build/win"
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
# build target
- name: "Build target"
shell: "cmd"
working-directory: "${{ github.workspace }}/build/project/vs2022/win"
run: |
msbuild /nologo /target:${{ matrix.prj }} /m:1 -p:CL_MPCount=${{ env.MAX_PARALLEL_JOBS }} /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln
# upload artifact/package to github Actions
- name: "Upload target package"
uses: actions/upload-artifact@v7
with:
name: "emu-win-vs22-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "build/win"
if-no-files-found: "error"
compression-level: 9
retention-days: 1