Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/emu-build-all-win-vs22.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
16 changes: 8 additions & 8 deletions .github/workflows/emu-build-all-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ jobs:
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"
Expand All @@ -69,14 +77,6 @@ jobs:
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@v3

# clone branch
- name: "Checkout branch"
uses: actions/checkout@v6

# deps
- name: "Restore deps"
id: "emu-deps-cache-step"
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/emu-deps-win-vs22.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Emu third-party dependencies (Windows vs22)"

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"

PACKAGE_BASE_DIR: "build/package/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-build:
runs-on: "windows-2022"
if: ${{ !cancelled() }}

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

- name: "Lookup cache for 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 }}"
lookup-only: true # don't restore cache if found

# we need branch because it has build scripts
- name: "Checkout branch"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v6

- name: "Clone third-party deps (common/win)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v6
with:
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"

- name: "Clone third-party deps (deps/win)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v6
with:
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"

- name: "Clone third-party deps (deps/common)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v6
with:
ref: "third-party/deps/common"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"

- name: "Build deps"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
set "CMAKE_GENERATOR=Visual Studio 17 2022"
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=${{ env.MAX_PARALLEL_JOBS }} --verbose --clean --os=windows vs2022
5 changes: 5 additions & 0 deletions .github/workflows/emu-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
if: ${{ !cancelled() }}
uses: "./.github/workflows/emu-build-all-win.yml"

emu-win-all-vs22:
name: "win vs22"
if: ${{ !cancelled() }}
uses: "./.github/workflows/emu-build-all-win-vs22.yml"

emu-linux-all:
name: "linux"
if: ${{ !cancelled() }}
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/migrate_gse-build-win-vs22.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "Build migrate_gse script (Windows)"

on:
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger

permissions:
contents: "write"

env:
ARTIFACT_NAME: "migrate_gse-win-vs22-${{ github.sha }}"
SCRIPT_BASE_DIR: "tools/migrate_gse"
PACKAGE_BASE_DIR: "tools/migrate_gse/bin/win"

THIRD_PARTY_BASE_DIR: "third-party"

jobs:
build:
runs-on: "windows-2022"

steps:
- name: "Set up Python 3.12"
uses: actions/setup-python@v6
with:
python-version: "3.12"

# 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

- name: "Checkout branch"
uses: actions/checkout@v6

# extra helpers/tools, these are not built inside the deps build dir
- 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"

# env
- name: "Install env"
shell: cmd
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: recreate_venv_win.bat

# build
- name: "Rebuild"
shell: cmd
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: rebuild_win.bat

# upload artifact
- name: "Upload build package"
uses: actions/upload-artifact@v7
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: "error"
compression-level: 9
retention-days: 1
2 changes: 1 addition & 1 deletion .github/workflows/migrate_gse-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: "Set up Python 3.12"
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/migrate_gse-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
if: ${{ !cancelled() }}
uses: "./.github/workflows/migrate_gse-build-win.yml"

script-win-vs22:
name: "Migrate GSE win vs22"
if: ${{ !cancelled() }}
uses: "./.github/workflows/migrate_gse-build-win-vs22.yml"


script-linux:
name: "Migrate GSE linux"
if: ${{ !cancelled() }}
Expand Down
Loading