diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 13fe9b5..ee49304 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -75,12 +75,13 @@ jobs: shell: cmd env: vc_arch: ${{ matrix.msvc_arch }} + publish_dir: ..\build\QtScrcpy-win${{ matrix.msvc_arch }}-v1.1.1 ENV_VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat' ENV_QT_MSVC: 'd:\a\QtScrcpy\Qt\5.12.7' - ENV_BUILD_DIR: '../build-win' + ENV_PUBLISH_DIR: '..\build\QtScrcpy-win32' run: | call "ci\win\build_for_win.bat" release %vc_arch% - call "ci\win\publish_for_win.bat" %vc_arch% + call "ci\win\publish_for_win.bat" %vc_arch% %publish_dir% # tag 打包 - name: package if: startsWith(github.event.ref, 'refs/tags/') diff --git a/ci/win/build_for_win.bat b/ci/win/build_for_win.bat index 6f76626..4d84971 100644 --- a/ci/win/build_for_win.bat +++ b/ci/win/build_for_win.bat @@ -4,8 +4,6 @@ set vcvarsall="%ENV_VCVARSALL%" :: 例如 d:\a\QtScrcpy\Qt\5.12.7 set qt_msvc_path="%ENV_QT_MSVC%" -:: 例如 ../build-win -set build_path_name="%ENV_BUILD_DIR%" echo= echo= @@ -23,7 +21,8 @@ set script_path=%~dp0 set old_cd=%cd% cd /d %~dp0 -set build_path=%script_path%%build_path_name% +:: 临时文件目录 +set temp_path=%script_path%..\temp :: 启动参数声明 set debug_mode="false" @@ -85,11 +84,11 @@ echo --------------------------------------------------------------- echo begin qmake build echo --------------------------------------------------------------- -if exist %build_path% ( - rmdir /q /s %build_path% +if exist %temp_path% ( + rmdir /q /s %temp_path% ) -md %build_path% -cd %build_path% +md %temp_path% +cd %temp_path% set qmake_params=-spec win32-msvc diff --git a/ci/win/publish_for_win.bat b/ci/win/publish_for_win.bat index 811cf62..c8f2019 100644 --- a/ci/win/publish_for_win.bat +++ b/ci/win/publish_for_win.bat @@ -26,6 +26,13 @@ if /i "%1"=="x64" ( set cpu_mode=x64 ) +set publish_dir=%2 +set errno=1 + +:: 提示 +echo current build mode: %cpu_mode% +echo current publish dir: %publish_dir% + :: 环境变量设置 set adb_path=%script_path%..\..\third_party\adb\win\*.* set jar_path=%script_path%..\..\third_party\scrcpy-server @@ -33,11 +40,11 @@ set keymap_path=%script_path%..\..\keymap set config_path=%script_path%..\..\config if /i %cpu_mode% == x86 ( - set publish_path=%script_path%..\build\QtScrcpy-win32\ + set publish_path=%script_path%%publish_dir%\ set release_path=%script_path%..\..\output\win\x86\release set qt_msvc_path=%qt_msvc_path%\msvc2017\bin ) else ( - set publish_path=%script_path%QtScrcpy-win64\ + set publish_path=%script_path%%publish_dir%\ set release_path=%script_path%..\..\output\win\x64\release set qt_msvc_path=%qt_msvc_path%\msvc2017_64\bin ) @@ -81,8 +88,11 @@ if /i %cpu_mode% == x86 ( echo= echo= echo --------------------------------------------------------------- -echo 完成! +echo finish!!! echo --------------------------------------------------------------- +set errno=0 + :return -cd %old_cd% \ No newline at end of file +cd %old_cd% +exit /B %errno% \ No newline at end of file