Some checks failed
rustdesk-auto-build / build-and-publish (push) Has been cancelled
- Implement Build-CustomRustDesk.ps1 to build RustDesk with specified version and configuration. - Create Get-LastBuiltVersion.ps1 to retrieve the last built version from a state file. - Add Get-LatestRustDeskVersion.ps1 to fetch the latest version from GitHub releases. - Develop Invoke-RustDeskPipeline.ps1 to orchestrate the build and deployment process. - Introduce Publish-Artifacts.ps1 for publishing build artifacts via SMB or SCP. - Implement Set-LastBuiltVersion.ps1 to update the state file with the last built version.
18 lines
425 B
PowerShell
18 lines
425 B
PowerShell
function Set-LastBuiltVersion {
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$StateFilePath,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Version
|
|
)
|
|
|
|
$parent = Split-Path -Parent $StateFilePath
|
|
if (-not (Test-Path -LiteralPath $parent)) {
|
|
New-Item -Path $parent -ItemType Directory -Force | Out-Null
|
|
}
|
|
|
|
Set-Content -LiteralPath $StateFilePath -Value $Version -Encoding Ascii
|
|
}
|