This commit is contained in:
恍兮惚兮 2024-04-26 19:34:44 +08:00
parent f85195f2dc
commit 84ae59c6e6
6 changed files with 26 additions and 86 deletions

View File

@ -11,6 +11,11 @@ on:
jobs:
build_xp:
runs-on: windows-2019
strategy:
matrix:
include:
- target: Release_English_winxp
- target: Release_Chinese_winxp
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -24,30 +29,25 @@ jobs:
python-version: '3.11'
architecture: x64
- name: Run build script 32xp
run: python build.py xp
- name: Run build script
run: python build.py ${{ matrix.target }}
- name: Pack
run: python build.py pack
- name: Upload English xp artifact
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Release_English_xp
path: builds/Release_English_xp.zip
- name: Upload Chinese xp artifact
uses: actions/upload-artifact@v4
with:
name: Release_Chinese_xp
path: builds/Release_Chinese_xp.zip
name: ${{ matrix.target }}
path: builds/${{ matrix.target }}.zip
- name: Release LunaHook
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.create_release }}
files: |
builds/Release_Chinese_xp.zip
builds/Release_English_xp.zip
files: builds/${{ matrix.target }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_plugin:
runs-on: windows-latest
strategy:

View File

@ -32,5 +32,7 @@ else:
os.system(f"cmd /c builden.bat")
elif sys.argv[1]=='zh':
os.system(f"cmd /c buildzh.bat")
elif sys.argv[1]=='xp':
os.system(f"cmd /c build32xp.bat")
elif sys.argv[1]=='Release_English_winxp':
os.system(f"cmd /c buildxpen.bat")
elif sys.argv[1]=='Release_Chinese_winxp':
os.system(f"cmd /c buildxpzh.bat")

View File

@ -1,67 +1,3 @@
cmake -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp
cmake -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp
python edit_target.py
@echo off
setlocal enabledelayedexpansion
goto :main
:get_host_arch
setlocal
set out_var=%~1
if defined PROCESSOR_ARCHITEW6432 (
set "host_arch=%PROCESSOR_ARCHITEW6432%"
) else (
set "host_arch=%PROCESSOR_ARCHITECTURE%"
)
if "%host_arch%" == "AMD64" (
set result=x64
) else if "%host_arch%" == "x86" (
set result=x86
) else (
echo ERROR: Unsupported host machine architecture.
endlocal
exit /b 1
)
endlocal & set %out_var%=%result%
goto :eof
:find_msvc
setlocal
set out_var=%~1
rem Find vswhere.exe
set "vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%vswhere%" set "vswhere=!ProgramFiles!\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%vswhere%" (
echo ERROR: Failed to find vswhere.exe>&2
endlocal & exit /b 1
)
rem Find VC tools
for /f "usebackq tokens=*" %%i in (`"%vswhere%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set vc_dir=%%i
)
if not exist "%vc_dir%\Common7\Tools\vsdevcmd.bat" (
echo ERROR: Failed to find MSVC.>&2
endlocal & exit /b 1
)
endlocal & set "%out_var%=%vc_dir%"
goto :eof
:activate_msvc
where cl.exe > nul 2>&1 && goto :eof || cmd /c exit 0
call :find_msvc vc_dir || goto :eof
call "%vc_dir%\Common7\Tools\vsdevcmd.bat" -no_logo -arch=%~1 || goto :eof
goto :eof
:main
call :get_host_arch host_arch || exit /b
if not defined TARGET_ARCH (
rem Target architecture is by default the same as the host architecture
set target_arch=%host_arch%
)
call :activate_msvc "%target_arch%" || goto :eof
msbuild ..\build\x86_xp\LunaHook.sln -p:Configuration=Release
msbuild ..\build\x86_zh_xp\LunaHook.sln -p:Configuration=Release
goto :eof
call dobuildxp.bat

3
scripts/buildxpen.bat Normal file
View File

@ -0,0 +1,3 @@
cmake -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp
cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14
call dobuildxp.bat

4
scripts/buildxpzh.bat Normal file
View File

@ -0,0 +1,4 @@
cmake -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_zh_xp
cmake --build ../build/x86_zh_xp --config Release --target ALL_BUILD -j 14
call dobuildxp.bat

View File

@ -1,8 +1,3 @@
cmake -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp
cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14
cmake -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_zh_xp
cmake --build ../build/x86_zh_xp --config Release --target ALL_BUILD -j 14
python edit_target.py
@echo off