mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Add arm64 support
This commit is contained in:
101
.github/workflows/deploy.yml
vendored
101
.github/workflows/deploy.yml
vendored
@@ -132,6 +132,8 @@ jobs:
|
||||
setup-python: 'true'
|
||||
tools: 'tools_ifw'
|
||||
set-env: 'true'
|
||||
aqtversion: '==3.1.21'
|
||||
py7zrversion: '==0.22.*'
|
||||
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
|
||||
|
||||
- name: 'Setup mvsc'
|
||||
@@ -169,7 +171,6 @@ jobs:
|
||||
# ------------------------------------------------------
|
||||
|
||||
Build-Windows-ARM64:
|
||||
needs: Build-Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
env:
|
||||
@@ -215,10 +216,29 @@ jobs:
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
|
||||
- name: 'Cleanup Qt directory'
|
||||
shell: bash
|
||||
shell: pwsh
|
||||
run: |
|
||||
rm -rf "${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/msvc2022_64"
|
||||
rm -rf "${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/win64_msvc2022_arm64_cross_compiled"
|
||||
$baseDir = "${{ runner.temp }}"
|
||||
$qtVersion = "${{ env.QT_VERSION }}"
|
||||
# Handle both path formats (with \ and /)
|
||||
$paths = @(
|
||||
"$baseDir\Qt\$qtVersion\msvc2022_64",
|
||||
"$baseDir/Qt/$qtVersion/msvc2022_64",
|
||||
"$baseDir\Qt\$qtVersion\msvc2022_arm64",
|
||||
"$baseDir/Qt/$qtVersion/msvc2022_arm64"
|
||||
)
|
||||
foreach ($path in $paths) {
|
||||
if (Test-Path $path) {
|
||||
Write-Host "Removing $path..."
|
||||
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- name: 'Setup Python 3.11'
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: 'Install Qt Desktop (host for cross-compilation)'
|
||||
uses: jurplel/install-qt-action@v3
|
||||
@@ -229,9 +249,42 @@ jobs:
|
||||
arch: 'win64_msvc2022_64'
|
||||
modules: 'qtremoteobjects qt5compat qtshadertools'
|
||||
dir: ${{ runner.temp }}
|
||||
setup-python: 'true'
|
||||
setup-python: 'false'
|
||||
set-env: 'false'
|
||||
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
|
||||
aqtversion: '==3.3.0'
|
||||
py7zrversion: '==0.22.*'
|
||||
extra: '--base ${{ env.QT_MIRROR }}'
|
||||
|
||||
- name: 'Verify Qt Desktop (host) installation'
|
||||
shell: cmd
|
||||
run: |
|
||||
echo "Checking Qt Desktop (host) installation..."
|
||||
set QT_HOST_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_64
|
||||
echo "Qt host directory: %QT_HOST_DIR%"
|
||||
if exist "%QT_HOST_DIR%" (
|
||||
echo "Qt host directory exists"
|
||||
dir "%QT_HOST_DIR%\bin\Qt6*.dll"
|
||||
) else (
|
||||
echo "ERROR: Qt host directory does not exist"
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
- name: 'Cleanup Qt ARM64 directory before install'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$baseDir = "${{ runner.temp }}"
|
||||
$qtVersion = "${{ env.QT_VERSION }}"
|
||||
# Handle both path formats (with \ and /)
|
||||
$paths = @(
|
||||
"$baseDir\Qt\$qtVersion\msvc2022_arm64",
|
||||
"$baseDir/Qt/$qtVersion/msvc2022_arm64"
|
||||
)
|
||||
foreach ($path in $paths) {
|
||||
if (Test-Path $path) {
|
||||
Write-Host "Removing $path before ARM64 Qt install..."
|
||||
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
- name: 'Install Qt ARM64'
|
||||
uses: jurplel/install-qt-action@v3
|
||||
@@ -242,11 +295,34 @@ jobs:
|
||||
arch: 'win64_msvc2022_arm64_cross_compiled'
|
||||
modules: 'qtremoteobjects qt5compat qtshadertools'
|
||||
dir: ${{ runner.temp }}
|
||||
setup-python: 'true'
|
||||
setup-python: 'false'
|
||||
tools: 'tools_ifw'
|
||||
set-env: 'true'
|
||||
aqtversion: '==3.3.0'
|
||||
py7zrversion: '==0.22.*'
|
||||
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
|
||||
|
||||
- name: 'Verify Qt ARM64 installation'
|
||||
shell: cmd
|
||||
run: |
|
||||
echo "Checking Qt ARM64 installation..."
|
||||
set QT_ARM64_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_arm64
|
||||
echo "Qt ARM64 directory: %QT_ARM64_DIR%"
|
||||
if exist "%QT_ARM64_DIR%" (
|
||||
echo "Qt ARM64 directory exists"
|
||||
dir "%QT_ARM64_DIR%"
|
||||
echo.
|
||||
echo "Checking bin directory..."
|
||||
if exist "%QT_ARM64_DIR%\bin" (
|
||||
echo "bin directory exists"
|
||||
dir "%QT_ARM64_DIR%\bin\Qt6*.dll"
|
||||
) else (
|
||||
echo "ERROR: bin directory does not exist"
|
||||
)
|
||||
) else (
|
||||
echo "ERROR: Qt ARM64 directory does not exist"
|
||||
)
|
||||
|
||||
- name: 'Setup mvsc'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
@@ -256,11 +332,11 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
set BUILD_ARCH=${{ env.BUILD_ARCH }}
|
||||
set QT_BIN_DIR="${{ runner.temp }}\\Qt\\${{ env.QT_VERSION }}\\win64_msvc2022_arm64_cross_compiled\\bin"
|
||||
set QT_HOST_PATH="${{ runner.temp }}\\Qt\\${{ env.QT_VERSION }}\\msvc2022_64"
|
||||
set QT_HOST_BIN_DIR="${{ runner.temp }}\\Qt\\${{ env.QT_VERSION }}\\msvc2022_64\\bin"
|
||||
set QIF_BIN_DIR="${{ runner.temp }}\\Qt\\Tools\\QtInstallerFramework\\${{ env.QIF_VERSION }}\\bin"
|
||||
call deploy\\build_windows.bat
|
||||
set "QT_BIN_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_arm64\bin"
|
||||
set "QT_HOST_PATH=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_64"
|
||||
set "QT_HOST_BIN_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_64\bin"
|
||||
set "QIF_BIN_DIR=${{ runner.temp }}\Qt\Tools\QtInstallerFramework\${{ env.QIF_VERSION }}\bin"
|
||||
call deploy\build_windows.bat
|
||||
|
||||
- name: 'Rename Windows installer'
|
||||
shell: cmd
|
||||
@@ -280,7 +356,6 @@ jobs:
|
||||
name: AmneziaVPN_Windows_ARM64_unpacked
|
||||
path: deploy\\build_${{ env.BUILD_ARCH }}\\client\\Release
|
||||
retention-days: 7
|
||||
|
||||
# ------------------------------------------------------
|
||||
|
||||
Build-iOS:
|
||||
|
||||
@@ -73,22 +73,147 @@ echo "Deploying..."
|
||||
|
||||
mkdir "%OUT_APP_DIR%"
|
||||
copy "%WORK_DIR%\service\server\release\%APP_NAME%-service.exe" "%OUT_APP_DIR%"
|
||||
rem copy "%WORK_DIR%\client\%APP_FILENAME%" "%OUT_APP_DIR%"
|
||||
copy "%WORK_DIR%\client\Release\%APP_FILENAME%" "%OUT_APP_DIR%"
|
||||
|
||||
|
||||
echo "Signing exe"
|
||||
cd %OUT_APP_DIR%
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
|
||||
|
||||
REM For cross-compiled ARM64, use windeployqt from host Qt
|
||||
REM For ARM64 cross-compilation, use x64 signtool from host (ARM64 signtool won't run on x64 Windows)
|
||||
if defined QT_HOST_BIN_DIR (
|
||||
echo "Using host windeployqt for cross-compilation"
|
||||
"%QT_HOST_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations --compiler-runtime "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
|
||||
REM Find x64 signtool - look for x64 version in Windows Kits (skip arm64)
|
||||
set SIGNGTOOL_PATH=
|
||||
for /f "delims=" %%i in ('dir /b /s "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" 2^>nul') do (
|
||||
set SIGNGTOOL_PATH=%%i
|
||||
goto :found_signtool
|
||||
)
|
||||
:found_signtool
|
||||
if defined SIGNGTOOL_PATH (
|
||||
echo "Using x64 signtool: %SIGNGTOOL_PATH%"
|
||||
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
|
||||
) else (
|
||||
echo "Warning: Could not find x64 signtool, trying default signtool"
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe 2>nul || echo "Warning: Signing failed, continuing..."
|
||||
)
|
||||
) else (
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
|
||||
)
|
||||
|
||||
REM For cross-compiled ARM64, use windeployqt from host Qt (x64) but point to ARM64 Qt libraries
|
||||
if defined QT_HOST_BIN_DIR (
|
||||
echo "Using host windeployqt for cross-compilation (to copy ARM64 libraries)"
|
||||
echo "ARM64 exe file: %OUT_APP_DIR%\%APP_FILENAME%"
|
||||
echo "ARM64 Qt path: %QT_BIN_DIR%"
|
||||
REM Verify that ARM64 exe exists before running windeployqt
|
||||
if not exist "%OUT_APP_DIR%\%APP_FILENAME%" (
|
||||
echo "ERROR: ARM64 exe file not found: %OUT_APP_DIR%\%APP_FILENAME%"
|
||||
exit /b 1
|
||||
)
|
||||
REM For ARM64, manually copy Qt DLLs instead of using windeployqt
|
||||
REM windeployqt has issues with cross-compilation paths
|
||||
echo "Manually copying ARM64 Qt DLLs instead of using windeployqt"
|
||||
|
||||
REM Debug: Check if Qt bin directory exists
|
||||
echo "Checking Qt bin directory: %QT_BIN_DIR:"=%"
|
||||
if exist "%QT_BIN_DIR:"=%" (
|
||||
echo "Qt bin directory exists"
|
||||
dir "%QT_BIN_DIR:"=%\Qt6*.dll" 2>nul
|
||||
) else (
|
||||
echo "ERROR: Qt bin directory does not exist: %QT_BIN_DIR:"=%"
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Copy Qt DLLs
|
||||
if exist "%QT_BIN_DIR:"=%\Qt6Core.dll" (
|
||||
echo "Copying all Qt6 DLLs from %QT_BIN_DIR:"=%"
|
||||
copy "%QT_BIN_DIR:"=%\*.dll" "%OUT_APP_DIR:"=%\" >nul 2>&1
|
||||
|
||||
REM Copy Qt6 plugins
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins" (
|
||||
echo "Copying Qt6 plugins"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins" "%OUT_APP_DIR:"=%\plugins\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy Qt6 QML modules
|
||||
if exist "%QT_BIN_DIR:"=%\..\qml" (
|
||||
echo "Copying Qt6 QML modules"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\qml" "%OUT_APP_DIR:"=%\qml\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy translations if needed
|
||||
if exist "%QT_BIN_DIR:"=%\..\translations" (
|
||||
echo "Copying Qt6 translations"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\translations\qt*.qm" "%OUT_APP_DIR:"=%\translations\" /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy resources directories
|
||||
if exist "%QT_BIN_DIR:"=%\..\resources" (
|
||||
echo "Copying Qt6 resources"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\resources" "%OUT_APP_DIR:"=%\resources\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy iconengines
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\iconengines" (
|
||||
echo "Copying iconengines"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\iconengines" "%OUT_APP_DIR:"=%\iconengines\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy imageformats
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\imageformats" (
|
||||
echo "Copying imageformats"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\imageformats" "%OUT_APP_DIR:"=%\imageformats\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy platforms
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\platforms" (
|
||||
echo "Copying platforms"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\platforms" "%OUT_APP_DIR:"=%\platforms\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy styles
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\styles" (
|
||||
echo "Copying styles"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\styles" "%OUT_APP_DIR:"=%\styles\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy tls
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\tls" (
|
||||
echo "Copying tls"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\tls" "%OUT_APP_DIR:"=%\tls\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy networkinformation
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\networkinformation" (
|
||||
echo "Copying networkinformation"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\networkinformation" "%OUT_APP_DIR:"=%\networkinformation\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
REM Copy generic
|
||||
if exist "%QT_BIN_DIR:"=%\..\plugins\generic" (
|
||||
echo "Copying generic"
|
||||
xcopy "%QT_BIN_DIR:"=%\..\plugins\generic" "%OUT_APP_DIR:"=%\generic\" /s /e /y /i >nul 2>&1
|
||||
)
|
||||
|
||||
echo "Successfully copied Qt ARM64 libraries and resources"
|
||||
) else (
|
||||
echo "ERROR: Qt DLLs not found in %QT_BIN_DIR:"=%"
|
||||
exit /b 1
|
||||
)
|
||||
) else (
|
||||
"%QT_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
|
||||
)
|
||||
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
|
||||
REM Sign DLLs - use x64 signtool for ARM64 cross-compilation
|
||||
cd %OUT_APP_DIR%
|
||||
if defined QT_HOST_BIN_DIR (
|
||||
if defined SIGNGTOOL_PATH (
|
||||
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
|
||||
) else (
|
||||
echo "Warning: Could not find x64 signtool, trying default signtool for DLLs"
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll 2>nul || echo "Warning: DLL signing failed, continuing..."
|
||||
)
|
||||
) else (
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
|
||||
)
|
||||
|
||||
echo "Copying deploy data..."
|
||||
xcopy %DEPLOY_DATA_DIR% %OUT_APP_DIR% /s /e /y /i /f
|
||||
@@ -112,7 +237,17 @@ echo "Creating installer..."
|
||||
timeout 5
|
||||
|
||||
cd %PROJECT_DIR%
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
|
||||
REM For ARM64 cross-compilation, use x64 signtool for final installer
|
||||
if defined QT_HOST_BIN_DIR (
|
||||
if defined SIGNGTOOL_PATH (
|
||||
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
|
||||
) else (
|
||||
echo "Warning: Could not find x64 signtool, trying default signtool for installer"
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%" 2>nul || echo "Warning: Installer signing failed, continuing..."
|
||||
)
|
||||
) else (
|
||||
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
|
||||
)
|
||||
|
||||
echo "Finished, see %TARGET_FILENAME%"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user