* make all build switches opt-in

* separate jobs for each build arch and variant
This commit is contained in:
otavepto 2024-05-11 04:41:38 +03:00
parent a65d6852ad
commit dc5cde9fd6
5 changed files with 201 additions and 161 deletions

View File

@ -1,27 +1,37 @@
name: Emu build 2 (Windows) name: Emu build 2 (Windows)
on: on:
push: workflow_call:
branches: [ inputs:
"ci-build-emu-win*", emu-variant:
"ci-build-all" description: |
] Which variant of the emu to build:
tags: regular: build the regular version of the emu
- release* exp: build the experimental version of the emu
client: build the experimental steamclient version of the emu
tools: build the tools only
all: build all variants
default: 'all'
required: false
type: string
pull_request: x32:
branches: [ "dev" ] description: |
paths-ignore: build architecture, unused when 'emu-variant' == 'all' or 'emu-variant' == 'tools'
- '**/*.md' true: x32
- 'dev.notes/**' false: x64
- 'post_build/**' default: false
- 'z_original_repo_files/**' required: false
- 'sdk/*.txt' type: boolean
- 'LICENSE'
# tools debug:
- 'tools/generate_emu_config/**' description: |
- 'tools/migrate_gse/**' build mode, unused when 'emu-variant' == 'all'
- 'tools/steamclient_loader/linux/**' true: build in debug mode
false: build in release mode
default: false
required: false
type: boolean
workflow_dispatch: workflow_dispatch:
# allows manual trigger # allows manual trigger
@ -37,8 +47,8 @@ env:
THIRD_PARTY_BASE_DIR: 'third-party' THIRD_PARTY_BASE_DIR: 'third-party'
jobs: jobs:
# this helps in manual runs, if build fails, then deps are saved
dependencies: dependencies:
name: Restore or build deps
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
uses: ./.github/workflows/deps-win.yml uses: ./.github/workflows/deps-win.yml
@ -48,7 +58,46 @@ jobs:
needs: [ dependencies ] needs: [ dependencies ]
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
steps: steps:
# on Windows Git will auto change line ending to CRLF, not preferable ### setup build vars
- name: Setup build vars
shell: cmd
run: |
echo env file = "${{ GITHUB_ENV }}"
if /i "${{ inputs.debug }}"=="true" (
set "build_switches=%build_switches% debug"
>>"${{ GITHUB_ENV }}" echo build_mode=debug
) else (
>>"${{ GITHUB_ENV }}" echo build_mode=release
)
set "arch="
if /i "${{ inputs.x32 }}"=="true" (
set "arch=32"
) else (
set "arch=64"
)
set "build_switches="
if "${{ inputs.emu-variant }}"=="regular" (
set "build_switches=+lib-%arch%"
) else if "${{ inputs.emu-variant }}"=="exp" (
set "build_switches=+ex-lib-%arch% +ex-client-%arch%"
) else if "${{ inputs.emu-variant }}"=="client" (
set "build_switches=+exclient-%arch% +exclient-ldr-%arch% +exclient-extra-%arch% +lib-gameoverlay-%arch%"
) else if "${{ inputs.emu-variant }}"=="tools" (
set "build_switches=+tool-itf +tool-lobby"
) else if "${{ inputs.emu-variant }}"=="all" (
set "build_switches=+lib-32 +lib-64 +ex-lib-32 +ex-lib-64 +ex-client-32 +ex-client-64 +exclient-32 +exclient-64 +exclient-ldr-32 +exclient-ldr-64 +tool-itf +tool-lobby +exclient-extra-32 +exclient-extra-64 +lib-gameoverlay-32 +lib-gameoverlay-64"
) else (
1>&2 echo [X] invalid emu variant "${{ inputs.emu-variant }}"
exit /b 1
)
echo final build switches %build_switches%
>>"${{ GITHUB_ENV }}" echo build_switches=%build_switches%
### on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending - name: Ensure LF line ending
shell: cmd shell: cmd
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
@ -61,7 +110,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
### deps ### deps
- name: Lookup cache for deps - name: Restore deps
id: emu-deps-cache-step id: emu-deps-cache-step
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -87,54 +136,44 @@ jobs:
ref: 'third-party/build/win' ref: 'third-party/build/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
### build (release mode) ### build target(s)
- name: Build release mode - name: Build target(s)
if: inputs.emu-variant != 'all'
shell: cmd shell: cmd
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: build_win.bat -verbose release +build_str ${{ github.sha }} +exclient-extra-32 +exclient-extra-64 +lib-gameoverlay-32 +lib-gameoverlay-64 run: build_win.bat -verbose ${{ env.build_mode }} clean +build_str ${{ github.sha }} ${{ env.build_switches }}
### package (release mode) ### build all
- name: Package build (release) - name: Build all
if: inputs.emu-variant == 'all'
shell: cmd shell: cmd
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: package_win.bat release run: |
build_win.bat -verbose release clean +build_str ${{ github.sha }} ${{ env.build_switches }} || exit /b %errorlevel%
build_win.bat -verbose debug clean +build_str ${{ github.sha }} ${{ env.build_switches }} || exit /b %errorlevel%
### package target(s)
- name: Package target(s)
if: inputs.emu-variant != 'all'
shell: cmd
working-directory: ${{ github.workspace }}
run: package_win.bat ${{ env.build_mode }}
### package all
- name: Package all
if: inputs.emu-variant == 'all'
shell: cmd
working-directory: ${{ github.workspace }}
run: |
package_win.bat release || exit /b %errorlevel%
package_win.bat debug || exit /b %errorlevel%
### upload artifact/package to github Actions (release mode) ### upload artifact/package to github Actions (release mode)
- name: Upload build package (release) - name: Upload build package
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: "build-win-release-${{ github.sha }}" name: "build-win-release-${{ github.sha }}"
path: "${{ env.PACKAGE_BASE_DIR }}/release/" path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: 'error' if-no-files-found: 'error'
compression-level: 9 compression-level: 9
retention-days: 1 retention-days: 1
### build (debug mode)
- name: Build debug mode
shell: cmd
working-directory: ${{ github.workspace }}
run: build_win.bat -verbose debug +build_str ${{ github.sha }} +exclient-extra-32 +exclient-extra-64 +lib-gameoverlay-32 +lib-gameoverlay-64
### package (debug mode)
- name: Package build (debug)
shell: cmd
working-directory: ${{ github.workspace }}
run: package_win.bat debug
### upload artifact/package to github Actions (debug mode)
- name: Upload build package (debug)
uses: actions/upload-artifact@v4
with:
name: "build-win-debug-${{ github.sha }}"
path: "${{ env.PACKAGE_BASE_DIR }}/debug/"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
### release (debug + release modes) if this is a tag push
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: "${{ env.PACKAGE_BASE_DIR }}/**/*"

