Skip to content

Instantly share code, notes, and snippets.

@lbussell
Last active April 8, 2024 17:20
Show Gist options
  • Save lbussell/4a1ee1e552e7db69fccbfd359e14984f to your computer and use it in GitHub Desktop.
Save lbussell/4a1ee1e552e7db69fccbfd359e14984f to your computer and use it in GitHub Desktop.
#!/usr/bin/env pwsh
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$buildId
)
$configPath = "$PSScriptRoot/config.json";
$setVersionsScript = "$PSScriptRoot/Set-DotnetVersions.ps1"
az pipelines runs artifact download --organization https://dev.azure.com/dnceng/ --project internal --run-id $buildId --path $PSScriptRoot --artifact-name drop
$config = $(Get-Content -Path $configPath | Out-String) | ConvertFrom-Json
Remove-Item -Force $configPath
# Set variables
$Channel = $config.Channel
$Runtime = $config.Runtime
$Asp = $config.Asp
$Sdk = $config.Sdks[0]
# Output the variables to verify
Write-Host "`r`nChannel: $Channel, Runtime: $Runtime, Aspnet: $Asp, SDK: $Sdk`r`n"
$commitMessage = "Updates for .NET $Runtime/$Sdk"
& $setVersionsScript -ProductVersion $Channel -SdkVersion $Sdk -RuntimeVersion $Runtime -AspnetVersion $Asp
Write-Host "`r`nCommit message:`r`n"
Write-Host "$commitMessage`r`n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment