|
| 1 | +name: "Build emu (Windows) (19)" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + # needed since it allows this to become a reusable workflow |
| 6 | + workflow_dispatch: |
| 7 | + # allows manual trigger |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: "write" |
| 11 | + |
| 12 | +env: |
| 13 | + PREMAKE_ACTION: "vs2022" |
| 14 | + DEPS_CACHE_KEY: "emu-deps-win" |
| 15 | + DEPS_CACHE_DIR: "build/deps/win" |
| 16 | + |
| 17 | + THIRD_PARTY_BASE_DIR: "third-party" |
| 18 | + |
| 19 | +jobs: |
| 20 | + deps: |
| 21 | + name: "Restore or build deps" |
| 22 | + if: ${{ !cancelled() }} |
| 23 | + uses: "./.github/workflows/emu-deps-win.yml" |
| 24 | + |
| 25 | + builds-matrix-win: |
| 26 | + name: "build" |
| 27 | + needs: ["deps"] |
| 28 | + runs-on: "windows-2019" |
| 29 | + if: ${{ !cancelled() }} |
| 30 | + continue-on-error: true |
| 31 | + |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + prj: [ |
| 36 | + # regular api |
| 37 | + "api_regular", |
| 38 | + # (experimental) api + client |
| 39 | + "api_experimental", |
| 40 | + "steamclient_experimental_stub", |
| 41 | + # client (experimental) + loader + extra dll + gameoverlaylib |
| 42 | + "steamclient_experimental", |
| 43 | + "steamclient_experimental_loader", |
| 44 | + "steamclient_experimental_extra", |
| 45 | + "lib_game_overlay_renderer", |
| 46 | + # tools |
| 47 | + "tool_lobby_connect", |
| 48 | + "tool_generate_interfaces", |
| 49 | + ] |
| 50 | + arch: ["x64", "Win32"] |
| 51 | + cfg: ["debug", "release"] |
| 52 | + |
| 53 | + steps: |
| 54 | + # on Windows Git will auto change line ending to CRLF, not preferable |
| 55 | + - name: "Ensure LF line ending" |
| 56 | + shell: "cmd" |
| 57 | + working-directory: "${{ github.workspace }}" |
| 58 | + run: | |
| 59 | + git config --local core.autocrlf false |
| 60 | + git config --system core.autocrlf false |
| 61 | + git config --global core.autocrlf false |
| 62 | + |
| 63 | + # ensure we have msbuild |
| 64 | + - name: "Add MSBuild to PATH" |
| 65 | + uses: microsoft/setup-msbuild@v2 |
| 66 | + |
| 67 | + # clone branch |
| 68 | + - name: "Checkout branch" |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + # deps |
| 72 | + - name: "Restore deps" |
| 73 | + id: "emu-deps-cache-step" |
| 74 | + uses: actions/cache@v4 |
| 75 | + with: |
| 76 | + key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}" |
| 77 | + path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}" |
| 78 | + |
| 79 | + # extra helpers/tools, these are not built inside the deps build dir |
| 80 | + - name: "Clone third-party build helpers (common/win)" |
| 81 | + uses: actions/checkout@v4 |
| 82 | + with: |
| 83 | + ref: "third-party/common/win" |
| 84 | + path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win" |
| 85 | + |
| 86 | + - name: "Clone third-party deps (build/win)" |
| 87 | + uses: actions/checkout@v4 |
| 88 | + with: |
| 89 | + ref: "third-party/build/win" |
| 90 | + path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" |
| 91 | + |
| 92 | + # generate project files |
| 93 | + - name: "Generate project files" |
| 94 | + shell: "cmd" |
| 95 | + working-directory: "${{ github.workspace }}" |
| 96 | + run: | |
| 97 | + "${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022 |
| 98 | + |
| 99 | + # build target |
| 100 | + - name: "Build target" |
| 101 | + shell: "cmd" |
| 102 | + working-directory: "${{ github.workspace }}/build/project/vs2022/win" |
| 103 | + run: | |
| 104 | + msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln |
| 105 | + |
| 106 | + # upload artifact/package to github Actions |
| 107 | + - name: "Upload target package" |
| 108 | + uses: actions/upload-artifact@v4 |
| 109 | + with: |
| 110 | + name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}" |
| 111 | + path: "build/win" |
| 112 | + if-no-files-found: "error" |
| 113 | + compression-level: 9 |
| 114 | + retention-days: 1 |
0 commit comments