# RustDesk Automated Build and Publish (Gitea + Windows Runner) This repo automates your current manual process: 1. Check latest RustDesk release. 2. Compare with last built version. 3. Build your custom client only when a new version exists. 4. Publish artifacts to your download location. 5. Persist last built version on runner disk. ## Files - `.gitea/workflows/rustdesk-auto-build.yml` - `scripts/Invoke-RustDeskPipeline.ps1` - `scripts/Get-LatestRustDeskVersion.ps1` - `scripts/Get-LastBuiltVersion.ps1` - `scripts/Set-LastBuiltVersion.ps1` - `scripts/Build-CustomRustDesk.ps1` - `scripts/Publish-Artifacts.ps1` ## What you must configure in Gitea Use repo Variables and Secrets in Gitea Actions settings. ### Variables - `STATE_FILE_PATH` - Example: `C:\gitea-runner-state\rustdesk\last-built-version.txt` - `CONFIG_PATH` - Example: `infernalQS.json` - `BUILD_OUTPUT_DIR` - Example: `.\dist` - `DEPLOY_MODE` - `smb` or `scp` - `DESTINATION_PATH` (required for `smb` mode) - Example: `\\fileserver\rustdesk\downloads` - `SCP_DESTINATION` (required for `scp` mode) - Example: `deploy@your-host:/var/www/rustdesk/` ### Secrets - `BUILDER_COMMAND` - A command template to build your custom RustDesk client. - Supported placeholders: - `{{version}}` -> latest RustDesk tag (for example `1.4.2`) - `{{config}}` -> absolute path to config file - `{{output}}` -> absolute output directory path Example `BUILDER_COMMAND` values: ```powershell .\tools\rdgen-cli.exe build --config "{{config}}" --version "{{version}}" --output "{{output}}" ``` ```powershell powershell -File .\tools\build-custom-client.ps1 -Version "{{version}}" -Config "{{config}}" -OutDir "{{output}}" ``` ## Runner prerequisites Your existing self-hosted Windows runner should have: - Internet access to GitHub API (`api.github.com`). - Access to the destination path (SMB share or SCP target). - Build toolchain needed by your `BUILDER_COMMAND`. - `scp` available only if using `DEPLOY_MODE=scp`. ## First run checklist 1. Put your real build command in `BUILDER_COMMAND` secret. 2. Make sure `infernalQS.json` in repo is the config you want. 3. Set `STATE_FILE_PATH` to a persistent local path on runner machine. 4. Set deploy mode and destination. 5. Trigger workflow manually once (`workflow_dispatch`). 6. Confirm artifacts were copied and `latest-version.txt` appears in output. ## Behavior notes - Schedule runs hourly (`17 * * * *`). - If latest RustDesk version equals saved state, build is skipped. - On successful publish, state file is updated. ## Common adjustments - Change schedule in `.gitea/workflows/rustdesk-auto-build.yml`. - Add runner labels to `runs-on` if your runner uses custom labels. - Extend `Publish-Artifacts.ps1` if you need extra deployment steps.