122 lines
5.0 KiB
YAML
122 lines
5.0 KiB
YAML
# Yowie IT - RustDesk patched-binary build pipeline
|
|
# =====================================================================
|
|
# Builds the Sciter-UI rustdesk.exe with our get_cursor() patch for
|
|
# upstream issue #672 (always emit cursor data on Windows endpoints
|
|
# regardless of physical mouse presence).
|
|
#
|
|
# Self-hosted Windows runner: yowie-admin-pc.
|
|
# Toolchain version pins match upstream rustdesk CI (LLVM 16.0.0, vcpkg
|
|
# at 120deac3, Rust stable).
|
|
|
|
name: Build patched rustdesk.exe
|
|
|
|
on:
|
|
push:
|
|
branches: [yowie-master]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
LLVM_VERSION: "16.0.0"
|
|
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
|
|
CARGO_BIN: 'C:\Users\Yowie\.cargo\bin'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Win x64 (Sciter UI)
|
|
runs-on: windows-x64
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Verify Rust toolchain
|
|
shell: powershell
|
|
run: |
|
|
& "$env:CARGO_BIN\rustc.exe" --version
|
|
& "$env:CARGO_BIN\cargo.exe" --version
|
|
|
|
- name: Setup LLVM 16 (matches upstream rustdesk CI)
|
|
shell: powershell
|
|
run: |
|
|
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
|
|
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_VERSION/LLVM-$env:LLVM_VERSION-win64.exe"
|
|
$dst = "$env:TEMP\llvm-$env:LLVM_VERSION.exe"
|
|
Write-Output "downloading $url"
|
|
Invoke-WebRequest -Uri $url -OutFile $dst -UseBasicParsing -TimeoutSec 600
|
|
Write-Output "installing to C:\LLVM16"
|
|
Start-Process -FilePath $dst -ArgumentList '/S','/D=C:\LLVM16' -Wait
|
|
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) { throw "LLVM 16 install failed" }
|
|
}
|
|
echo "LIBCLANG_PATH=C:\LLVM16\bin" >> $env:GITHUB_ENV
|
|
echo "C:\LLVM16\bin" >> $env:GITHUB_PATH
|
|
|
|
- name: Setup vcpkg pinned commit
|
|
shell: powershell
|
|
run: |
|
|
if (-not (Test-Path 'C:\vcpkg\vcpkg.exe')) {
|
|
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
|
|
}
|
|
Push-Location C:\vcpkg
|
|
git fetch --depth=200 origin $env:VCPKG_COMMIT_ID
|
|
git checkout $env:VCPKG_COMMIT_ID
|
|
.\bootstrap-vcpkg.bat -disableMetrics
|
|
Pop-Location
|
|
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
|
|
echo "C:\vcpkg" >> $env:GITHUB_PATH
|
|
|
|
- name: Install vcpkg native deps
|
|
shell: powershell
|
|
run: |
|
|
C:\vcpkg\vcpkg.exe install --triplet x64-windows-static libvpx libyuv opus aom libjpeg-turbo
|
|
|
|
- name: cargo build --release (Sciter UI)
|
|
shell: powershell
|
|
run: |
|
|
& "$env:CARGO_BIN\cargo.exe" build --release --no-default-features --features inline
|
|
|
|
- name: Verify binary + patch marker
|
|
shell: powershell
|
|
run: |
|
|
$exe = "target\release\rustdesk.exe"
|
|
if (-not (Test-Path $exe)) { throw "rustdesk.exe not produced" }
|
|
$size = (Get-Item $exe).Length
|
|
Write-Output "rustdesk.exe size: $size bytes"
|
|
if (-not (Select-String -Path "src\platform\windows.rs" -Pattern "Yowie IT MSP fork" -Quiet)) {
|
|
throw "patch marker missing from src\platform\windows.rs"
|
|
}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: rustdesk-yowie-windows-x64
|
|
path: target/release/rustdesk.exe
|
|
retention-days: 30
|
|
|
|
- name: Publish Gitea release (stable URL for OnRamp + Apply-YowieRustDeskPatch.sh)
|
|
shell: powershell
|
|
env:
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
run: |
|
|
$tag = "build-$($env:GITHUB_SHA.Substring(0,7))-$(Get-Date -Format yyyyMMddHHmm)"
|
|
$body = @{
|
|
tag_name = $tag
|
|
target_commitish = "yowie-master"
|
|
name = "Yowie patched rustdesk.exe ($tag)"
|
|
body = "Automated build from CI. Patch: get_cursor() always emits IDC_ARROW (issue #672). SHA: $env:GITHUB_SHA"
|
|
draft = $false
|
|
prerelease = $false
|
|
} | ConvertTo-Json -Compress
|
|
$headers = @{ "Authorization" = "token $env:RELEASE_TOKEN"; "Content-Type" = "application/json" }
|
|
$rel = Invoke-RestMethod -Uri "https://git.yowieit.com/api/v1/repos/infra/rustdesk-yowie/releases" -Method Post -Headers $headers -Body $body
|
|
Write-Output "release id: $($rel.id), tag: $($rel.tag_name)"
|
|
# Upload rustdesk.exe as release asset via curl.exe (Win 10+ bundled)
|
|
# — PowerShell multipart binary handling is fragile; curl.exe -F is bulletproof.
|
|
$assetUri = "https://git.yowieit.com/api/v1/repos/infra/rustdesk-yowie/releases/$($rel.id)/assets?name=rustdesk.exe"
|
|
& curl.exe -sk -X POST `
|
|
-H "Authorization: token $env:RELEASE_TOKEN" `
|
|
-F "attachment=@target/release/rustdesk.exe" `
|
|
"$assetUri"
|
|
Write-Output ""
|
|
Write-Output "release asset URL: https://git.yowieit.com/infra/rustdesk-yowie/releases/download/$tag/rustdesk.exe"
|