49 lines
1.3 KiB
PowerShell
49 lines
1.3 KiB
PowerShell
# Test script to demonstrate artifact naming for different versions
|
|
Write-Host "=== Artifact Naming Test ==="
|
|
Write-Host ""
|
|
|
|
# Test current version
|
|
$packageJsonPath = ".\package.json"
|
|
$packageJson = Get-Content $packageJsonPath | ConvertFrom-Json
|
|
$currentVersion = $packageJson.version
|
|
|
|
Write-Host "Current version: $currentVersion"
|
|
|
|
# Function to get artifact suffix
|
|
function Get-ArtifactSuffix($version) {
|
|
if ($version -match "alpha") {
|
|
return "alpha-${version}-"
|
|
} elseif ($version -match "beta") {
|
|
return "beta-${version}-"
|
|
} else {
|
|
return ""
|
|
}
|
|
}
|
|
|
|
# Test scenarios
|
|
$testVersions = @(
|
|
"1.0.5", # Release version
|
|
"1.0.5-alpha.2", # Alpha version
|
|
"1.0.5-beta.1", # Beta version
|
|
"2.0.0-alpha.1", # Another alpha
|
|
"1.5.0-beta.3" # Another beta
|
|
)
|
|
|
|
Write-Host "Test scenarios:"
|
|
Write-Host "=================="
|
|
|
|
foreach ($version in $testVersions) {
|
|
$suffix = Get-ArtifactSuffix $version
|
|
$artifactName = "imex-partner-${suffix}x64.exe"
|
|
|
|
Write-Host "Version: $version"
|
|
Write-Host " Suffix: '$suffix'"
|
|
Write-Host " Result: $artifactName"
|
|
Write-Host ""
|
|
}
|
|
|
|
Write-Host "Current configuration will produce:"
|
|
$currentSuffix = Get-ArtifactSuffix $currentVersion
|
|
$currentArtifact = "imex-partner-${currentSuffix}x64.exe"
|
|
Write-Host " $currentArtifact"
|