-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCopyLatestToRelease.ps1
More file actions
29 lines (25 loc) · 869 Bytes
/
CopyLatestToRelease.ps1
File metadata and controls
29 lines (25 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
### Run in SolutionDir
$appName = "Fenix2GSX"
$suffix = "latest"
$versionPath = "Installer\Payload\version.json"
$releaseDir = "Releases\"
$includeStamp = $false
Write-Host "Getting App Version ..."
$versionJson = (Get-Content -Raw $versionPath | ConvertFrom-Json)
$version = $versionJson.Version
$version = $version.Substring(0,$version.LastIndexOf('.'))
$timestamp = $versionJson.Timestamp
if (-not (Test-Path $releaseDir)) {
mkdir $releaseDir | Out-Null
}
$releaseFile = "$appName-Installer-v$version.exe"
if ($includeStamp) {
$releaseFile = "$appName-Installer-v$version-$timestamp.exe"
}
$releasePath = Join-Path $releaseDir "$releaseFile"
Write-Host "Exporting $releaseFile ..."
if (-not (Test-Path $releasePath)) {
Copy-Item "$appName-Installer-$suffix.exe" $releasePath | Out-Null
} else {
Write-Host "WARNING: The File '$releaseFile' already exists!"
}