View File

@ -1,6 +1,7 @@
* for Windows ColdClientLoader: allow loading `.ini` file with the same name as the loader * for Windows ColdClientLoader: allow loading `.ini` file with the same name as the loader
ex: if the loader is named `game_cold_loader.exe`, then it will first try to load `game_cold_loader.ini`, ex: if the loader is named `game_cold_loader.exe`, then it will first try to load `game_cold_loader.ini`,
if that doesn't exist, it will fallback to `ColdClientLoader.ini` if that doesn't exist, it will fallback to `ColdClientLoader.ini`
* make all build switches opt-in
--- ---

View File

@ -153,25 +153,25 @@ Arguments you can pass to this script:
>>>>>>>>> ___ >>>>>>>>> ___
* `-lib-32`: prevent building normal `steam_api.dll` * `+lib-32`: build normal `steam_api.dll`
* `-lib-64`: prevent building normal `steam_api64.dll` * `+lib-64`: build normal `steam_api64.dll`
>>>>>>>>> ___ >>>>>>>>> ___
* `-ex-lib-32`: prevent building experimental `steam_api.dll` * `+ex-lib-32`: build experimental `steam_api.dll`
* `-ex-lib-64`: prevent building experimental `steam_api64.dll` * `+ex-lib-64`: build experimental `steam_api64.dll`
>>>>>>>>> ___ >>>>>>>>> ___
* `-ex-client-32`: prevent building experimental `steamclient.dll` * `+ex-client-32`: build experimental `steamclient.dll`
* `-ex-client-64`: prevent building experimental `steamclient64.dll` * `+ex-client-64`: build experimental `steamclient64.dll`
>>>>>>>>> ___ >>>>>>>>> ___
* `-exclient-32`: prevent building steamclient `steamclient.dll` * `+exclient-32`: build steamclient `steamclient.dll`
* `-exclient-64`: prevent building steamclient `steamclient64.dll` * `+exclient-64`: build steamclient `steamclient64.dll`
* `-exclient-ldr-32`: prevent building steamclient loader (32) `steamclient_loader_32.exe` * `+exclient-ldr-32`: build steamclient loader (32) `steamclient_loader_32.exe`
* `-exclient-ldr-64`: prevent building steamclient loader (64) `steamclient_loader_64.exe` * `+exclient-ldr-64`: build steamclient loader (64) `steamclient_loader_64.exe`
>>>>>>>>> ___ >>>>>>>>> ___
@ -180,8 +180,8 @@ Arguments you can pass to this script:
>>>>>>>>> ___ >>>>>>>>> ___
* `-tool-itf` prevent building the tool `find_interfaces` * `+tool-itf` build the tool `find_interfaces`
* `-tool-lobby`: prevent building the tool `lobby_connect` * `+tool-lobby`: build the tool `lobby_connect`
>>>>>>>>> ___ >>>>>>>>> ___
@ -218,31 +218,31 @@ Arguments you can pass to this script:
>>>>>>>>> ___ >>>>>>>>> ___
* `-lib-32`: prevent building normal 32-bit `libsteam_api.so` * `+lib-32`: build normal 32-bit `libsteam_api.so`
* `-lib-64`: prevent building normal 64-bit `libsteam_api.so` * `+lib-64`: build normal 64-bit `libsteam_api.so`
>>>>>>>>> ___ >>>>>>>>> ___
* `-exp-lib-32`: prevent building experimental 32-bit `libsteam_api.so` * `+exp-lib-32`: build experimental 32-bit `libsteam_api.so`
* `-exp-lib-64`: prevent building experimental 64-bit `libsteam_api.so` * `+exp-lib-64`: build experimental 64-bit `libsteam_api.so`
* `-exp-client-32`: prevent building experimental steam client 64-bit `steamclient.so` * `+exp-client-32`: build experimental steam client 64-bit `steamclient.so`
* `-exp-client-64`: prevent building experimental steam client 64-bit `steamclient.so` * `+exp-client-64`: build experimental steam client 64-bit `steamclient.so`
>>>>>>>>> ___ >>>>>>>>> ___
* `-client-32`: prevent building steam client 32-bit `steamclient.so` * `+client-32`: build steam client 32-bit `steamclient.so`
* `-client-64`: prevent building steam client 64-bit `steamclient.so` * `+client-64`: build steam client 64-bit `steamclient.so`
>>>>>>>>> ___ >>>>>>>>> ___
* `-tool-clientldr`: prevent copying the tool `steamclient_loader` * `+tool-clientldr`: copy the tool `steamclient_loader`
>>>>>>>>> ___ >>>>>>>>> ___
* `-tool-itf-32`: prevent building the tool 32-bit `find_interfaces` * `+tool-itf-32`: build the tool 32-bit `find_interfaces`
* `-tool-itf-64`: prevent building the tool 64-bit `find_interfaces` * `+tool-itf-64`: build the tool 64-bit `find_interfaces`
* `-tool-lobby-32`: prevent building the tool 32-bit `lobby_connect` * `+tool-lobby-32`: build the tool 32-bit `lobby_connect`
* `-tool-lobby-64`: prevent building the tool 64-bit `lobby_connect` * `+tool-lobby-64`: build the tool 64-bit `lobby_connect`
>>>>>>>>> ___ >>>>>>>>> ___

