forked from dotnet/dotnet-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-AspireDropVersions.ps1
42 lines (35 loc) · 1.39 KB
/
Get-AspireDropVersions.ps1
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
30
31
32
33
34
35
36
37
38
39
40
41
42
<#
.SYNOPSIS
Returns the various component versions of the latest .NET build.
#>
[cmdletbinding()]
param(
# The release channel to use for determining the latest .NET build.
[Parameter(ParameterSetName = "Channel")]
[string]
$Channel,
[Parameter(ParameterSetName = "Explicit")]
# Aspire version to target
[string]
$AspireVersion
)
$ErrorActionPreference = 'Stop'
Import-Module -force $PSScriptRoot/DependencyManagement.psm1
if ($Channel) {
# Example channel: '8.0/daily'
$akaMsUrl = "https://aka.ms/dotnet/${Channel}/aspire-dashboard-linux-x64.zip"
$versionSpecificUrl = Resolve-DotnetProductUrl $akaMsUrl
# Assume the versionSpecificUrl is a string like
# https://ci.dot.net/public/aspire/8.0.0-preview.X.YYYYY.Z/aspire-dashboard-linux-x64.zip
$aspireVersion = $versionSpecificUrl -replace '^.*/aspire/([^/]+)/.*$', '$1'
if (Get-IsStableBranding $aspireVersion) {
# The stable version for 8.0.0-preview.4.24105.1 is 8.0.0-preview.4
$aspireVersion = $aspireVersion -replace '^(.*?)-.*$', '$1'
}
} else {
$aspireVersion = $AspireVersion
}
# Grab the major.minor version from the Aspire version string
$dockerfileVersion = $aspireVersion -replace '^(\d+\.\d+).*$', '$1'
Write-Output "##vso[task.setvariable variable=dockerfileVersion]$dockerfileVersion"
Write-Output "##vso[task.setvariable variable=aspireVersion]$aspireVersion"