Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions .pipelines/templates/release-upload-buildinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
$dateTime = [datetime]::new($dateTime.Ticks - ($dateTime.Ticks % [timespan]::TicksPerSecond), $dateTime.Kind)

$metadata = Get-Content -LiteralPath "$toolsDirectory/metadata.json" -ErrorAction Stop | ConvertFrom-Json
$stableReleaseTag = $metadata.StableReleaseTag -Replace 'v',''

$currentReleaseTag = $buildInfo.ReleaseTag -Replace 'v',''
$stableRelease = $metadata.StableRelease.PublishToChannels
$ltsRelease = $metadata.LTSRelease.PublishToChannels

Expand All @@ -65,40 +68,44 @@ jobs:

$buildInfo = $buildInfoJsonContent | ConvertFrom-Json
$buildInfo.ReleaseDate = $dateTime
$currentReleaseTag = $buildInfo.ReleaseTag -Replace 'v',''

$targetFile = "$ENV:PIPELINE_WORKSPACE/$fileName"
ConvertTo-Json -InputObject $buildInfo | Out-File $targetFile -Encoding ascii

if ($stableRelease -or $fileName -eq "preview.json") {
Set-BuildVariable -Name CopyMainBuildInfo -Value YES
if ($fileName -eq "preview.json") {
Set-BuildVariable -Name UploadPreview -Value YES
} else {
Set-BuildVariable -Name CopyMainBuildInfo -Value NO
Set-BuildVariable -Name UploadPreview -Value NO
}

Set-BuildVariable -Name BuildInfoJsonFile -Value $targetFile

## Create 'lts.json' if it's the latest stable and also a LTS release.
Set-BuildVariable -Name PreviewBuildInfoFile -Value $targetFile

## Create 'lts.json' if marked as a LTS release.
if ($fileName -eq "stable.json") {
[System.Management.Automation.SemanticVersion] $stableVersion = $stableReleaseTag
[System.Management.Automation.SemanticVersion] $currentVersion = $currentReleaseTag
if ($ltsRelease) {
$ltsFile = "$ENV:PIPELINE_WORKSPACE/lts.json"
Copy-Item -Path $targetFile -Destination $ltsFile -Force
Set-BuildVariable -Name LtsBuildInfoJsonFile -Value $ltsFile
Set-BuildVariable -Name CopyLTSBuildInfo -Value YES
Set-BuildVariable -Name LTSBuildInfoFile -Value $ltsFile
Set-BuildVariable -Name UploadLTS -Value YES
} else {
Set-BuildVariable -Name CopyLTSBuildInfo -Value NO
Set-BuildVariable -Name UploadLTS -Value NO
}

$releaseTag = $buildInfo.ReleaseTag
$version = $releaseTag -replace '^v'
$semVersion = [System.Management.Automation.SemanticVersion] $version
## Only update the stable.json if the current version is greater than the stable version.
if ($currentVersion -gt $stableVersion) {
$versionFile = "$ENV:PIPELINE_WORKSPACE/$($currentVersion.Major)-$($currentVersion.Minor).json"
Copy-Item -Path $targetFile -Destination $versionFile -Force
Set-BuildVariable -Name StableBuildInfoFile -Value $versionFile
Set-BuildVariable -Name UploadStable -Value YES
} else {
Set-BuildVariable -Name UploadStable -Value NO
}

$versionFile = "$ENV:PIPELINE_WORKSPACE/$($semVersion.Major)-$($semVersion.Minor).json"
Copy-Item -Path $targetFile -Destination $versionFile -Force
Set-BuildVariable -Name VersionBuildInfoJsonFile -Value $versionFile
Set-BuildVariable -Name CopyVersionBuildInfo -Value YES
} else {
Set-BuildVariable -Name CopyVersionBuildInfo -Value NO
Set-BuildVariable -Name UploadStable -Value NO
}
displayName: Create json files

Expand All @@ -116,24 +123,27 @@ jobs:

$storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount

if ($env:CopyMainBuildInfo -eq 'YES') {
$jsonFile = "$env:BuildInfoJsonFile"
#preview
if ($env:UploadPreview -eq 'YES') {
$jsonFile = "$env:PreviewBuildInfoFile"
$blobName = Get-Item $jsonFile | Split-Path -Leaf
Write-Verbose -Verbose "Uploading $jsonFile to $containerName/$prefix/$blobName"
Set-AzStorageBlobContent -File $jsonFile -Container $containerName -Blob "$prefix/$blobName" -Context $storageContext -Force
}

if ($env:CopyLTSBuildInfo -eq 'YES') {
$jsonFile = "$env:LtsBuildInfoJsonFile"
#LTS
if ($env:UploadLTS -eq 'YES') {
$jsonFile = "$env:LTSBuildInfoFile"
$blobName = Get-Item $jsonFile | Split-Path -Leaf
Write-Verbose -Verbose "Uploading $jsonFile to $containerName/$prefix/$blobName"
Set-AzStorageBlobContent -File $jsonFile -Container $containerName -Blob "$prefix/$blobName" -Context $storageContext -Force
}

if ($env:CopyVersionBuildInfo -eq 'YES') {
$jsonFile = "$env:VersionBuildInfoJsonFile"
#stable
if ($env:UploadStable -eq 'YES') {
$jsonFile = "$env:StableBuildInfoFile"
$blobName = Get-Item $jsonFile | Split-Path -Leaf
Write-Verbose -Verbose "Uploading $jsonFile to $containerName/$prefix/$blobName"
Set-AzStorageBlobContent -File $jsonFile -Container $containerName -Blob "$prefix/$blobName" -Context $storageContext -Force
}
condition: and(succeeded(), eq(variables['CopyMainBuildInfo'], 'YES'))
condition: and(succeeded(), or(eq(variables['UploadPreview'], 'YES'), eq(variables['UploadLTS'], 'YES'), eq(variables['UploadStable'], 'YES')))
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "10.0.101"
"version": "10.0.102"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="10.0.1" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="10.0.2" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.1" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="10.0.1" />
<PackageReference Include="System.Drawing.Common" Version="10.0.2" />
<PackageReference Include="JsonSchema.Net" Version="7.4.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.Diagnostics.EventLog" Version="10.0.1" />
<PackageReference Include="System.Diagnostics.EventLog" Version="10.0.2" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@

<ItemGroup>
<!-- This section is to force the version of non-direct dependencies -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="10.0.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="10.0.2" />
<!-- the following package(s) are from https://github.com/dotnet/fxdac -->
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.IO.Packaging" Version="10.0.1" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="10.0.1" />
<PackageReference Include="System.IO.Packaging" Version="10.0.2" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="10.0.2" />
<!-- the following package(s) are from https://github.com/dotnet/wcf -->
<PackageReference Include="System.ServiceModel.Http" Version="10.0.0-rc.2.final" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="10.0.0-rc.2.final" />
<PackageReference Include="System.ServiceModel.Primitives" Version="10.0.0-rc.2.final" />
<!-- the source could not be found for the following package(s) -->
<PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<ProjectReference Include="..\Microsoft.WSMan.Runtime\Microsoft.WSMan.Runtime.csproj" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.1" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="10.0.2" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<!-- the Application Insights package -->
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="10.0.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
<PackageReference Include="System.DirectoryServices" Version="10.0.1" />
<PackageReference Include="System.Management" Version="10.0.1" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.1" />
<PackageReference Include="System.Security.Permissions" Version="10.0.1" />
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="10.0.2" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.2" />
<PackageReference Include="System.DirectoryServices" Version="10.0.2" />
<PackageReference Include="System.Management" Version="10.0.2" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.2" />
<PackageReference Include="System.Security.Permissions" Version="10.0.2" />
<!-- the following package(s) are from the powershell org -->
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
<PackageReference Include="Microsoft.PowerShell.Native" Version="700.0.0-preview.2" />
Expand Down
2 changes: 1 addition & 1 deletion test/tools/TestService/TestService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/tools/WebListener/WebListener.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.2" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion test/xUnit/xUnit.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="XunitXml.TestLogger" Version="7.1.0" />
<PackageReference Include="XunitXml.TestLogger" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
</ItemGroup>

Expand Down
Loading
Loading