View File

@ -15,21 +15,21 @@ for emu_file in "${required_files[@]}"; do
fi fi
done done
BUILD_LIB32=1 BUILD_LIB32=0
BUILD_LIB64=1 BUILD_LIB64=0
BUILD_EXP_LIB32=1 BUILD_EXP_LIB32=0
BUILD_EXP_LIB64=1 BUILD_EXP_LIB64=0
BUILD_CLIENT32=1 BUILD_CLIENT32=0
BUILD_CLIENT64=1 BUILD_CLIENT64=0
BUILD_EXPT_CLIENT32=1 BUILD_EXPT_CLIENT32=0
BUILD_EXPT_CLIENT64=1 BUILD_EXPT_CLIENT64=0
BUILD_TOOL_CLIENT_LDR=1 BUILD_TOOL_CLIENT_LDR=0
BUILD_TOOL_FIND_ITFS32=1 BUILD_TOOL_FIND_ITFS32=0
BUILD_TOOL_FIND_ITFS64=1 BUILD_TOOL_FIND_ITFS64=0
BUILD_TOOL_LOBBY32=1 BUILD_TOOL_LOBBY32=0
BUILD_TOOL_LOBBY64=1 BUILD_TOOL_LOBBY64=0
BUILD_LIB_NET_SOCKETS_32=0 BUILD_LIB_NET_SOCKETS_32=0
BUILD_LIB_NET_SOCKETS_64=0 BUILD_LIB_NET_SOCKETS_64=0
@ -63,32 +63,32 @@ for (( i=1; i<=$#; i++ )); do
echo "[X] Expected a build string" >&2; echo "[X] Expected a build string" >&2;
exit 1; exit 1;
} }
elif [[ "$var" = "-lib-32" ]]; then elif [[ "$var" = "+lib-32" ]]; then
BUILD_LIB32=0 BUILD_LIB32=1
elif [[ "$var" = "-lib-64" ]]; then elif [[ "$var" = "+lib-64" ]]; then
BUILD_LIB64=0 BUILD_LIB64=1
elif [[ "$var" = "-exp-lib-32" ]]; then elif [[ "$var" = "+exp-lib-32" ]]; then
BUILD_EXP_LIB32=0 BUILD_EXP_LIB32=1
elif [[ "$var" = "-exp-lib-64" ]]; then elif [[ "$var" = "+exp-lib-64" ]]; then
BUILD_EXP_LIB64=0 BUILD_EXP_LIB64=1
elif [[ "$var" = "-client-32" ]]; then elif [[ "$var" = "+client-32" ]]; then
BUILD_CLIENT32=0 BUILD_CLIENT32=1
elif [[ "$var" = "-client-64" ]]; then elif [[ "$var" = "+client-64" ]]; then
BUILD_CLIENT64=0 BUILD_CLIENT64=1
elif [[ "$var" = "-exp-client-32" ]]; then elif [[ "$var" = "+exp-client-32" ]]; then
BUILD_EXPT_CLIENT32=0 BUILD_EXPT_CLIENT32=1
elif [[ "$var" = "-exp-client-64" ]]; then elif [[ "$var" = "+exp-client-64" ]]; then
BUILD_EXPT_CLIENT64=0 BUILD_EXPT_CLIENT64=1
elif [[ "$var" = "-tool-clientldr" ]]; then elif [[ "$var" = "+tool-clientldr" ]]; then
BUILD_TOOL_CLIENT_LDR=0 BUILD_TOOL_CLIENT_LDR=1
elif [[ "$var" = "-tool-itf-32" ]]; then elif [[ "$var" = "+tool-itf-32" ]]; then
BUILD_TOOL_FIND_ITFS32=0 BUILD_TOOL_FIND_ITFS32=1
elif [[ "$var" = "-tool-itf-64" ]]; then elif [[ "$var" = "+tool-itf-64" ]]; then
BUILD_TOOL_FIND_ITFS64=0 BUILD_TOOL_FIND_ITFS64=1
elif [[ "$var" = "-tool-lobby-32" ]]; then elif [[ "$var" = "+tool-lobby-32" ]]; then
BUILD_TOOL_LOBBY32=0 BUILD_TOOL_LOBBY32=1
elif [[ "$var" = "-tool-lobby-64" ]]; then elif [[ "$var" = "vtool-lobby-64" ]]; then
BUILD_TOOL_LOBBY64=0 BUILD_TOOL_LOBBY64=1
elif [[ "$var" = "+lib-netsockets-32" ]]; then elif [[ "$var" = "+lib-netsockets-32" ]]; then
BUILD_LIB_NET_SOCKETS_32=1 BUILD_LIB_NET_SOCKETS_32=1
elif [[ "$var" = "+lib-netsockets-64" ]]; then elif [[ "$var" = "+lib-netsockets-64" ]]; then

