Skip to content

Commit

Permalink
release workflow improvements
Browse files Browse the repository at this point in the history
- added bat scripts to automatically pack latest steam_api dlss and tools for generate_emu_config and migrate_gse
- removed previous steam_api dlls and 7z archives from generate_emu_config and migrate_gse
- removed previous generate_interfaces and lobby_connect 7z archives from generate_emu_config and migrate_gse
- moved some default required files for generate_emu_config from _DEFAULT\1 to _DEFAULT\0 folder, thus eliminating the need to duplicate them for every other default configuration folder you might create (_DEFAULT\2 - _DEFAULT\5)
  • Loading branch information
alex47exe committed Oct 7, 2024
1 parent 1c5a738 commit 805e46a
Show file tree
Hide file tree
Showing 86 changed files with 686 additions and 79 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/gen_emu_config-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ jobs:
with:
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"

## clone this for 7za.exe
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"

# download artifacts
- name: "Download emu build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: "build/win"
pattern: "emu-win-*"
merge-multiple: true

# env
- name: "Install env"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/migrate_gse-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ jobs:
with:
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"

## clone this for 7za.exe
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"

# download artifacts
- name: "Download emu build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: "build/win"
pattern: "emu-win-*"
merge-multiple: true

# env
- name: "Install env"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ jobs:
retention-days: 7

gen_emu_script-win:
needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in generate_emu_config
name: "Gen emu config win"
if: ${{ !cancelled() }}
uses: "./.github/workflows/gen_emu_config-build-win.yml"
Expand Down Expand Up @@ -247,6 +248,7 @@ jobs:
retention-days: 7

gen_emu_script-linux:
needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization)
name: "Gen emu config linux"
if: ${{ !cancelled() }}
uses: "./.github/workflows/gen_emu_config-build-linux.yml"
Expand Down Expand Up @@ -299,6 +301,7 @@ jobs:
retention-days: 7

migrate_gse_script-win:
needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in migrate_gse
name: "Migrate GSE win"
if: ${{ !cancelled() }}
uses: "./.github/workflows/migrate_gse-build-win.yml"
Expand Down Expand Up @@ -359,6 +362,7 @@ jobs:
retention-days: 7

migrate_gse_script-linux:
needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization)
name: Migrate GSE linux
if: ${{ !cancelled() }}
uses: "./.github/workflows/migrate_gse-build-linux.yml"
Expand Down
41 changes: 38 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,48 @@
/tools/generate_emu_config/.env*/
/tools/generate_emu_config/bin

/tools/generate_emu_config/backup/
/tools/generate_emu_config/_DEFAULT/0/steam_api.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api.7z
/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z

/tools/generate_emu_config/_DEFAULT/0/steam_api.7z
/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z

/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe

/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe

/tools/generate_emu_config/_OUTPUT/

/tools/generate_emu_config/login_temp/
/tools/generate_emu_config/output/
/tools/generate_emu_config/**/my_login.txt
/tools/generate_emu_config/top_owners_ids.txt

# migrate_gse
/tools/migrate_gse/.py*/
/tools/migrate_gse/.env*/
/tools/migrate_gse/bin

/tools/migrate_gse/_DEFAULT/0/steam_api.dll
/tools/migrate_gse/_DEFAULT/0/steam_api.7z
/tools/migrate_gse/_DEFAULT/0/steam_api64.dll
/tools/migrate_gse/_DEFAULT/0/steam_api64.7z

/tools/migrate_gse/_DEFAULT/0/steam_api.7z
/tools/migrate_gse/_DEFAULT/0/steam_api64.dll
/tools/migrate_gse/_DEFAULT/0/steam_api64.7z

/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe

/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe

/tools/migrate_gse/_OUTPUT/
3 changes: 3 additions & 0 deletions build_win_premake_gemu.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

call "build_win_premake.bat"
Binary file removed tools/generate_emu_config/_DEFAULT/0/steam_api.7z
Binary file not shown.
Binary file removed tools/generate_emu_config/_DEFAULT/0/steam_api.dll
Binary file not shown.
Binary file removed tools/generate_emu_config/_DEFAULT/0/steam_api64.7z
Binary file not shown.
Binary file removed tools/generate_emu_config/_DEFAULT/0/steam_api64.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
103 changes: 103 additions & 0 deletions tools/generate_emu_config/bat/_pack_api.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
@echo off
setlocal EnableDelayedExpansion
cd /d "%~dp0"

set /a "MAX_THREADS=2"
if defined NUMBER_OF_PROCESSORS (
:: use 70%
set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100"
if %MAX_THREADS% lss 1 (
set /a "MAX_THREADS=1"
)
)

set "ROOT=%cd%"
set "BUILD_DIR=..\..\..\build\win\vs2022"
set "OUT_DIR=..\build\package\win"

if not exist "%BUILD_DIR%\release\" (
1>&2 echo:release build target folder wasn't found
goto :end_script_with_err
)
if not exist "%BUILD_DIR%\debug\" (
1>&2 echo:debug build target folder wasn't found
goto :end_script_with_err
)

set /a "PKG_EXE_MEM_PERCENT=90"
set /a "PKG_EXE_DICT_SIZE_MB=384"
set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe"
if not exist "%PKG_EXE%" (
1>&2 echo:packager wasn't found
goto :end_script_with_err
)

::::::::::::::::::::::::::::::::::::::::::

echo:// packing latest steam_api.dll for generate_emu_config

set "ACHIVE_DIR=..\_DEFAULT\0\steam_api"

