Files
rustdesk-yowie/.gitea/workflows/build.yml
T
alex 9f8aadd01c
Build patched rustdesk.exe / Build Win x64 (Sciter UI) (push) Failing after 22s
ci: use curl.exe for LLVM download (PS5.1 Invoke-WebRequest defaults to TLS 1.0, GitHub rejects)
2026-05-02 22:41:46 +10:00

140 lines
6.3 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 (portable tar.xz, no admin/UAC)
shell: powershell
run: |
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
# Portable tar.xz instead of NSIS installer -- NSIS /S silently
# fails on unprivileged runners (some files missing post-install,
# caught run #4: "LLVM 16 install failed" after Start-Process -Wait
# returned 0). Extract via Windows 10/11 built-in tar.exe.
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_VERSION/clang+llvm-$env:LLVM_VERSION-x86_64-pc-windows-msvc.tar.xz"
$dst = "$env:TEMP\llvm-$env:LLVM_VERSION.tar.xz"
Write-Output "downloading $url"
# curl.exe (Win10+ bundled) uses Schannel -- avoids PS5.1 TLS 1.0
# default that GitHub now rejects (caught run #7: connection
# closed unexpectedly within 500ms).
& curl.exe -L --fail --retry 3 --retry-delay 5 --max-time 900 -o $dst $url
if ($LASTEXITCODE -ne 0) { throw "curl failed downloading LLVM tar.xz (exit $LASTEXITCODE)" }
$size = (Get-Item $dst).Length
Write-Output "downloaded $([math]::Round($size/1MB,2)) MB; extracting"
New-Item -ItemType Directory -Path 'C:\LLVM16-tmp' -Force | Out-Null
& tar.exe -xf $dst -C 'C:\LLVM16-tmp'
$extracted = Get-ChildItem 'C:\LLVM16-tmp' -Directory | Select-Object -First 1
Move-Item $extracted.FullName 'C:\LLVM16' -Force
Remove-Item 'C:\LLVM16-tmp' -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $dst -Force -ErrorAction SilentlyContinue
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
Get-ChildItem 'C:\LLVM16' -Recurse -Filter libclang.dll | Select-Object FullName
throw "LLVM 16 extract failed -- libclang.dll not found"
}
}
Write-Output "libclang.dll: $((Get-Item 'C:\LLVM16\bin\libclang.dll').Length) bytes"
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"