Files
v2rayA/.github/workflows/_build_windows_installer.yml
Zakk e05e672fe5 build: drop the tinytun build tag and ship Wintun from its own package
The binaries workflow, the PR workflow and build.ps1 no longer pass
-tags tinytun; there is nothing behind the tag. The Windows installer
takes wintun.dll from the official 0.14.1 package, pinned by hash, one
DLL per architecture, and deletes a tinytun.exe an earlier installer left
in the application's bin directory. The README states what the built-in
TUN does and its known limitation on Windows and macOS.
2026-09-19 10:34:56 +10:00

114 lines
6.0 KiB
YAML

name: Build Windows Installer (Reusable)
on:
workflow_call:
inputs:
version:
description: "Version string for the installer"
type: string
required: true
jobs:
Build_Windows_Installer:
runs-on: windows-latest
env:
VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download Artifact Windows x64
uses: actions/download-artifact@v8
with:
name: v2raya_windows_x64_${{ inputs.version }}.exe
path: D:\Downloads
- name: Download Core Artifact Windows x64
uses: actions/download-artifact@v8
with:
name: v2raya_core_windows_x64_${{ inputs.version }}.exe
path: D:\Downloads
- name: Download Artifact Windows arm64
uses: actions/download-artifact@v8
with:
name: v2raya_windows_arm64_${{ inputs.version }}.exe
path: D:\Downloads
- name: Download Core Artifact Windows arm64
uses: actions/download-artifact@v8
with:
name: v2raya_core_windows_arm64_${{ inputs.version }}.exe
path: D:\Downloads
- name: Download Wintun
shell: pwsh
run: |
# The core loads wintun.dll from its own directory; the driver
# package is the official one, pinned by hash.
$Url_Wintun = "https://www.wintun.net/builds/wintun-0.14.1.zip"
$sha256_Wintun = "07c256185d6ee3652e09fa55c0b673e2624b565e02c4b9091c79ca7d2f24ef51"
Invoke-WebRequest $Url_Wintun -OutFile "D:\wintun.zip"
$hash_Wintun = Get-FileHash -Path "D:\wintun.zip" -Algorithm SHA256
if ($hash_Wintun.Hash -ne $sha256_Wintun) {
throw "SHA256 hash mismatch for Wintun. Expected: $sha256_Wintun, Actual: $($hash_Wintun.Hash)"
exit 1
} else {
Write-Host "SHA256 hash verified for Wintun."
}
Expand-Archive -Path "D:\wintun.zip" -DestinationPath "D:\wintun"
- name: Install Inno Setup
shell: pwsh
run: |
choco install innosetup -y
- name: Build Windows Installer
shell: pwsh
run: |
## Create Destination Directory
$CurrentDir = Get-Location
New-Item -ItemType Directory -Path "D:\v2raya-x64compatible-windows\data"
New-Item -ItemType Directory -Path "D:\v2raya-x64compatible-windows\bin"
New-Item -ItemType Directory -Path "D:\v2raya-arm64-windows\data"
New-Item -ItemType Directory -Path "D:\v2raya-arm64-windows\bin"
## Copy v2rayA to Destination Directory
Copy-Item -Path D:\Downloads\v2raya_windows_arm64_${{ inputs.version }}.exe -Destination D:\v2raya-arm64-windows\bin\v2raya.exe
Copy-Item -Path D:\Downloads\v2raya_windows_x64_${{ inputs.version }}.exe -Destination D:\v2raya-x64compatible-windows\bin\v2raya.exe
Copy-Item -Path D:\Downloads\v2raya_core_windows_arm64_${{ inputs.version }}.exe -Destination D:\v2raya-arm64-windows\bin\v2raya_core.exe
Copy-Item -Path D:\Downloads\v2raya_core_windows_x64_${{ inputs.version }}.exe -Destination D:\v2raya-x64compatible-windows\bin\v2raya_core.exe
Copy-Item -Path ".\install\windows-inno\v2raya.ico" -Destination "D:\v2raya.ico"
## Copy the Wintun driver next to the core, one DLL per architecture
Copy-Item -Path "D:\wintun\wintun\bin\amd64\wintun.dll" -Destination "D:\v2raya-x64compatible-windows\bin\wintun.dll"
Copy-Item -Path "D:\wintun\wintun\bin\arm64\wintun.dll" -Destination "D:\v2raya-arm64-windows\bin\wintun.dll"
## Download DAT files directly from Loyalsoldier release
$DatBaseUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download"
$DatFiles = @("geoip.dat", "geosite.dat")
foreach ($DatFile in $DatFiles) {
Invoke-WebRequest "$DatBaseUrl/$DatFile" -OutFile "D:\$DatFile"
Copy-Item -Path "D:\$DatFile" -Destination "D:\v2raya-x64compatible-windows\data\$DatFile"
Copy-Item -Path "D:\$DatFile" -Destination "D:\v2raya-arm64-windows\data\$DatFile"
}
## Keep legacy alias for compatibility
Copy-Item -Path "D:\geosite.dat" -Destination "D:\v2raya-x64compatible-windows\data\LoyalsoldierSite.dat"
Copy-Item -Path "D:\geosite.dat" -Destination "D:\v2raya-arm64-windows\data\LoyalsoldierSite.dat"
Copy-Item -Path ".\LICENSE" -Destination "D:\LICENSE.txt"
Copy-Item -Path ".\install\windows-inno\ChineseSimplified.isl" -Destination "D:\ChineseSimplified.isl"
## Set Version
$((Get-Content -Path .\install\windows-inno\windows.iss).replace("TheRealVersion", "${{ inputs.version }}")).Replace("TheRealArch", "x64compatible") | Out-File "D:\windows_x86_64.iss"
$((Get-Content -Path .\install\windows-inno\windows.iss).replace("TheRealVersion", "${{ inputs.version }}")).Replace("TheRealArch", "arm64") | Out-File "D:\windows_arm64.iss"
## Build Installer
Set-Location -Path "D:\"
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' "D:\windows_x86_64.iss"
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' "D:\windows_arm64.iss"
## Rename to Friendly Name
cd $CurrentDir
Copy-Item -Path D:\installer_windows_inno_x64compatible.exe -Destination $CurrentDir\installer_windows_inno_x64_${{ inputs.version }}.exe
Copy-Item -Path D:\installer_windows_inno_arm64.exe -Destination $CurrentDir\installer_windows_inno_arm64_${{ inputs.version }}.exe
- name: Upload x64 Build
uses: actions/upload-artifact@v7
with:
name: installer_windows_inno_x64_${{ inputs.version }}.exe
path: |
installer_windows_inno_x64_${{ inputs.version }}.exe
- name: Upload arm64 Build
uses: actions/upload-artifact@v7
with:
name: installer_windows_inno_arm64_${{ inputs.version }}.exe
path: |
installer_windows_inno_arm64_${{ inputs.version }}.exe