if exist "%ACHIVE_DIR%\" (
rmdir /s /q "%ACHIVE_DIR%"
)
mkdir "..\_DEFAULT\0\steam_api\release"
mkdir "..\_DEFAULT\0\steam_api\debug"

set "TARGET_DIR=%BUILD_DIR%\release"
xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\release\steam_api.dll"*
xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"*
set "TARGET_DIR=%BUILD_DIR%\debug"
xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\debug\steam_api.dll"*
rem xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"* rem do not overwrite dll with debug version

set "ACHIVE_FILE=..\_DEFAULT\0\steam_api.7z"
if exist "%ACHIVE_FILE%" (
del /f /q "%ACHIVE_FILE%"
)

call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || (
goto :end_script_with_err
)

rmdir /s /q "%ACHIVE_DIR%"

echo:// packing latest steam_api64.dll for generate_emu_config

set "ACHIVE_DIR=..\_DEFAULT\0\steam_api64"

if exist "%ACHIVE_DIR%\" (
rmdir /s /q "%ACHIVE_DIR%"
)
mkdir "..\_DEFAULT\0\steam_api64\release"
mkdir "..\_DEFAULT\0\steam_api64\debug"

set "TARGET_DIR=%BUILD_DIR%\release"
xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\release\steam_api64.dll"*
xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"*
set "TARGET_DIR=%BUILD_DIR%\debug"
xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\debug\steam_api64.dll"*
rem xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"* rem do not overwrite dll with debug version

set "ACHIVE_FILE=..\_DEFAULT\0\steam_api64.7z"
if exist "%ACHIVE_FILE%" (
del /f /q "%ACHIVE_FILE%"
)

call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || (
goto :end_script_with_err
)

rmdir /s /q "%ACHIVE_DIR%"

::::::::::::::::::::::::::::::::::::::::::

goto :end_script

:end_script
endlocal
exit /b 0

:end_script_with_err
endlocal
exit /b 1
95 changes: 95 additions & 0 deletions tools/generate_emu_config/bat/_pack_exe.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
@echo off
setlocal EnableDelayedExpansion
cd /d "%~dp0"

set /a "MAX_THREADS=2"
if defined NUMBER_OF_PROCESSORS (
:: use 70%
set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100"
if %MAX_THREADS% lss 1 (
set /a "MAX_THREADS=1"
)
)

set "ROOT=%cd%"
set "BUILD_DIR=..\..\..\build\win\vs2022"
set "OUT_DIR=..\build\package\win"

if not exist "%BUILD_DIR%\release\" (
1>&2 echo:release build target folder wasn't found
goto :end_script_with_err
)
if not exist "%BUILD_DIR%\debug\" (
1>&2 echo:debug build target folder wasn't found
goto :end_script_with_err
)

set /a "PKG_EXE_MEM_PERCENT=90"
set /a "PKG_EXE_DICT_SIZE_MB=384"
set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe"
if not exist "%PKG_EXE%" (
1>&2 echo:packager wasn't found
goto :end_script_with_err
)

::::::::::::::::::::::::::::::::::::::::::

echo:// packing latest generate_interfaces.exe for generate_emu_config

set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces"

if exist "%ACHIVE_DIR%\" (
rmdir /s /q "%ACHIVE_DIR%"
)
mkdir "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces"

set "TARGET_DIR=%BUILD_DIR%\release"
xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x32.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces.exe"*
xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x64.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces64.exe"*

set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces.7z"
if exist "%ACHIVE_FILE%" (
del /f /q "%ACHIVE_FILE%"
)

call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || (
goto :end_script_with_err
)

rmdir /s /q "%ACHIVE_DIR%"

echo:// packing latest lobby_connect.exe for generate_emu_config

set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect"

if exist "%ACHIVE_DIR%\" (
rmdir /s /q "%ACHIVE_DIR%"
)
mkdir "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect"

set "TARGET_DIR=%BUILD_DIR%\release"
xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x32.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect.exe"*
xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x64.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect64.exe"*

set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect.7z"
if exist "%ACHIVE_FILE%" (
del /f /q "%ACHIVE_FILE%"
)

call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || (
goto :end_script_with_err
)

rmdir /s /q "%ACHIVE_DIR%"

::::::::::::::::::::::::::::::::::::::::::

goto :end_script

:end_script
endlocal
exit /b 0

:end_script_with_err
endlocal
exit /b 1
3 changes: 3 additions & 0 deletions tools/generate_emu_config/rebuild_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ pyinstaller "stats_schema_achievement_gen\achievements_gen.py" --distpath "%OUT_
)
call "%SIGNER_TOOL%" "%OUT_DIR%\parse_achievements_schema\parse_achievements_schema.exe"

call ".\bat\_pack_api.bat"
call ".\bat\_pack_exe.bat"

xcopy /s /y /e "post_build" "%out_dir%\generate_emu_config\"
xcopy /s /y /e "_DEFAULT" "%out_dir%\generate_emu_config\_DEFAULT\"

Expand Down
Binary file removed tools/migrate_gse/_DEFAULT/0/steam_api.7z
Binary file not shown.
Binary file removed tools/migrate_gse/_DEFAULT/0/steam_api.dll
Binary file not shown.
Binary file removed tools/migrate_gse/_DEFAULT/0/steam_api64.7z
Binary file not shown.
Binary file removed tools/migrate_gse/_DEFAULT/0/steam_api64.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ARC_NAME]

extra_acw = extra_acw.zip
Binary file not shown.
Loading

0 comments on commit 805e46a

Please sign in to comment.