View File

@ -17,24 +17,24 @@ for %%A in (
) )
) )
set /a BUILD_LIB32=1 set /a BUILD_LIB32=0
set /a BUILD_LIB64=1 set /a BUILD_LIB64=0
set /a BUILD_EXP_LIB32=1 set /a BUILD_EXP_LIB32=0
set /a BUILD_EXP_LIB64=1 set /a BUILD_EXP_LIB64=0
set /a BUILD_EXP_CLIENT32=1 set /a BUILD_EXP_CLIENT32=0
set /a BUILD_EXP_CLIENT64=1 set /a BUILD_EXP_CLIENT64=0
set /a BUILD_EXPCLIENT32=1 set /a BUILD_EXPCLIENT32=0
set /a BUILD_EXPCLIENT64=1 set /a BUILD_EXPCLIENT64=0
set /a BUILD_EXPCLIENT_LDR_32=1 set /a BUILD_EXPCLIENT_LDR_32=0
set /a BUILD_EXPCLIENT_LDR_64=1 set /a BUILD_EXPCLIENT_LDR_64=0
set /a BUILD_EXPCLIENT_EXTRA_32=0 set /a BUILD_EXPCLIENT_EXTRA_32=0
set /a BUILD_EXPCLIENT_EXTRA_64=0 set /a BUILD_EXPCLIENT_EXTRA_64=0
set /a BUILD_TOOL_FIND_ITFS=1 set /a BUILD_TOOL_FIND_ITFS=0
set /a BUILD_TOOL_LOBBY=1 set /a BUILD_TOOL_LOBBY=0
set /a BUILD_LIB_NET_SOCKETS_32=0 set /a BUILD_LIB_NET_SOCKETS_32=0
set /a BUILD_LIB_NET_SOCKETS_64=0 set /a BUILD_LIB_NET_SOCKETS_64=0
@ -58,34 +58,34 @@ set /a VERBOSE=0
:args_loop :args_loop
if "%~1"=="" ( if "%~1"=="" (
goto :args_loop_end goto :args_loop_end
) else if "%~1"=="-lib-32" ( ) else if "%~1"=="+lib-32" (
set /a BUILD_LIB32=0 set /a BUILD_LIB32=1
) else if "%~1"=="-lib-64" ( ) else if "%~1"=="+lib-64" (
set /a BUILD_LIB64=0 set /a BUILD_LIB64=1
) else if "%~1"=="-ex-lib-32" ( ) else if "%~1"=="+ex-lib-32" (
set /a BUILD_EXP_LIB32=0 set /a BUILD_EXP_LIB32=1
) else if "%~1"=="-ex-lib-64" ( ) else if "%~1"=="+ex-lib-64" (
set /a BUILD_EXP_LIB64=0 set /a BUILD_EXP_LIB64=1
) else if "%~1"=="-ex-client-32" ( ) else if "%~1"=="+ex-client-32" (
set /a BUILD_EXP_CLIENT32=0 set /a BUILD_EXP_CLIENT32=1
) else if "%~1"=="-ex-client-64" ( ) else if "%~1"=="+ex-client-64" (
set /a BUILD_EXP_CLIENT64=0 set /a BUILD_EXP_CLIENT64=1
) else if "%~1"=="-exclient-32" ( ) else if "%~1"=="+exclient-32" (
set /a BUILD_EXPCLIENT32=0 set /a BUILD_EXPCLIENT32=1
) else if "%~1"=="-exclient-64" ( ) else if "%~1"=="+exclient-64" (
set /a BUILD_EXPCLIENT64=0 set /a BUILD_EXPCLIENT64=1
) else if "%~1"=="-exclient-ldr-32" ( ) else if "%~1"=="+exclient-ldr-32" (
set /a BUILD_EXPCLIENT_LDR_32=0 set /a BUILD_EXPCLIENT_LDR_32=1
) else if "%~1"=="-exclient-ldr-64" ( ) else if "%~1"=="+exclient-ldr-64" (
set /a BUILD_EXPCLIENT_LDR_64=0 set /a BUILD_EXPCLIENT_LDR_64=1
) else if "%~1"=="+exclient-extra-32" ( ) else if "%~1"=="+exclient-extra-32" (
set /a BUILD_EXPCLIENT_EXTRA_32=1 set /a BUILD_EXPCLIENT_EXTRA_32=1
) else if "%~1"=="+exclient-extra-64" ( ) else if "%~1"=="+exclient-extra-64" (
set /a BUILD_EXPCLIENT_EXTRA_64=1 set /a BUILD_EXPCLIENT_EXTRA_64=1
) else if "%~1"=="-tool-itf" ( ) else if "%~1"=="+tool-itf" (
set /a BUILD_TOOL_FIND_ITFS=0 set /a BUILD_TOOL_FIND_ITFS=1
) else if "%~1"=="-tool-lobby" ( ) else if "%~1"=="+tool-lobby" (
set /a BUILD_TOOL_LOBBY=0 set /a BUILD_TOOL_LOBBY=1
) else if "%~1"=="+lib-netsockets-32" ( ) else if "%~1"=="+lib-netsockets-32" (
set /a BUILD_LIB_NET_SOCKETS_32=1 set /a BUILD_LIB_NET_SOCKETS_32=1
) else if "%~1"=="+lib-netsockets-64" ( ) else if "%~1"=="+lib-netsockets-64" (