From 85335e7628d4805c8812114c8a072d46e2b33b00 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 09:55:37 +0200 Subject: [PATCH 1/9] updated sdk readme and added source to CREDITS.md --- CREDITS.md | 7 +++++++ generate_credits.bat | 2 +- sdk/Readme.txt | 22 +++++++++++++++++++++- sdk/source.txt | 4 +++- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 06c11551c..fd5102a3c 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -24,6 +24,7 @@ - [libs\stb](#libsstb) - [libs\utfcpp](#libsutfcpp) - [tools\steamclient_loader](#toolssteamclient_loader) +- [sdk](#sdk) ### third-party\build\win\cert\openssl @@ -2548,3 +2549,9 @@ https://github.com/Rat431/ColdAPI_Steam Original version of ColdClientLoader by Rat431. +### sdk + +#### INFO + +https://partner.steamgames.com/doc/sdk + diff --git a/generate_credits.bat b/generate_credits.bat index 1f3ea72bf..0e7ab5d20 100644 --- a/generate_credits.bat +++ b/generate_credits.bat @@ -8,7 +8,7 @@ if exist "%CREDITS_FILE%" ( del /f /s /q "%CREDITS_FILE%" ) -set "GLOB=third-party libs tools\steamclient_loader" +set "GLOB=third-party libs tools\steamclient_loader sdk" set "FILTER=SOURCE.txt" echo:# Many thanks for these sources>> "%CREDITS_FILE%" diff --git a/sdk/Readme.txt b/sdk/Readme.txt index 6077e3f4e..d597a28d1 100644 --- a/sdk/Readme.txt +++ b/sdk/Readme.txt @@ -1,6 +1,6 @@ ================================================================ -Copyright © 1996-2022, Valve Corporation, All rights reserved. +Copyright © 1996-2024, Valve Corporation, All rights reserved. ================================================================ @@ -8,6 +8,26 @@ Copyright © 1996-2022, Valve Corporation, All rights reserved. Welcome to the Steamworks SDK. For documentation please see our partner website at: http://partner.steamgames.com + +---------------------------------------------------------------- +v1.60 19th June 2024 +---------------------------------------------------------------- + +General +* CSteamAPIContext has been removed. Please switch to using the Steam accessors where appropriate. + +ISteamTimeline +* Added this new interface to allow games to provide information that supports the new Game Recording feature. See the [url=https://partner.steamgames.com/doc/features/timeline]Timeline[/url] documentation for more information. + +ISteamUGC +* Added 64 bit m_ulTotalFilesSize to SteamUGCDetails_t which is the correct size of the content for Workshop items are larger than 2,147,483,647 bytes. +* Added GetNumSupportedGameVersions() and GetSupportedGameVersionData() which can be used to determine what game beta branches a Workshop item supports/is valid for. +* Added SetAdminQuery() to allow ISteamUGC to be used in a tools like environment for users who have the appropriate privileges for the calling appid. + +ISteamApps +* Added API to allow the game to manage active beta branches. + + ---------------------------------------------------------------- v1.59 9th February 2024 ---------------------------------------------------------------- diff --git a/sdk/source.txt b/sdk/source.txt index 02802a5a3..e21c24e52 100644 --- a/sdk/source.txt +++ b/sdk/source.txt @@ -1 +1,3 @@ -https://partner.steamgames.com/doc/sdk \ No newline at end of file +#### INFO + +https://partner.steamgames.com/doc/sdk From 5700a5f886a1120276f6858c0f7cffe84f59429b Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:30:19 +0200 Subject: [PATCH 2/9] improved build_win_premake.bat, package_win.bat, rebuild_win.bat and recreate_venv_win.bat and and fixed a sign_helper error that didn't find the input file --- build_win_premake.bat | 31 ++-- package_win.bat | 40 +++-- tools/generate_emu_config/package_win.bat | 100 ++++++------ tools/generate_emu_config/rebuild_win.bat | 145 +++++++++--------- .../generate_emu_config/recreate_venv_win.bat | 48 +++--- tools/migrate_gse/package_win.bat | 100 ++++++------ tools/migrate_gse/rebuild_win.bat | 104 ++++++------- tools/migrate_gse/recreate_venv_win.bat | 48 +++--- 8 files changed, 316 insertions(+), 300 deletions(-) diff --git a/build_win_premake.bat b/build_win_premake.bat index 68d07f7c8..a9954be9c 100644 --- a/build_win_premake.bat +++ b/build_win_premake.bat @@ -21,7 +21,7 @@ set /a "BUILD_DEPS=0" ) else if "%~1" equ "--help" ( goto :help_page ) else ( - 1>&2 echo: invalid arg %~1 + 1>&2 echo:invalid arg %~1 goto :end_script_with_err ) @@ -32,15 +32,14 @@ set /a "BUILD_DEPS=0" :: check premake set "PREMAKE_EXE=third-party\common\win\premake\premake5.exe" if not exist "%PREMAKE_EXE%" ( - 1>&2 echo: premake wasn't found + 1>&2 echo:premake wasn't found goto :end_script_with_err ) :: build deps if %BUILD_DEPS% equ 1 ( set "CMAKE_GENERATOR=Visual Studio 17 2022" - call "%PREMAKE_EXE%" --file="premake5-deps.lua" --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022 - if !errorlevel! neq 0 ( + call "%PREMAKE_EXE%" --file="premake5-deps.lua" --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022 || ( goto :end_script_with_err ) goto :end_script @@ -49,7 +48,7 @@ set /a "BUILD_DEPS=0" :: check vswhere set "VSWHERE_EXE=third-party\common\win\vswhere\vswhere.exe" if not exist "%VSWHERE_EXE%" ( - 1>&2 echo: vswhere wasn't found + 1>&2 echo:vswhere wasn't found goto :end_script_with_err ) @@ -59,20 +58,19 @@ set /a "BUILD_DEPS=0" set "MSBUILD_EXE=%%~A\MSBuild\Current\Bin\MSBuild.exe" ) if not exist "%MSBUILD_EXE%" ( - 1>&2 echo: MSBuild wasn't found + 1>&2 echo:MSBuild wasn't found goto :end_script_with_err ) :: create .sln - call "%PREMAKE_EXE%" --file="premake5.lua" --genproto --dosstub --winrsrc --winsign --os=windows vs2022 - if %errorlevel% neq 0 ( + call "%PREMAKE_EXE%" --file="premake5.lua" --genproto --dosstub --winrsrc --winsign --os=windows vs2022 || ( goto :end_script_with_err ) :: check .sln set "SLN_FILE=build\project\vs2022\win\gbe.sln" if not exist "%SLN_FILE%" ( - 1>&2 echo: .sln file wasn't found + 1>&2 echo:.sln file wasn't found goto :end_script_with_err ) @@ -87,9 +85,8 @@ set /a "BUILD_DEPS=0" set "BUILD_PLATFORM=%%B" for %%C in (%BUILD_TARGETS%) do ( set "BUILD_TARGET=%%C" - echo. & echo: building !BUILD_TARGET! !BUILD_TYPE! !BUILD_PLATFORM! - call "%MSBUILD_EXE%" /nologo -m:%MAX_THREADS% -v:n /p:Configuration=!BUILD_TYPE!,Platform=!BUILD_PLATFORM! /target:!BUILD_TARGET! "%SLN_FILE%" - if !errorlevel! neq 0 ( + echo. & echo:building !BUILD_TARGET! !BUILD_TYPE! !BUILD_PLATFORM! + call "%MSBUILD_EXE%" /nologo -m:%MAX_THREADS% -v:n /p:Configuration=!BUILD_TYPE!,Platform=!BUILD_PLATFORM! /target:!BUILD_TARGET! "%SLN_FILE%" || ( goto :end_script_with_err ) ) @@ -98,20 +95,18 @@ set /a "BUILD_DEPS=0" goto :end_script -:: exit without error :end_script endlocal exit /b 0 -:: exit with error :end_script_with_err endlocal exit /b 1 :: show help page :help_page - echo: "%~nx0" [switches] - echo: switches: - echo: --deps: rebuild third-party dependencies - echo: --help: show this page + echo:"%~nx0" [switches] + echo:switches: + echo: --deps: rebuild third-party dependencies + echo: --help: show this page goto :end_script diff --git a/package_win.bat b/package_win.bat index 5e86da4b2..0efea6e89 100644 --- a/package_win.bat +++ b/package_win.bat @@ -11,17 +11,18 @@ if defined NUMBER_OF_PROCESSORS ( ) ) -set "BUILD_DIR=build\win" -set "OUT_DIR=build\package\win" +set "ROOT=%cd%" +set "BUILD_DIR=%ROOT%\build\win" +set "OUT_DIR=%ROOT%\build\package\win" if "%~1" equ "" ( - 1>&2 echo: missing build target folder arg + 1>&2 echo:missing build target folder arg goto :end_script_with_err ) set "TARGET_DIR=%BUILD_DIR%\%~1" if not exist "%TARGET_DIR%\" ( - 1>&2 echo: build target folder wasn't found + 1>&2 echo:build target folder wasn't found goto :end_script_with_err ) @@ -34,39 +35,39 @@ 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 + 1>&2 echo:packager wasn't found goto :end_script_with_err ) :::::::::::::::::::::::::::::::::::::::::: -echo: // copying readmes + example files +echo:// copying readmes + example files -xcopy /y /s /e /r "post_build\steam_settings.EXAMPLE\" "%TARGET_DIR%\steam_settings.EXAMPLE\" +xcopy /y /s /e /r "%ROOT%\post_build\steam_settings.EXAMPLE\" "%TARGET_DIR%\steam_settings.EXAMPLE\" -copy /y "post_build\README.release.md" "%TARGET_DIR%\" -copy /y "CHANGELOG.md" "%TARGET_DIR%\" -copy /y "CREDITS.md" "%TARGET_DIR%\" +copy /y "%ROOT%\post_build\README.release.md" "%TARGET_DIR%\" +copy /y "%ROOT%\CHANGELOG.md" "%TARGET_DIR%\" +copy /y "%ROOT%\CREDITS.md" "%TARGET_DIR%\" if %BUILD_DEBUG% equ 1 ( - copy /y "post_build\README.debug.md" "%TARGET_DIR%\" + copy /y "%ROOT%\post_build\README.debug.md" "%TARGET_DIR%\" ) if exist "%TARGET_DIR%\experimental\" ( - copy /y "post_build\README.experimental.md" "%TARGET_DIR%\experimental\" + copy /y "%ROOT%\post_build\README.experimental.md" "%TARGET_DIR%\experimental\" ) if exist "%TARGET_DIR%\steamclient_experimental\" ( - xcopy /y /s /e /r "post_build\win\ColdClientLoader.EXAMPLE\" "%TARGET_DIR%\steamclient_experimental\dll_injection.EXAMPLE\" - copy /y "post_build\README.experimental_steamclient.md" "%TARGET_DIR%\steamclient_experimental\" - copy /y "tools\steamclient_loader\win\ColdClientLoader.ini" "%TARGET_DIR%\steamclient_experimental\" + xcopy /y /s /e /r "%ROOT%\post_build\win\ColdClientLoader.EXAMPLE\" "%TARGET_DIR%\steamclient_experimental\dll_injection.EXAMPLE\" + copy /y "%ROOT%\post_build\README.experimental_steamclient.md" "%TARGET_DIR%\steamclient_experimental\" + copy /y "%ROOT%\tools\steamclient_loader\win\ColdClientLoader.ini" "%TARGET_DIR%\steamclient_experimental\" ) if exist "%TARGET_DIR%\tools\generate_interfaces\" ( - copy /y "post_build\README.generate_interfaces.md" "%TARGET_DIR%\tools\generate_interfaces\" + copy /y "%ROOT%\post_build\README.generate_interfaces.md" "%TARGET_DIR%\tools\generate_interfaces\" ) if exist "%TARGET_DIR%\tools\lobby_connect\" ( - copy /y "post_build\README.lobby_connect.md" "%TARGET_DIR%\tools\lobby_connect\" + copy /y "%ROOT%\post_build\README.lobby_connect.md" "%TARGET_DIR%\tools\lobby_connect\" ) :::::::::::::::::::::::::::::::::::::::::: @@ -88,19 +89,16 @@ if exist "%ACHIVE_FILE%" ( del /f /s /q "%ACHIVE_FILE%" ) -call "%PKG_EXE%" a "%ACHIVE_FILE%" ".\%TARGET_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+ -if %errorlevel% neq 0 ( +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%TARGET_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 ) goto :end_script -:: exit without error :end_script endlocal exit /b 0 -:: exit with error :end_script_with_err endlocal exit /b 1 diff --git a/tools/generate_emu_config/package_win.bat b/tools/generate_emu_config/package_win.bat index 17b88e830..18fcb2abf 100644 --- a/tools/generate_emu_config/package_win.bat +++ b/tools/generate_emu_config/package_win.bat @@ -1,48 +1,52 @@ -@echo off - -setlocal -pushd "%~dp0" - -set /a last_code=0 - -set "build_dir=bin\win" -set "out_dir=bin\package\win" - -set /a MEM_PERCENT=90 -set /a DICT_SIZE_MB=384 -set "packager=..\..\third-party\deps\win\7za\7za.exe" - -:: use 70% -if defined NUMBER_OF_PROCESSORS ( - set /a THREAD_COUNT=NUMBER_OF_PROCESSORS*70/100 -) else ( - set /a THREAD_COUNT=2 -) - -if not exist "%packager%" ( - 1>&2 echo "[X] packager app wasn't found" - set /a last_code=1 - goto :script_end -) - -if not exist "%build_dir%" ( - 1>&2 echo "[X] build folder wasn't found" - set /a last_code=1 - goto :script_end -) - -mkdir "%out_dir%" - -set "archive_file=%out_dir%\generate_emu_config-win.7z" -if exist "%archive_file%" ( - del /f /q "%archive_file%" -) - -"%packager%" a "%archive_file%" ".\%build_dir%\*" -t7z -slp -ssw -mx -myx -mmemuse=p%MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%DICT_SIZE_MB%m -mmt=%THREAD_COUNT% -mmtf+ -mtm- -mtc- -mta- -mtr+ - - -:script_end -popd -endlocal & ( - exit /b %last_code% -) +@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=%ROOT%\bin\win" +set "OUT_DIR=%ROOT%\bin\package\win" + +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 +) + +if not exist "%BUILD_DIR%" ( + 1>&2 echo:build folder wasn't found + goto :end_script_with_err +) + +if not exist "%OUT_DIR%" ( + mkdir "%OUT_DIR%" +) + +set "ACHIVE_FILE=%OUT_DIR%\generate_emu_config-win.7z" +if exist "%ACHIVE_FILE%" ( + del /f /s /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%BUILD_DIR%\*" -t7z -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 +) + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/generate_emu_config/rebuild_win.bat b/tools/generate_emu_config/rebuild_win.bat index 769c5e657..e63a02514 100644 --- a/tools/generate_emu_config/rebuild_win.bat +++ b/tools/generate_emu_config/rebuild_win.bat @@ -1,74 +1,71 @@ -@echo off - -setlocal -pushd "%~dp0" - -set "venv=.env-win" -set "out_dir=bin\win" -set "build_temp_dir=bin\tmp\win" -:: relative to build_temp_dir -set "icon_file=..\..\..\icon\Froyoshark-Enkel-Steam.ico" -set "signer_tool=..\..\third-party\build\win\cert\sign_helper.bat" - -set /a last_code=0 - -if not exist "%signer_tool%" ( - 1>&2 echo "[X] signing tool wasn't found" - set /a last_code=1 - goto :script_end -) - -if exist "%out_dir%" ( - rmdir /s /q "%out_dir%" -) -mkdir "%out_dir%" - -if exist "%build_temp_dir%" ( - rmdir /s /q "%build_temp_dir%" -) - -del /f /q "*.spec" - -call "%venv%\Scripts\activate.bat" - -echo building generate_emu_config... -pyinstaller "generate_emu_config.py" --distpath "%out_dir%" -y --clean --onedir --name "generate_emu_config" --noupx --console -i "%icon_file%" --collect-submodules "steam" --workpath "%build_temp_dir%" --specpath "%build_temp_dir%" || ( - set /a last_code=1 - goto :script_end -) -call "%signer_tool%" "%out_dir%\generate_emu_config\generate_emu_config.exe" - -echo building parse_controller_vdf... -pyinstaller "controller_config_generator\parse_controller_vdf.py" --distpath "%out_dir%" -y --clean --onedir --name "parse_controller_vdf" --noupx --console -i "NONE" --workpath "%build_temp_dir%" --specpath "%build_temp_dir%" || ( - set /a last_code=1 - goto :script_end -) -call "%signer_tool%" "%out_dir%\parse_controller_vdf\parse_controller_vdf.exe" - -echo building parse_achievements_schema... -pyinstaller "stats_schema_achievement_gen\achievements_gen.py" --distpath "%out_dir%" -y --clean --onedir --name "parse_achievements_schema" --noupx --console -i "NONE" --workpath "%build_temp_dir%" --specpath "%build_temp_dir%" || ( - set /a last_code=1 - goto :script_end -) -call "%signer_tool%" "%out_dir%\parse_achievements_schema\parse_achievements_schema.exe" - -copy /y "steam_default_icon_locked.jpg" "%out_dir%\generate_emu_config\" -copy /y "steam_default_icon_unlocked.jpg" "%out_dir%\generate_emu_config\" -copy /y "README.md" "%out_dir%\generate_emu_config\" -1>"%out_dir%\generate_emu_config\my_login.EXAMPLE.txt" echo Check the README -1>"%out_dir%\generate_emu_config\top_owners_ids.EXAMPLE.txt" echo Check the README -1>>"%out_dir%\generate_emu_config\top_owners_ids.EXAMPLE.txt" echo You can use a website like: https://steamladder.com/games/ - -echo: -echo ============= -echo Built inside: "%out_dir%\" - - -:script_end -if exist "%build_temp_dir%" ( - rmdir /s /q "%build_temp_dir%" -) -popd -endlocal & ( - exit /b %last_code% -) +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set "ROOT=%cd%" +set "VENV=%ROOT%\.env-win" +set "OUT_DIR=%ROOT%\bin\win" +set "BUILD_TEMP_DIR=%ROOT%\bin\tmp\win" +set "ICON_FILE=%ROOT%\icon\Froyoshark-Enkel-Steam.ico" + +set /a "LAST_ERR_CODE=0" + +set "SIGNER_TOOL=..\..\third-party\build\win\cert\sign_helper.bat" +if not exist "%SIGNER_TOOL%" ( + 1>&2 echo:signing tool wasn't found + set /a "LAST_ERR_CODE=1" + goto :end_script +) + +if exist "%OUT_DIR%" ( + rmdir /s /q "%OUT_DIR%" +) +mkdir "%OUT_DIR%" + +if exist "%BUILD_TEMP_DIR%" ( + rmdir /s /q "%BUILD_TEMP_DIR%" +) + +call "%VENV%\Scripts\activate.bat" + +echo:building generate_emu_config... +pyinstaller "generate_emu_config.py" --distpath "%OUT_DIR%" -y --clean --onedir --name "generate_emu_config" --noupx --console -i "%ICON_FILE%" --collect-submodules "steam" --workpath "%BUILD_TEMP_DIR%" --specpath "%BUILD_TEMP_DIR%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) +call "%SIGNER_TOOL%" "%OUT_DIR%\generate_emu_config\generate_emu_config.exe" + +echo:building parse_controller_vdf... +pyinstaller "controller_config_generator\parse_controller_vdf.py" --distpath "%OUT_DIR%" -y --clean --onedir --name "parse_controller_vdf" --noupx --console -i "NONE" --workpath "%BUILD_TEMP_DIR%" --specpath "%BUILD_TEMP_DIR%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) +call "%SIGNER_TOOL%" "%OUT_DIR%\parse_controller_vdf\parse_controller_vdf.exe" + +echo:building parse_achievements_schema... +pyinstaller "stats_schema_achievement_gen\achievements_gen.py" --distpath "%OUT_DIR%" -y --clean --onedir --name "parse_achievements_schema" --noupx --console -i "NONE" --workpath "%BUILD_TEMP_DIR%" --specpath "%BUILD_TEMP_DIR%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) +call "%SIGNER_TOOL%" "%OUT_DIR%\parse_achievements_schema\parse_achievements_schema.exe" + +copy /y "steam_default_icon_locked.jpg" "%OUT_DIR%\generate_emu_config\" +copy /y "steam_default_icon_unlocked.jpg" "%OUT_DIR%\generate_emu_config\" +copy /y "README.md" "%OUT_DIR%\generate_emu_config\" +echo Check the README>> "%OUT_DIR%\generate_emu_config\my_login.EXAMPLE.txt" +echo Check the README>> "%OUT_DIR%\generate_emu_config\top_owners_ids.EXAMPLE.txt" +echo You can use a website like: https://steamladder.com/games/>> "%OUT_DIR%\generate_emu_config\top_owners_ids.EXAMPLE.txt" + +echo: +echo:============= +echo:Built inside: "%OUT_DIR%\" + +goto :end_script + +:end_script + if exist "%BUILD_TEMP_DIR%" ( + rmdir /s /q "%BUILD_TEMP_DIR%" + ) + + endlocal + exit /b %LAST_ERR_CODE% diff --git a/tools/generate_emu_config/recreate_venv_win.bat b/tools/generate_emu_config/recreate_venv_win.bat index 4b4a74940..9b93127e2 100644 --- a/tools/generate_emu_config/recreate_venv_win.bat +++ b/tools/generate_emu_config/recreate_venv_win.bat @@ -1,19 +1,29 @@ -@echo off - -cd /d "%~dp0" - -set "venv=.env-win" -set "reqs_file=requirements.txt" - -if exist "%venv%" ( - rmdir /s /q "%venv%" -) - -python -m venv "%venv%" || exit /b 1 -timeout /t 1 /nobreak -call "%venv%\Scripts\activate.bat" -pip install -r "%reqs_file%" -set /a exit_code=errorlevel - -call "%venv%\Scripts\deactivate.bat" -exit /b %exit_code% +@echo off +cd /d "%~dp0" + +set "ROOT=%cd%" +set "VENV=%ROOT%\.env-win" +set "REQS_FILE=%ROOT%\requirements.txt" + +set /a "LAST_ERR_CODE=0" + +if exist "%VENV%" ( + rmdir /s /q "%VENV%" +) + +python -m venv "%VENV%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) + +timeout /t 1 /nobreak + +call "%VENV%\Scripts\activate.bat" +pip install -r "%REQS_FILE%" +set /a "LAST_ERR_CODE=%ERRORLEVEL%" +call "%VENV%\Scripts\deactivate.bat" + +goto :end_script + +:end_script + exit /b %LAST_ERR_CODE% diff --git a/tools/migrate_gse/package_win.bat b/tools/migrate_gse/package_win.bat index 71a4de5c6..d595b882c 100644 --- a/tools/migrate_gse/package_win.bat +++ b/tools/migrate_gse/package_win.bat @@ -1,48 +1,52 @@ -@echo off - -setlocal -pushd "%~dp0" - -set /a last_code=0 - -set "build_dir=bin\win" -set "out_dir=bin\package\win" - -set /a MEM_PERCENT=90 -set /a DICT_SIZE_MB=384 -set "packager=..\..\third-party\deps\win\7za\7za.exe" - -:: use 70% -if defined NUMBER_OF_PROCESSORS ( - set /a THREAD_COUNT=NUMBER_OF_PROCESSORS*70/100 -) else ( - set /a THREAD_COUNT=2 -) - -if not exist "%packager%" ( - 1>&2 echo "[X] packager app wasn't found" - set /a last_code=1 - goto :script_end -) - -if not exist "%build_dir%" ( - 1>&2 echo "[X] build folder wasn't found" - set /a last_code=1 - goto :script_end -) - -mkdir "%out_dir%" - -set "archive_file=%out_dir%\migrate_gse-win.7z" -if exist "%archive_file%" ( - del /f /q "%archive_file%" -) - -"%packager%" a "%archive_file%" ".\%build_dir%\*" -t7z -slp -ssw -mx -myx -mmemuse=p%MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%DICT_SIZE_MB%m -mmt=%THREAD_COUNT% -mmtf+ -mtm- -mtc- -mta- -mtr+ - - -:script_end -popd -endlocal & ( - exit /b %last_code% -) +@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=%ROOT%\bin\win" +set "OUT_DIR=%ROOT%\bin\package\win" + +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 +) + +if not exist "%BUILD_DIR%" ( + 1>&2 echo:build folder wasn't found + goto :end_script_with_err +) + +if not exist "%OUT_DIR%" ( + mkdir "%OUT_DIR%" +) + +set "ACHIVE_FILE=%OUT_DIR%\migrate_gse-win.7z" +if exist "%ACHIVE_FILE%" ( + del /f /s /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%BUILD_DIR%\*" -t7z -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 +) + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/migrate_gse/rebuild_win.bat b/tools/migrate_gse/rebuild_win.bat index d8df6fd1b..c349746f3 100644 --- a/tools/migrate_gse/rebuild_win.bat +++ b/tools/migrate_gse/rebuild_win.bat @@ -1,53 +1,51 @@ -@echo off - -setlocal -pushd "%~dp0" - -set "venv=.env-win" -set "out_dir=bin\win" -set "build_temp_dir=bin\tmp\win" -set "signer_tool=..\..\third-party\build\win\cert\sign_helper.bat" - -set /a last_code=0 - -if not exist "%signer_tool%" ( - 1>&2 echo "[X] signing tool wasn't found" - set /a last_code=1 - goto :script_end -) - -if exist "%out_dir%" ( - rmdir /s /q "%out_dir%" -) -mkdir "%out_dir%" - -if exist "%build_temp_dir%" ( - rmdir /s /q "%build_temp_dir%" -) - -del /f /q "*.spec" - -call "%venv%\Scripts\activate.bat" - -echo building migrate_gse... -pyinstaller "main.py" --distpath "%out_dir%" -y --clean --onedir --name "migrate_gse" --noupx --console -i "NONE" --workpath "%build_temp_dir%" --specpath "%build_temp_dir%" || ( - set /a last_code=1 - goto :script_end -) -call "%signer_tool%" "%out_dir%\migrate_gse\migrate_gse.exe" - -copy /y README.md "%out_dir%\migrate_gse\" - -echo: -echo ============= -echo Built inside: "%out_dir%\" - - -:script_end -if exist "%build_temp_dir%" ( - rmdir /s /q "%build_temp_dir%" -) -popd -endlocal & ( - exit /b %last_code% -) +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set "ROOT=%cd%" +set "VENV=%ROOT%\.env-win" +set "OUT_DIR=%ROOT%\bin\win" +set "BUILD_TEMP_DIR=%ROOT%\bin\tmp\win" + +set /a "LAST_ERR_CODE=0" + +set "SIGNER_TOOL=..\..\third-party\build\win\cert\sign_helper.bat" +if not exist "%SIGNER_TOOL%" ( + 1>&2 echo:signing tool wasn't found + set /a "LAST_ERR_CODE=1" + goto :end_script +) + +if exist "%OUT_DIR%" ( + rmdir /s /q "%OUT_DIR%" +) +mkdir "%OUT_DIR%" + +if exist "%BUILD_TEMP_DIR%" ( + rmdir /s /q "%BUILD_TEMP_DIR%" +) + +call "%VENV%\Scripts\activate.bat" + +echo:building migrate_gse... +pyinstaller "main.py" --distpath "%OUT_DIR%" -y --clean --onedir --name "migrate_gse" --noupx --console -i "NONE" --workpath "%BUILD_TEMP_DIR%" --specpath "%BUILD_TEMP_DIR%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) +call "%SIGNER_TOOL%" "%OUT_DIR%\migrate_gse\migrate_gse.exe" + +copy /y "README.md" "%out_dir%\migrate_gse\" + +echo: +echo:============= +echo:Built inside: "%OUT_DIR%\" + +goto :end_script + +:end_script + if exist "%BUILD_TEMP_DIR%" ( + rmdir /s /q "%BUILD_TEMP_DIR%" + ) + + endlocal + exit /b %LAST_ERR_CODE% diff --git a/tools/migrate_gse/recreate_venv_win.bat b/tools/migrate_gse/recreate_venv_win.bat index 4b4a74940..9b93127e2 100644 --- a/tools/migrate_gse/recreate_venv_win.bat +++ b/tools/migrate_gse/recreate_venv_win.bat @@ -1,19 +1,29 @@ -@echo off - -cd /d "%~dp0" - -set "venv=.env-win" -set "reqs_file=requirements.txt" - -if exist "%venv%" ( - rmdir /s /q "%venv%" -) - -python -m venv "%venv%" || exit /b 1 -timeout /t 1 /nobreak -call "%venv%\Scripts\activate.bat" -pip install -r "%reqs_file%" -set /a exit_code=errorlevel - -call "%venv%\Scripts\deactivate.bat" -exit /b %exit_code% +@echo off +cd /d "%~dp0" + +set "ROOT=%cd%" +set "VENV=%ROOT%\.env-win" +set "REQS_FILE=%ROOT%\requirements.txt" + +set /a "LAST_ERR_CODE=0" + +if exist "%VENV%" ( + rmdir /s /q "%VENV%" +) + +python -m venv "%VENV%" || ( + set /a "LAST_ERR_CODE=1" + goto :end_script +) + +timeout /t 1 /nobreak + +call "%VENV%\Scripts\activate.bat" +pip install -r "%REQS_FILE%" +set /a "LAST_ERR_CODE=%ERRORLEVEL%" +call "%VENV%\Scripts\deactivate.bat" + +goto :end_script + +:end_script + exit /b %LAST_ERR_CODE% From a506b8013153b91d8a653f893abcb17fba6c4c26 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:30:38 +0200 Subject: [PATCH 3/9] removed first line of .gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index ba8e6f4f3..101d0a063 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ - [submodule "third-party/build/win"] path = third-party/build/win url = ./ From 00ede97f15df2ea8dd720395bffa32c8d27f6b96 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:30:57 +0200 Subject: [PATCH 4/9] updated .gitignore --- .gitignore | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 23f1c1831..f9e982064 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,32 @@ -/.vs/ -/.vscode/ +# IDE +**/.vs +**/.vscode -/build/ +# PYTHON +**/.venv +**/__pycache__ -/proto_gen/ +# PROTOBUF +/proto_gen -/crash_printer/tests/crash_test/ -/resources/win/file_dos_stub/build/ +# SPECIFIC +/build +/third-party +# TOOLS + +# generate_emu_config /tools/generate_emu_config/.py*/ -/tools/generate_emu_config/.venv*/ /tools/generate_emu_config/.env*/ -/tools/generate_emu_config/.vscode/ +/tools/generate_emu_config/bin + /tools/generate_emu_config/backup/ -/tools/generate_emu_config/bin/ /tools/generate_emu_config/login_temp/ /tools/generate_emu_config/output/ -/tools/generate_emu_config/**/__pycache__/ /tools/generate_emu_config/**/my_login.txt /tools/generate_emu_config/top_owners_ids.txt +# migrate_gse /tools/migrate_gse/.py*/ -/tools/migrate_gse/.venv*/ /tools/migrate_gse/.env*/ -/tools/migrate_gse/.vscode/ -/tools/migrate_gse/bin/ -/tools/migrate_gse/**/__pycache__/ - -/third-party/ +/tools/migrate_gse/bin From c302fa26382596c770072179ad26e4cf6776aec6 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:31:51 +0200 Subject: [PATCH 5/9] added .editorconfig for compatible IDEs --- .editorconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..0709045d8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +max_line_length = 120 + +[*.py] +indent_size = 4 + +[*.h] +indent_size = 4 + +[*.cpp] +indent_size = 4 From a75ba5c9bd796d93c9566053e4688def4c9c2aed Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:36:17 +0200 Subject: [PATCH 6/9] improved generate_credits.bat --- generate_credits.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate_credits.bat b/generate_credits.bat index 0e7ab5d20..4ad6b6b33 100644 --- a/generate_credits.bat +++ b/generate_credits.bat @@ -2,7 +2,8 @@ setlocal EnableDelayedExpansion cd /d "%~dp0" -set "CREDITS_FILE=CREDITS.md" +set "ROOT=%cd%" +set "CREDITS_FILE=%ROOT%\CREDITS.md" if exist "%CREDITS_FILE%" ( del /f /s /q "%CREDITS_FILE%" From 971e60c85d678fd17bbeecec1fb839440c4bd7f9 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 11:37:01 +0200 Subject: [PATCH 7/9] removed /s option from del command in .bat files --- generate_credits.bat | 2 +- package_win.bat | 2 +- tools/generate_emu_config/package_win.bat | 2 +- tools/migrate_gse/package_win.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generate_credits.bat b/generate_credits.bat index 4ad6b6b33..e3bad09be 100644 --- a/generate_credits.bat +++ b/generate_credits.bat @@ -6,7 +6,7 @@ set "ROOT=%cd%" set "CREDITS_FILE=%ROOT%\CREDITS.md" if exist "%CREDITS_FILE%" ( - del /f /s /q "%CREDITS_FILE%" + del /f /q "%CREDITS_FILE%" ) set "GLOB=third-party libs tools\steamclient_loader sdk" diff --git a/package_win.bat b/package_win.bat index 0efea6e89..202da68e5 100644 --- a/package_win.bat +++ b/package_win.bat @@ -86,7 +86,7 @@ for %%A in ("%ACHIVE_DIR%") do ( ) if exist "%ACHIVE_FILE%" ( - del /f /s /q "%ACHIVE_FILE%" + del /f /q "%ACHIVE_FILE%" ) call "%PKG_EXE%" a "%ACHIVE_FILE%" "%TARGET_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+ || ( diff --git a/tools/generate_emu_config/package_win.bat b/tools/generate_emu_config/package_win.bat index 18fcb2abf..9c95bfef7 100644 --- a/tools/generate_emu_config/package_win.bat +++ b/tools/generate_emu_config/package_win.bat @@ -34,7 +34,7 @@ if not exist "%OUT_DIR%" ( set "ACHIVE_FILE=%OUT_DIR%\generate_emu_config-win.7z" if exist "%ACHIVE_FILE%" ( - del /f /s /q "%ACHIVE_FILE%" + del /f /q "%ACHIVE_FILE%" ) call "%PKG_EXE%" a "%ACHIVE_FILE%" "%BUILD_DIR%\*" -t7z -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+ || ( diff --git a/tools/migrate_gse/package_win.bat b/tools/migrate_gse/package_win.bat index d595b882c..d9c71a3c0 100644 --- a/tools/migrate_gse/package_win.bat +++ b/tools/migrate_gse/package_win.bat @@ -34,7 +34,7 @@ if not exist "%OUT_DIR%" ( set "ACHIVE_FILE=%OUT_DIR%\migrate_gse-win.7z" if exist "%ACHIVE_FILE%" ( - del /f /s /q "%ACHIVE_FILE%" + del /f /q "%ACHIVE_FILE%" ) call "%PKG_EXE%" a "%ACHIVE_FILE%" "%BUILD_DIR%\*" -t7z -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+ || ( From 1b68c4bb0e27aa18a78cfa0c3db850aba99cdaab Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 12:49:34 +0200 Subject: [PATCH 8/9] formatted the .yml workflows, updated the python version of migrate_gse to v3.12 and updated softprops/action-gh-release to v2 --- .github/workflows/emu-build-all-linux.yml | 108 +++--- .github/workflows/emu-build-all-win.yml | 112 +++--- .github/workflows/emu-deps-linux.yml | 128 +++---- .github/workflows/emu-deps-win.yml | 118 +++--- .github/workflows/emu-pull-request.yml | 32 +- .../workflows/gen_emu_config-build-linux.yml | 68 ++-- .../workflows/gen_emu_config-build-win.yml | 90 ++--- .../workflows/gen_emu_config-pull-request.yml | 18 +- .github/workflows/migrate_gse-build-linux.yml | 68 ++-- .github/workflows/migrate_gse-build-win.yml | 94 ++--- .../workflows/migrate_gse-pull-request.yml | 14 +- .github/workflows/release.yml | 361 +++++++++--------- 12 files changed, 599 insertions(+), 612 deletions(-) diff --git a/.github/workflows/emu-build-all-linux.yml b/.github/workflows/emu-build-all-linux.yml index fdd15db64..2e33c3d4d 100644 --- a/.github/workflows/emu-build-all-linux.yml +++ b/.github/workflows/emu-build-all-linux.yml @@ -1,4 +1,4 @@ -name: Build emu (Linux) +name: "Build emu (Linux)" on: workflow_call: @@ -7,88 +7,90 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: - PREMAKE_ACTION: gmake2 - DEPS_CACHE_KEY: emu-deps-linux - DEPS_CACHE_DIR: build/deps/linux + PREMAKE_ACTION: "gmake2" + DEPS_CACHE_KEY: "emu-deps-linux" + DEPS_CACHE_DIR: "build/deps/linux" PACKAGE_BASE_DIR: "build/package/linux" - THIRD_PARTY_BASE_DIR: 'third-party' - + THIRD_PARTY_BASE_DIR: "third-party" + jobs: deps: - name: Restore or build deps + name: "Restore or build deps" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-deps-linux.yml + uses: "./.github/workflows/emu-deps-linux.yml" builds-matrix-linux: - name: build - needs: [ deps ] - runs-on: ubuntu-24.04 + name: "build" + needs: ["deps"] + runs-on: "ubuntu-24.04" if: ${{ !cancelled() }} continue-on-error: true - + strategy: fail-fast: false matrix: prj: [ - # regular api - 'api_regular', 'steamclient_regular', - # api + client (experimental) - 'api_experimental', 'steamclient_experimental', - # tools - 'tool_lobby_connect', 'tool_generate_interfaces', - ] - arch: [ 'x64', 'x32', ] - cfg: [ 'debug', 'release', ] - - + # regular api + "api_regular", + "steamclient_regular", + # api + client (experimental) + "api_experimental", + "steamclient_experimental", + # tools + "tool_lobby_connect", + "tool_generate_interfaces", + ] + arch: ["x64", "x32"] + cfg: ["debug", "release"] + steps: -### clone branch - - name: Checkout branch + # clone branch + - name: "Checkout branch" uses: actions/checkout@v4 -### deps - - name: Restore deps - id: emu-deps-cache-step + # deps + - name: "Restore deps" + id: "emu-deps-cache-step" uses: actions/cache@v4 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/linux) + # extra helpers/tools, these are not built inside the deps build dir + - name: "Clone third-party build helpers (common/linux)" uses: actions/checkout@v4 with: - ref: 'third-party/common/linux' + ref: "third-party/common/linux" path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux" - - name: Clone third-party build helpers (build/linux) + - name: "Clone third-party build helpers (build/linux)" uses: actions/checkout@v4 with: - ref: 'third-party/build/linux' + ref: "third-party/build/linux" path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux" -### fix folder permissions! not sure why this fails - # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - shell: bash - working-directory: ${{ github.workspace }} + # fix folder permissions! not sure why this fails + # nested subdirs "build/linux/release" cause permission problems + - name: "Give all permissions to repo folder" + shell: "bash" + working-directory: "${{ github.workspace }}" run: sudo chmod -R 777 "${{ github.workspace }}" -### generate project files - - name: Generate project files - shell: bash - working-directory: ${{ github.workspace }} + # generate project files + - name: "Generate project files" + shell: "bash" + working-directory: "${{ github.workspace }}" run: | sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --genproto --emubuild=${{ github.sha }} --os=linux gmake2 -## mandatory Linux packages - - name: Install required packages - shell: bash + # mandatory Linux packages + - name: "Install required packages" + shell: "bash" run: | sudo apt update -y sudo apt install -y coreutils # echo, printf, etc... @@ -100,22 +102,22 @@ jobs: sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h) # sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff -### build target - - name: Build target - shell: bash - working-directory: ${{ github.workspace }}/build/project/gmake2/linux + # build target + - name: "Build target" + shell: "bash" + working-directory: "${{ github.workspace }}/build/project/gmake2/linux" run: | echo "dry run..." make -n -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }} echo "actual run..." make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }} -### upload artifact/package to github Actions - - name: Upload target package + # upload artifact/package to github Actions + - name: "Upload target package" uses: actions/upload-artifact@v4 with: name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}" path: "build/linux" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 1 diff --git a/.github/workflows/emu-build-all-win.yml b/.github/workflows/emu-build-all-win.yml index 0e8712fc6..e05a8f9e5 100644 --- a/.github/workflows/emu-build-all-win.yml +++ b/.github/workflows/emu-build-all-win.yml @@ -1,4 +1,4 @@ -name: Build emu (Windows) +name: "Build emu (Windows)" on: workflow_call: @@ -7,104 +7,108 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: - PREMAKE_ACTION: vs2022 - DEPS_CACHE_KEY: emu-deps-win - DEPS_CACHE_DIR: build/deps/win - - THIRD_PARTY_BASE_DIR: 'third-party' + PREMAKE_ACTION: "vs2022" + DEPS_CACHE_KEY: "emu-deps-win" + DEPS_CACHE_DIR: "build/deps/win" + + THIRD_PARTY_BASE_DIR: "third-party" jobs: deps: - name: Restore or build deps + name: "Restore or build deps" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-deps-win.yml + uses: "./.github/workflows/emu-deps-win.yml" builds-matrix-win: - name: build - needs: [ deps ] - runs-on: windows-2022 + 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', - # tools - 'tool_lobby_connect', 'tool_generate_interfaces', - ] - arch: [ 'x64', 'Win32', ] - cfg: [ 'debug', 'release', ] - + # 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", + # tools + "tool_lobby_connect", + "tool_generate_interfaces", + ] + arch: ["x64", "Win32"] + cfg: ["debug", "release"] + steps: -### on Windows Git will auto change line ending to CRLF, not preferable - - name: Ensure LF line ending - shell: cmd + # 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 -### ensure we have msbuild - - name: Add MSBuild to PATH + # ensure we have msbuild + - name: "Add MSBuild to PATH" uses: microsoft/setup-msbuild@v2 -### clone branch - - name: Checkout branch + # clone branch + - name: "Checkout branch" uses: actions/checkout@v4 -### deps - - name: Restore deps - id: emu-deps-cache-step + # deps + - name: "Restore deps" + id: "emu-deps-cache-step" uses: actions/cache@v4 with: - key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }} - path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }} + 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) + # extra helpers/tools, these are not built inside the deps build dir + - name: "Clone third-party build helpers (common/win)" uses: actions/checkout@v4 with: - ref: 'third-party/common/win' + ref: "third-party/common/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win" - - name: Clone third-party deps (build/win) + - name: "Clone third-party deps (build/win)" uses: actions/checkout@v4 with: - ref: 'third-party/build/win' + 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 }} + # 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 + # build target + - name: "Build target" + shell: "cmd" + working-directory: "${{ github.workspace }}/build/project/vs2022/win" run: | msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln -### upload artifact/package to github Actions - - name: Upload target package + # upload artifact/package to github Actions + - name: "Upload target package" uses: actions/upload-artifact@v4 with: name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}" path: "build/win" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 1 diff --git a/.github/workflows/emu-deps-linux.yml b/.github/workflows/emu-deps-linux.yml index 0e8093dbd..6d7c4e03e 100644 --- a/.github/workflows/emu-deps-linux.yml +++ b/.github/workflows/emu-deps-linux.yml @@ -1,4 +1,4 @@ -name: Emu third-party dependencies (Linux) +name: "Emu third-party dependencies (Linux)" on: workflow_call: @@ -7,82 +7,82 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: - PREMAKE_ACTION: gmake2 - DEPS_CACHE_KEY: emu-deps-linux - DEPS_CACHE_DIR: build/deps/linux + PREMAKE_ACTION: "gmake2" + DEPS_CACHE_KEY: "emu-deps-linux" + DEPS_CACHE_DIR: "build/deps/linux" PACKAGE_BASE_DIR: "build/package/linux" - THIRD_PARTY_BASE_DIR: 'third-party' - + THIRD_PARTY_BASE_DIR: "third-party" + jobs: deps-build: - runs-on: ubuntu-24.04 + runs-on: "ubuntu-24.04" if: ${{ !cancelled() }} steps: - - name: Lookup cache for deps - id: emu-deps-cache-step - uses: actions/cache@v4 - with: - key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }} - path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }} + - name: "Lookup cache for deps" + id: "emu-deps-cache-step" + uses: actions/cache@v4 + with: + key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}" + path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}" - # we need branch because it has build scripts - - name: Checkout branch - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 + # we need branch because it has build scripts + - name: "Checkout branch" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 - - name: Clone third-party deps (common/linux) - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - ref: 'third-party/common/linux' - path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux" + - name: "Clone third-party deps (common/linux)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + ref: "third-party/common/linux" + path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux" - - name: Clone third-party deps (deps/linux) - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - ref: 'third-party/deps/linux' - path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux" + - name: "Clone third-party deps (deps/linux)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + ref: "third-party/deps/linux" + path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux" - - name: Clone third-party deps (deps/common) - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - ref: 'third-party/deps/common' - path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common" + - name: "Clone third-party deps (deps/common)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + ref: "third-party/deps/common" + path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common" -### fix folder permissions! not sure why this fails - # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - shell: bash - working-directory: ${{ github.workspace }} - run: sudo chmod -R 777 "${{ github.workspace }}" + # fix folder permissions! not sure why this fails + # nested subdirs "build/linux/release" cause permission problems + - name: "Give all permissions to repo folder" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + shell: "bash" + working-directory: "${{ github.workspace }}" + run: sudo chmod -R 777 "${{ github.workspace }}" -## mandatory Linux packages - - name: Install required packages - shell: bash - run: | - sudo apt update -y - sudo apt install -y coreutils # echo, printf, etc... - sudo apt install -y build-essential - sudo apt install -y gcc-multilib # needed for 32-bit builds - sudo apt install -y g++-multilib - # sudo apt install -y clang - sudo apt install -y libglx-dev # needed for overlay build (header files such as GL/glx.h) - sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h) - # sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff + # mandatory Linux packages + - name: "Install required packages" + shell: "bash" + run: | + sudo apt update -y + sudo apt install -y coreutils # echo, printf, etc... + sudo apt install -y build-essential + sudo apt install -y gcc-multilib # needed for 32-bit builds + sudo apt install -y g++-multilib + # sudo apt install -y clang + sudo apt install -y libglx-dev # needed for overlay build (header files such as GL/glx.h) + sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h) + # sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff - - name: Build deps - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - shell: bash - working-directory: ${{ github.workspace }} - run: | - export CMAKE_GENERATOR="Unix Makefiles" - sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 - ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=linux gmake2 + - name: "Build deps" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + shell: "bash" + working-directory: "${{ github.workspace }}" + run: | + export CMAKE_GENERATOR="Unix Makefiles" + sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 + ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=linux gmake2 diff --git a/.github/workflows/emu-deps-win.yml b/.github/workflows/emu-deps-win.yml index 10ddffcac..4daec42c8 100644 --- a/.github/workflows/emu-deps-win.yml +++ b/.github/workflows/emu-deps-win.yml @@ -1,4 +1,4 @@ -name: Emu third-party dependencies (Windows) +name: "Emu third-party dependencies (Windows)" on: workflow_call: @@ -7,76 +7,76 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: - PREMAKE_ACTION: vs2022 - DEPS_CACHE_KEY: emu-deps-win - DEPS_CACHE_DIR: build/deps/win - + 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' + THIRD_PARTY_BASE_DIR: "third-party" jobs: deps-build: - runs-on: windows-2022 + 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 + # 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@v4 - 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 + - name: "Lookup cache for deps" + id: "emu-deps-cache-step" + uses: actions/cache@v4 + 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@v4 + # we need branch because it has build scripts + - name: "Checkout branch" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 - - name: Clone third-party deps (common/win) - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - ref: 'third-party/common/win' - path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win" + - name: "Clone third-party deps (common/win)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + 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@v4 - with: - ref: 'third-party/deps/win' - path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" + - name: "Clone third-party deps (deps/win)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + 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@v4 - with: - ref: 'third-party/deps/common' - path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common" + - name: "Clone third-party deps (deps/common)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + ref: "third-party/deps/common" + path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common" - - name: Clone third-party deps (common/win) - if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - ref: 'third-party/common/win' - path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win" + - name: "Clone third-party deps (common/win)" + if: steps.emu-deps-cache-step.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + ref: "third-party/common/win" + path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win" - - 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=2 --verbose --clean --os=windows vs2022 + - 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=2 --verbose --clean --os=windows vs2022 diff --git a/.github/workflows/emu-pull-request.yml b/.github/workflows/emu-pull-request.yml index 4c99f1b15..eb25a2c59 100644 --- a/.github/workflows/emu-pull-request.yml +++ b/.github/workflows/emu-pull-request.yml @@ -1,30 +1,30 @@ -name: Emu PR +name: "Emu PR" on: pull_request: - branches: [ "dev" ] + branches: ["dev"] paths-ignore: - - '**/*.md' - - 'dev.notes/**' - - 'post_build/**' - - 'z_original_repo_files/**' - - 'sdk/*.txt' - - 'LICENSE' + - "**/*.md" + - "dev.notes/**" + - "post_build/**" + - "z_original_repo_files/**" + - "sdk/*.txt" + - "LICENSE" # tools - - 'tools/generate_emu_config/**' - - 'tools/migrate_gse/**' - - 'tools/steamclient_loader/linux/**' # these are just scripts, not built + - "tools/generate_emu_config/**" + - "tools/migrate_gse/**" + - "tools/steamclient_loader/linux/**" # these are just scripts, not built permissions: - contents: write + contents: "write" jobs: emu-win-all: - name: win + name: "win" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-build-all-win.yml + uses: "./.github/workflows/emu-build-all-win.yml" emu-linux-all: - name: linux + name: "linux" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-build-all-linux.yml + uses: "./.github/workflows/emu-build-all-linux.yml" diff --git a/.github/workflows/gen_emu_config-build-linux.yml b/.github/workflows/gen_emu_config-build-linux.yml index b2217d020..6bde07714 100644 --- a/.github/workflows/gen_emu_config-build-linux.yml +++ b/.github/workflows/gen_emu_config-build-linux.yml @@ -1,4 +1,4 @@ -name: Build gen_emu_config script (Linux) +name: "Build gen_emu_config script (Linux)" on: workflow_call: @@ -7,7 +7,7 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: ARTIFACT_NAME: "generate_emu_config-linux-${{ github.sha }}" @@ -16,37 +16,37 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: "ubuntu-24.04" steps: - - name: Checkout branch - uses: actions/checkout@v4 - -# env - - name: Install env - shell: bash - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh - -### fix folder permissions! not sure why this fails - # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - shell: bash - working-directory: ${{ github.workspace }} - run: sudo chmod -R 777 "${{ github.workspace }}" - -# build - - name: Rebuild - shell: bash - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh - -# upload artifact - - name: Upload build package - uses: actions/upload-artifact@v4 - with: - name: "${{ env.ARTIFACT_NAME }}" - path: "${{ env.PACKAGE_BASE_DIR }}/" - if-no-files-found: 'error' - compression-level: 9 - retention-days: 1 + - name: "Checkout branch" + uses: actions/checkout@v4 + + # env + - name: "Install env" + shell: "bash" + working-directory: "${{ env.SCRIPT_BASE_DIR }}" + run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh + + # fix folder permissions! not sure why this fails + # nested subdirs "build/linux/release" cause permission problems + - name: "Give all permissions to repo folder" + shell: "bash" + working-directory: "${{ github.workspace }}" + run: sudo chmod -R 777 "${{ github.workspace }}" + + # build + - name: "Rebuild" + shell: "bash" + working-directory: "${{ env.SCRIPT_BASE_DIR }}" + run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh + + # upload artifact + - name: "Upload build package" + uses: actions/upload-artifact@v4 + with: + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.PACKAGE_BASE_DIR }}/" + if-no-files-found: "error" + compression-level: 9 + retention-days: 1 diff --git a/.github/workflows/gen_emu_config-build-win.yml b/.github/workflows/gen_emu_config-build-win.yml index d3e563a7d..833b37bd2 100644 --- a/.github/workflows/gen_emu_config-build-win.yml +++ b/.github/workflows/gen_emu_config-build-win.yml @@ -1,4 +1,4 @@ -name: Build gen_emu_config script (Windows) +name: "Build gen_emu_config script (Windows)" on: workflow_call: @@ -7,62 +7,62 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}" SCRIPT_BASE_DIR: "tools/generate_emu_config" PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/win" - THIRD_PARTY_BASE_DIR: 'third-party' + THIRD_PARTY_BASE_DIR: "third-party" jobs: build: - runs-on: windows-2022 + runs-on: "windows-2022" steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" + - name: "Set up Python" + uses: actions/setup-python@v5 + 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@v4 - -## extra helpers/tools, these are not built inside the deps build dir - - name: Clone third-party deps (build/win) - uses: actions/checkout@v4 - with: - ref: 'third-party/build/win' - path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" + ### 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 -# env - - name: Install env - shell: cmd - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: recreate_venv_win.bat + - name: "Checkout branch" + uses: actions/checkout@v4 -# build - - name: Rebuild - shell: cmd - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: rebuild_win.bat + ## extra helpers/tools, these are not built inside the deps build dir + - name: "Clone third-party deps (build/win)" + uses: actions/checkout@v4 + with: + ref: "third-party/build/win" + path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" -# upload artifact - - name: Upload build package - uses: actions/upload-artifact@v4 - with: - name: "${{ env.ARTIFACT_NAME }}" - path: "${{ env.PACKAGE_BASE_DIR }}/" - if-no-files-found: 'error' - compression-level: 9 - retention-days: 1 + # 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@v4 + with: + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.PACKAGE_BASE_DIR }}/" + if-no-files-found: "error" + compression-level: 9 + retention-days: 1 diff --git a/.github/workflows/gen_emu_config-pull-request.yml b/.github/workflows/gen_emu_config-pull-request.yml index 2c83c96e8..490c60969 100644 --- a/.github/workflows/gen_emu_config-pull-request.yml +++ b/.github/workflows/gen_emu_config-pull-request.yml @@ -1,22 +1,22 @@ -name: Gen emu cfg PR +name: "Gen emu cfg PR" on: pull_request: - branches: [ "dev" ] + branches: ["dev"] paths: - - '!**/*.md' - - 'tools/generate_emu_config/**' + - "!**/*.md" + - "tools/generate_emu_config/**" permissions: - contents: write + contents: "write" jobs: script-win: - name: Gen emu config win + name: "Gen emu config win" if: ${{ !cancelled() }} - uses: ./.github/workflows/gen_emu_config-build-win.yml + uses: "./.github/workflows/gen_emu_config-build-win.yml" script-linux: - name: Gen emu config linux + name: "Gen emu config linux" if: ${{ !cancelled() }} - uses: ./.github/workflows/gen_emu_config-build-linux.yml + uses: "./.github/workflows/gen_emu_config-build-linux.yml" diff --git a/.github/workflows/migrate_gse-build-linux.yml b/.github/workflows/migrate_gse-build-linux.yml index b2e268485..705e5ba02 100644 --- a/.github/workflows/migrate_gse-build-linux.yml +++ b/.github/workflows/migrate_gse-build-linux.yml @@ -1,4 +1,4 @@ -name: Build migrate_gse script (Linux) +name: "Build migrate_gse script (Linux)" on: workflow_call: @@ -7,7 +7,7 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: ARTIFACT_NAME: "migrate_gse-linux-${{ github.sha }}" @@ -16,37 +16,37 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: "ubuntu-24.04" steps: - - name: Checkout branch - uses: actions/checkout@v4 - -### fix folder permissions! not sure why this fails - # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - shell: bash - working-directory: ${{ github.workspace }} - run: sudo chmod -R 777 "${{ github.workspace }}" - -# env - - name: Install env - shell: bash - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh - -# build - - name: Rebuild - shell: bash - working-directory: "${{ env.SCRIPT_BASE_DIR }}" - run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh - -# upload artifact - - name: Upload build package - uses: actions/upload-artifact@v4 - with: - name: "${{ env.ARTIFACT_NAME }}" - path: "${{ env.PACKAGE_BASE_DIR }}/" - if-no-files-found: 'error' - compression-level: 9 - retention-days: 1 + - name: "Checkout branch" + uses: actions/checkout@v4 + + # fix folder permissions! not sure why this fails + # nested subdirs "build/linux/release" cause permission problems + - name: "Give all permissions to repo folder" + shell: "bash" + working-directory: "${{ github.workspace }}" + run: sudo chmod -R 777 "${{ github.workspace }}" + + # env + - name: "Install env" + shell: "bash" + working-directory: "${{ env.SCRIPT_BASE_DIR }}" + run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh + + # build + - name: "Rebuild" + shell: "bash" + working-directory: "${{ env.SCRIPT_BASE_DIR }}" + run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh + + # upload artifact + - name: "Upload build package" + uses: actions/upload-artifact@v4 + with: + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.PACKAGE_BASE_DIR }}/" + if-no-files-found: "error" + compression-level: 9 + retention-days: 1 diff --git a/.github/workflows/migrate_gse-build-win.yml b/.github/workflows/migrate_gse-build-win.yml index 54b1b2302..34913db8a 100644 --- a/.github/workflows/migrate_gse-build-win.yml +++ b/.github/workflows/migrate_gse-build-win.yml @@ -1,4 +1,4 @@ -name: Build migrate_gse script (Windows) +name: "Build migrate_gse script (Windows)" on: workflow_call: @@ -7,62 +7,62 @@ on: # allows manual trigger permissions: - contents: write + contents: "write" env: ARTIFACT_NAME: "migrate_gse-win-${{ github.sha }}" SCRIPT_BASE_DIR: "tools/migrate_gse" PACKAGE_BASE_DIR: "tools/migrate_gse/bin/win" - - THIRD_PARTY_BASE_DIR: 'third-party' - + + THIRD_PARTY_BASE_DIR: "third-party" + jobs: build: - runs-on: windows-2022 + runs-on: "windows-2022" steps: - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" + - name: "Set up Python 3.12" + uses: actions/setup-python@v5 + 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@v4 -### 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@v4 - -## extra helpers/tools, these are not built inside the deps build dir - - name: Clone third-party deps (build/win) - uses: actions/checkout@v4 - with: - ref: 'third-party/build/win' - path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" + # extra helpers/tools, these are not built inside the deps build dir + - name: "Clone third-party deps (build/win)" + uses: actions/checkout@v4 + 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 + # 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 + # 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@v4 - with: - name: "${{ env.ARTIFACT_NAME }}" - path: "${{ env.PACKAGE_BASE_DIR }}/" - if-no-files-found: 'error' - compression-level: 9 - retention-days: 1 + # upload artifact + - name: "Upload build package" + uses: actions/upload-artifact@v4 + with: + name: "${{ env.ARTIFACT_NAME }}" + path: "${{ env.PACKAGE_BASE_DIR }}/" + if-no-files-found: "error" + compression-level: 9 + retention-days: 1 diff --git a/.github/workflows/migrate_gse-pull-request.yml b/.github/workflows/migrate_gse-pull-request.yml index bd5fe69f8..77257a625 100644 --- a/.github/workflows/migrate_gse-pull-request.yml +++ b/.github/workflows/migrate_gse-pull-request.yml @@ -1,22 +1,22 @@ -name: Migrate GSE PR +name: "Migrate GSE PR" on: pull_request: - branches: [ "dev" ] + branches: ["dev"] paths: - - '!**/*.md' - - 'tools/migrate_gse/**' + - "!**/*.md" + - "tools/migrate_gse/**" permissions: - contents: write + contents: "write" jobs: script-win: - name: Migrate GSE win + name: "Migrate GSE win" if: ${{ !cancelled() }} uses: ./.github/workflows/migrate_gse-build-win.yml script-linux: - name: Migrate GSE linux + name: "Migrate GSE linux" if: ${{ !cancelled() }} uses: ./.github/workflows/migrate_gse-build-linux.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2541c2d72..7974417e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,430 +1,411 @@ -name: Prepare release +name: "Prepare release" on: push: tags: - - release-* + - "release-*" workflow_dispatch: # allows manual trigger permissions: - contents: write + contents: "write" env: - THIRD_PARTY_BASE_DIR: 'third-party' + THIRD_PARTY_BASE_DIR: "third-party" jobs: emu-win-all: - name: Emu win all + name: "Emu win all" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-build-all-win.yml + uses: "./.github/workflows/emu-build-all-win.yml" emu-win-prep: - needs: [ emu-win-all ] - runs-on: windows-2022 + needs: ["emu-win-all"] + runs-on: "windows-2022" steps: # on Windows Git will auto change line ending to CRLF, not preferable - - name: Ensure LF line ending - shell: cmd - working-directory: ${{ github.workspace }} + - 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 # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 - - name: Clone third-party deps (deps/win) + - name: "Clone third-party deps (deps/win)" uses: actions/checkout@v4 with: - ref: 'third-party/deps/win' + ref: "third-party/deps/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" -## donwload artifacts - - name: Download emu build artifacts (Win) + # download artifacts + - name: "Download emu build artifacts (Win)" uses: actions/download-artifact@v4 with: - path: build/win - pattern: emu-win-*-${{ github.sha }} + path: "build/win" + pattern: "emu-win-*-${{ github.sha }}" merge-multiple: true -### print files - - name: Print files - shell: cmd - working-directory: ${{ github.workspace }} + # print files + - name: "Print files" + shell: "cmd" + working-directory: "${{ github.workspace }}" run: | dir /s /b /a:-d build\win -### remove linker files -### - name: Remove linker files -### shell: cmd -### working-directory: ${{ github.workspace }} -### run: | -### del /f /s /q build\win\*.exp,build\win\*.lib -### exit /b 0 - -### package (release mode) - - name: Package build (release) - shell: cmd - working-directory: ${{ github.workspace }} + # package (release mode) + - name: "Package build (release)" + shell: "cmd" + working-directory: "${{ github.workspace }}" run: package_win.bat vs2022\release -### package (debug mode) - - name: Package build (debug) - shell: cmd - working-directory: ${{ github.workspace }} + # package (debug mode) + - name: "Package build (debug)" + shell: "cmd" + working-directory: "${{ github.workspace }}" run: package_win.bat vs2022\debug 1 -### release (debug + release modes) if this is a tag push - - name: Release + # release (debug + release modes) if this is a tag push + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "build/package/win/**/*" -### upload artifacts/packages if this is a manual run - - name: Upload release package + # upload artifacts/packages if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-emu-win-release-${{ github.sha }}" path: "build/package/win/vs2022/*release*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 0 retention-days: 7 - - name: Upload debug package + + - name: "Upload debug package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-emu-win-debug-${{ github.sha }}" path: "build/package/win/vs2022/*debug*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 0 retention-days: 7 - - emu-linux-all: - name: Emu linux all + name: "Emu linux all" if: ${{ !cancelled() }} - uses: ./.github/workflows/emu-build-all-linux.yml + uses: "./.github/workflows/emu-build-all-linux.yml" emu-linux-prep: - needs: [ emu-linux-all ] - runs-on: ubuntu-24.04 + needs: ["emu-linux-all"] + runs-on: "ubuntu-24.04" steps: # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 - - name: Clone third-party deps (deps/linux) + - name: "Clone third-party deps (deps/linux)" uses: actions/checkout@v4 with: - ref: 'third-party/deps/linux' + ref: "third-party/deps/linux" path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux" -## donwload artifacts - - name: Download emu build artifacts (linux) + # download artifacts + - name: "Download emu build artifacts (linux)" uses: actions/download-artifact@v4 with: - path: build/linux - pattern: emu-linux-*-${{ github.sha }} + path: "build/linux" + pattern: "emu-linux-*-${{ github.sha }}" merge-multiple: true -### fix folder permissions! not sure why this fails + # fix folder permissions! not sure why this fails # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder + - name: "Give all permissions to repo folder" shell: bash - working-directory: ${{ github.workspace }} + working-directory: "${{ github.workspace }}" run: sudo chmod -R 777 "${{ github.workspace }}" && sudo chmod 777 package_linux.sh -### print files - - name: Print files - shell: bash - working-directory: ${{ github.workspace }} + # print files + - name: "Print files" + shell: "bash" + working-directory: "${{ github.workspace }}" run: | ls -la build/linux/*/* -### downlaod ubuntu packages - - name: Download required Ubuntu packages - shell: bash - working-directory: ${{ github.workspace }} + # downlaod ubuntu packages + - name: "Download required Ubuntu packages" + shell: "bash" + working-directory: "${{ github.workspace }}" run: | sudo apt update || exit 1 sudo apt install tar -y || exit 1 -### package (release mode) - - name: Package build (release) - shell: bash - working-directory: ${{ github.workspace }} + # package (release mode) + - name: "Package build (release)" + shell: "bash" + working-directory: "${{ github.workspace }}" run: ./package_linux.sh gmake2/release -### package (debug mode) - - name: Package build (debug) - shell: bash - working-directory: ${{ github.workspace }} + # package (debug mode) + - name: "Package build (debug)" + shell: "bash" + working-directory: "${{ github.workspace }}" run: ./package_linux.sh gmake2/debug 1 -### release (debug + release modes) if this is a tag push - - name: Release + # release (debug + release modes) if this is a tag push + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "build/package/linux/**/*" -### upload artifacts/packages if this is a manual run - - name: Upload release package + # upload artifacts/packages if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-emu-linux-release-${{ github.sha }}" path: "build/package/linux/gmake2/*release*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 0 retention-days: 7 - - name: Upload debug package + + - name: "Upload debug package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-emu-linux-debug-${{ github.sha }}" path: "build/package/linux/gmake2/*debug*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 0 retention-days: 7 - - gen_emu_script-win: - name: Gen emu config win + name: "Gen emu config win" if: ${{ !cancelled() }} - uses: ./.github/workflows/gen_emu_config-build-win.yml + uses: "./.github/workflows/gen_emu_config-build-win.yml" gen_emu_script-win-prep: - needs: [ gen_emu_script-win ] - runs-on: windows-2022 + needs: ["gen_emu_script-win"] + runs-on: "windows-2022" steps: # on Windows Git will auto change line ending to CRLF, not preferable - - name: Ensure LF line ending - shell: cmd - working-directory: ${{ github.workspace }} + - 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 # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 - - name: Clone third-party deps (deps/win) + - name: "Clone third-party deps (deps/win)" uses: actions/checkout@v4 with: - ref: 'third-party/deps/win' + ref: "third-party/deps/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" -## donwload artifacts - - name: Download script build artifacts (Win) + # download artifacts + - name: "Download script build artifacts (Win)" uses: actions/download-artifact@v4 with: - path: tools/generate_emu_config/bin/win - pattern: generate_emu_config-win-* + path: "tools/generate_emu_config/bin/win" + pattern: "generate_emu_config-win-*" merge-multiple: true -### package - - name: Package script - shell: cmd + # package + - name: "Package script" + shell: "cmd" working-directory: "tools/generate_emu_config" run: package_win.bat -# release tag - - name: Release + # release tag + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "tools/generate_emu_config/bin/package/win/**/*" -### upload artifact/package if this is a manual run - - name: Upload release package + # upload artifact/package if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-generate_emu_config-win-${{ github.sha }}" path: "tools/generate_emu_config/bin/package/win/**/*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 7 - - gen_emu_script-linux: - name: Gen emu config linux + name: "Gen emu config linux" if: ${{ !cancelled() }} - uses: ./.github/workflows/gen_emu_config-build-linux.yml + uses: "./.github/workflows/gen_emu_config-build-linux.yml" gen_emu_script-linux-prep: - needs: [ gen_emu_script-linux ] - runs-on: ubuntu-24.04 + needs: ["gen_emu_script-linux"] + runs-on: "ubuntu-24.04" steps: # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 -## donwload artifacts - - name: Download script build artifacts (linux) + # download artifacts + - name: "Download script build artifacts (linux)" uses: actions/download-artifact@v4 with: - path: tools/generate_emu_config/bin/linux - pattern: generate_emu_config-linux-* + path: "tools/generate_emu_config/bin/linux" + pattern: "generate_emu_config-linux-*" merge-multiple: true -### fix folder permissions! not sure why this fails + # fix folder permissions! not sure why this fails # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - shell: bash - working-directory: ${{ github.workspace }} - run: sudo chmod -R 777 "${{ github.workspace }}" - -### package - - name: Package script - shell: bash + - name: "Give all permissions to repo folder" + shell: "bash" + working-directory: "${{ github.workspace }}" + run: sudo chmod -R 777 "${{ github.workspace }}" + + # package + - name: "Package script" + shell: "bash" working-directory: "tools/generate_emu_config" run: sudo chmod 777 package_linux.sh && sudo ./package_linux.sh -# release tag - - name: Release + # release tag + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "tools/generate_emu_config/bin/package/linux/**/*" -### upload artifact/package if this is a manual run - - name: Upload release package + # upload artifact/package if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-generate_emu_config-linux-${{ github.sha }}" path: "tools/generate_emu_config/bin/package/linux/**/*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 7 - - migrate_gse_script-win: - name: Migrate GSE win + name: "Migrate GSE win" if: ${{ !cancelled() }} - uses: ./.github/workflows/migrate_gse-build-win.yml + uses: "./.github/workflows/migrate_gse-build-win.yml" migrate_gse_script-win-prep: - needs: [ migrate_gse_script-win ] - runs-on: windows-2022 + needs: ["migrate_gse_script-win"] + runs-on: "windows-2022" steps: # on Windows Git will auto change line ending to CRLF, not preferable - - name: Ensure LF line ending - shell: cmd - working-directory: ${{ github.workspace }} + - 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 # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 - - name: Clone third-party deps (deps/win) + - name: "Clone third-party deps (deps/win)" uses: actions/checkout@v4 with: - ref: 'third-party/deps/win' + ref: "third-party/deps/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" -## donwload artifacts - - name: Download script build artifacts (Win) + # download artifacts + - name: "Download script build artifacts (Win)" uses: actions/download-artifact@v4 with: - path: tools/migrate_gse/bin/win - pattern: migrate_gse-win-* + path: "tools/migrate_gse/bin/win" + pattern: "migrate_gse-win-*" merge-multiple: true -### package - - name: Package script - shell: cmd + # package + - name: "Package script" + shell: "cmd" working-directory: "tools/migrate_gse" run: package_win.bat -# release tag - - name: Release + # release tag + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "tools/migrate_gse/bin/package/win/**/*" -### upload artifact/package if this is a manual run - - name: Upload release package + # upload artifact/package if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-migrate_gse-win-${{ github.sha }}" path: "tools/migrate_gse/bin/package/win/**/*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 7 - - migrate_gse_script-linux: name: Migrate GSE linux if: ${{ !cancelled() }} - uses: ./.github/workflows/migrate_gse-build-linux.yml + uses: "./.github/workflows/migrate_gse-build-linux.yml" migrate_gse_script-linux-prep: - needs: [ migrate_gse_script-linux ] - runs-on: ubuntu-24.04 + needs: ["migrate_gse_script-linux"] + runs-on: "ubuntu-24.04" steps: # we need branch because it has package scripts - - name: Checkout branch + - name: "Checkout branch" uses: actions/checkout@v4 -## donwload artifacts - - name: Download script build artifacts (linux) + # download artifacts + - name: "Download script build artifacts (linux)" uses: actions/download-artifact@v4 with: - path: tools/migrate_gse/bin/linux - pattern: migrate_gse-linux-* + path: "tools/migrate_gse/bin/linux" + pattern: "migrate_gse-linux-*" merge-multiple: true -### fix folder permissions! not sure why this fails + # fix folder permissions! not sure why this fails # nested subdirs "build/linux/release" cause permission problems - - name: Give all permissions to repo folder - shell: bash - working-directory: ${{ github.workspace }} - run: sudo chmod -R 777 "${{ github.workspace }}" - -### package - - name: Package script - shell: bash + - name: "Give all permissions to repo folder" + shell: "bash" + working-directory: "${{ github.workspace }}" + run: sudo chmod -R 777 "${{ github.workspace }}" + + # package + - name: "Package script" + shell: "bash" working-directory: "tools/migrate_gse" run: sudo chmod 777 package_linux.sh && sudo ./package_linux.sh -# release tag - - name: Release + # release tag + - name: "Release" if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: "tools/migrate_gse/bin/package/linux/**/*" -### upload artifact/package if this is a manual run - - name: Upload release package + # upload artifact/package if this is a manual run + - name: "Upload release package" if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: name: "release-migrate_gse-linux-${{ github.sha }}" path: "tools/migrate_gse/bin/package/linux/**/*" - if-no-files-found: 'error' + if-no-files-found: "error" compression-level: 9 retention-days: 7 - - - From 91eff290a0551b1c507879e61f53e3b95f8fd863 Mon Sep 17 00:00:00 2001 From: Sak32009 Date: Sun, 25 Aug 2024 18:08:23 +0200 Subject: [PATCH 9/9] formatted the .yml workflows --- .github/workflows/emu-build-all-linux.yml | 4 ++-- .github/workflows/emu-build-all-win.yml | 2 +- .github/workflows/migrate_gse-pull-request.yml | 4 ++-- .github/workflows/release.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/emu-build-all-linux.yml b/.github/workflows/emu-build-all-linux.yml index 2e33c3d4d..eaf0e35a3 100644 --- a/.github/workflows/emu-build-all-linux.yml +++ b/.github/workflows/emu-build-all-linux.yml @@ -57,8 +57,8 @@ jobs: id: "emu-deps-cache-step" uses: actions/cache@v4 with: - key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }} - path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }} + 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/linux)" diff --git a/.github/workflows/emu-build-all-win.yml b/.github/workflows/emu-build-all-win.yml index e05a8f9e5..c794d1dcb 100644 --- a/.github/workflows/emu-build-all-win.yml +++ b/.github/workflows/emu-build-all-win.yml @@ -54,7 +54,7 @@ jobs: # on Windows Git will auto change line ending to CRLF, not preferable - name: "Ensure LF line ending" shell: "cmd" - working-directory: ${{ github.workspace }} + working-directory: "${{ github.workspace }}" run: | git config --local core.autocrlf false git config --system core.autocrlf false diff --git a/.github/workflows/migrate_gse-pull-request.yml b/.github/workflows/migrate_gse-pull-request.yml index 77257a625..f4f113e74 100644 --- a/.github/workflows/migrate_gse-pull-request.yml +++ b/.github/workflows/migrate_gse-pull-request.yml @@ -14,9 +14,9 @@ jobs: script-win: name: "Migrate GSE win" if: ${{ !cancelled() }} - uses: ./.github/workflows/migrate_gse-build-win.yml + uses: "./.github/workflows/migrate_gse-build-win.yml" script-linux: name: "Migrate GSE linux" if: ${{ !cancelled() }} - uses: ./.github/workflows/migrate_gse-build-linux.yml + uses: "./.github/workflows/migrate_gse-build-linux.yml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7974417e8..a665914ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,7 +127,7 @@ jobs: # fix folder permissions! not sure why this fails # nested subdirs "build/linux/release" cause permission problems - name: "Give all permissions to repo folder" - shell: bash + shell: "bash" working-directory: "${{ github.workspace }}" run: sudo chmod -R 777 "${{ github.workspace }}" && sudo chmod 777 package_linux.sh