Skip to content

Commit

Permalink
Merge pull request #1160 from AArnott/depUpdates
Browse files Browse the repository at this point in the history
Merge Library.Template and update dependencies
  • Loading branch information
AArnott authored Feb 28, 2023
2 parents 29844d5 + d452518 commit acf19bc
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*.sh eol=lf
*.ps1 eol=lf

# The macOS codesign tool is extremely picky, and requires LF line endings.
*.plist eol=lf

###############################################################################
# Set default behavior for command prompt diff.
#
Expand Down
15 changes: 7 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>

<MicroBuildVersion>2.0.107</MicroBuildVersion>
<MicroBuildVersion>2.0.113</MicroBuildVersion>
<CodeAnalysisVersion>3.11.0</CodeAnalysisVersion>
<CodeAnalysisVersion Condition="'$(IsTestProject)'=='true'">4.4.0</CodeAnalysisVersion>
<CodefixTestingVersion>1.1.1</CodefixTestingVersion>
<MicrosoftDiagnosticsRuntimeVersion>2.3.405501</MicrosoftDiagnosticsRuntimeVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="DNNE" Version="1.0.32" />
<PackageVersion Include="DNNE" Version="2.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="$(CodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
Expand All @@ -21,21 +20,21 @@
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.0-beta2.final" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="$(CodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" Version="$(CodefixTestingVersion)" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.5.0-release-20230131-04" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.5.0" />
<PackageVersion Include="Microsoft.Diagnostics.Runtime.Utilities" Version="$(MicrosoftDiagnosticsRuntimeVersion)" />
<PackageVersion Include="Microsoft.Diagnostics.Runtime" Version="$(MicrosoftDiagnosticsRuntimeVersion)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.4.33103.184" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.4.33103.184" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Framework" Version="17.4.33103.184" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.0.71" />
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.1.691-beta" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.188-beta" />
<PackageVersion Include="Nullable" Version="1.3.1" />
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
Expand All @@ -55,4 +54,4 @@
<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>
</Project>
</Project>
3 changes: 2 additions & 1 deletion azure-pipelines/microbuild.after.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ steps:
inputs:
TargetFolders: |
$(Build.SourcesDirectory)/bin/Packages/$(BuildConfiguration)/NuGet
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

- task: MicroBuildCleanup@1
condition: succeededOrFailed()
Expand Down Expand Up @@ -42,7 +43,7 @@ steps:
/repoName:$(Build.Repository.Name)
/additionalCodexArguments:-bld
/additionalCodexArguments:$(Build.ArtifactStagingDirectory)/build_logs
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), ne(variables['Build.Reason'], 'PullRequest'))
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Agent.OS'], 'Windows_NT'))
continueOnError: true

- ${{ if eq(parameters.EnableCompliance, 'true') }}:
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines/microbuild.before.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ steps:
inputs:
outputfile: $(System.DefaultWorkingDirectory)/obj/NOTICE
outputformat: text
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))

- task: MicroBuildOptProfPlugin@6
inputs:
Expand All @@ -30,6 +31,8 @@ steps:
signType: $(SignType)
zipSources: false
displayName: 🔧 Install MicroBuild Signing Plugin
condition: and(succeeded(), or(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['SignType'], 'real')))

- task: MicroBuildSbomPlugin@1
displayName: 🔧 Install MicroBuild Sbom Plugin
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
23 changes: 10 additions & 13 deletions azure-pipelines/prepare-insertion-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,22 @@ stages:
- checkout: none
- download: current
artifact: Variables-Windows
displayName: Download Variables-Windows artifact
- task: PowerShell@2
displayName: Set pipeline variables based on artifacts
inputs:
targetType: filePath
filePath: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1
displayName: 🔻 Download Variables-Windows artifact
- powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1
displayName: ⚙️ Set pipeline variables based on artifacts
- download: current
artifact: symbols-legacy
displayName: Download symbols-legacy artifact
displayName: 🔻 Download symbols-legacy artifact
- task: MicroBuildArchiveSymbols@1
displayName: Archive symbols to Symweb
displayName: 🔣 Archive symbols to Symweb
inputs:
SymbolsFeatureName: $(SymbolsFeatureName)
SymbolsSymwebProject: VS
SymbolsUncPath: \\cpvsbuild\drops\$(TeamName)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildId)\Symbols.Archival
SymbolsEmailContacts: vsidemicrobuild
SymbolsAgentPath: $(Pipeline.Workspace)/symbols-legacy
- task: MicroBuildCleanup@1
displayName: Send Telemetry
displayName: ☎️ Send Telemetry

- stage: azure_public_vssdk_feed
displayName: azure-public/vssdk feed
Expand All @@ -41,16 +38,16 @@ stages:
- checkout: none
- download: current
artifact: deployables-Windows
displayName: Download deployables-Windows artifact
displayName: 🔻 Download deployables-Windows artifact
- task: UseDotNet@2
displayName: Install .NET SDK
displayName: ⚙️ Install .NET SDK
inputs:
packageType: sdk
version: 6.x
- task: NuGetAuthenticate@1
displayName: Authenticate NuGet feeds
displayName: 🔏 Authenticate NuGet feeds
inputs:
nuGetServiceConnections: azure-public/vssdk
forceReinstallCredentialProvider: true
- script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json --api-key azdo --skip-duplicate
displayName: Push nuget packages
displayName: 📦 Push nuget packages
9 changes: 3 additions & 6 deletions azure-pipelines/release-deployment-prep.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
steps:
- download: CI
artifact: Variables-Windows
displayName: Download Variables-Windows artifact
- task: PowerShell@2
displayName: Set pipeline variables based on artifacts
inputs:
targetType: filePath
filePath: $(Pipeline.Workspace)/CI/Variables-Windows/_pipelines.ps1
displayName: 🔻 Download Variables-Windows artifact
- powershell: $(Pipeline.Workspace)/CI/Variables-Windows/_pipelines.ps1
displayName: ⚙️ Set pipeline variables based on artifacts
16 changes: 8 additions & 8 deletions azure-pipelines/vs-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ jobs:
steps:
- checkout: none
- powershell: Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
displayName: Set pipeline name
displayName: ⚙️ Set pipeline name
- task: UseDotNet@2
displayName: Install .NET SDK
displayName: ⚙️ Install .NET SDK
inputs:
packageType: sdk
version: 6.x
- task: NuGetAuthenticate@1
displayName: Authenticate NuGet feeds
displayName: 🔏 Authenticate NuGet feeds
inputs:
forceReinstallCredentialProvider: true
- template: release-deployment-prep.yml
- download: CI
artifact: VSInsertion-Windows
displayName: Download VSInsertion-Windows artifact
displayName: 🔻 Download VSInsertion-Windows artifact
- script: dotnet nuget push $(Pipeline.Workspace)\CI\VSInsertion-windows\*.nupkg -s https://pkgs.dev.azure.com/devdiv/_packaging/VS/nuget/v3/index.json -k azdo --skip-duplicate
displayName: Push CoreXT packages to VS feed
displayName: 📦 Push CoreXT packages to VS feed
- task: MicroBuildInsertVsPayload@4
displayName: Insert VS Payload
displayName: 🏭 Insert VS Payload
inputs:
TeamName: $(TeamName)
TeamEmail: $(TeamEmail)
Expand All @@ -45,7 +45,7 @@ jobs:
AutoCompletePR: true
AutoCompleteMergeStrategy: Squash
- task: MicroBuildCleanup@1
displayName: Send Telemetry
displayName: ☎️ Send Telemetry
- powershell: |
$contentType = 'application/json';
$headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
Expand All @@ -54,4 +54,4 @@ jobs:
Write-Host $request
$uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1";
Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request;
displayName: Retain inserted builds
displayName: 🗻 Retain inserted builds
23 changes: 10 additions & 13 deletions azure-pipelines/vs-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,27 @@ stages:
clean: true
fetchDepth: 1
- task: UseDotNet@2
displayName: Install .NET SDK
displayName: ⚙️ Install .NET SDK
inputs:
packageType: sdk
version: 6.x
- task: NuGetAuthenticate@1
displayName: Authenticate NuGet feeds
displayName: 🔏 Authenticate NuGet feeds
inputs:
forceReinstallCredentialProvider: true
- download: current
artifact: Variables-Windows
displayName: Download Variables-Windows artifact
- task: PowerShell@2
displayName: Set pipeline variables based on artifacts
inputs:
targetType: filePath
filePath: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1
displayName: 🔻 Download Variables-Windows artifact
- powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1
displayName: ⚙️ Set pipeline variables based on artifacts
- download: current
artifact: VSInsertion-Windows
displayName: Download VSInsertion-Windows artifact
displayName: 🔻 Download VSInsertion-Windows artifact
- script: dotnet nuget push VSInsertion-windows\*.nupkg -s https://pkgs.dev.azure.com/devdiv/_packaging/VS/nuget/v3/index.json -k azdo --skip-duplicate
displayName: Push CoreXT packages to VS feed
displayName: 📦 Push CoreXT packages to VS feed
workingDirectory: $(Pipeline.Workspace)
- task: MicroBuildInsertVsPayload@4
displayName: Insert VS Payload
displayName: 🏭 Insert VS Payload
inputs:
TeamName: $(TeamName)
TeamEmail: $(TeamEmail)
Expand All @@ -78,7 +75,7 @@ stages:
Remember to Abandon and (if allowed) to Delete Source Branch on that insertion PR when validation is complete.
"@
azure-pipelines/PostPRMessage.ps1 -AccessToken '$(System.AccessToken)' -Markdown $Markdown -Verbose
displayName: Comment on pull request
displayName: ✏️ Comment on pull request
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- task: MicroBuildCleanup@1
displayName: Send Telemetry
displayName: ☎️ Send Telemetry
14 changes: 12 additions & 2 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
Install the MicroBuild SBOM plugin.
.PARAMETER AccessToken
An optional access token for authenticating to Azure Artifacts authenticated feeds.
.PARAMETER Interactive
Runs NuGet restore in interactive mode. This can turn authentication failures into authentication challenges.
#>
[CmdletBinding(SupportsShouldProcess = $true)]
Param (
Expand All @@ -63,7 +65,9 @@ Param (
[Parameter()]
[switch]$SBOM,
[Parameter()]
[string]$AccessToken
[string]$AccessToken,
[Parameter()]
[switch]$Interactive
)

$EnvVars = @{}
Expand Down Expand Up @@ -95,8 +99,14 @@ try {
$HeaderColor = 'Green'

if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
$RestoreArguments = @()
if ($Interactive)
{
$RestoreArguments += '--interactive'
}

Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor
dotnet restore
dotnet restore @RestoreArguments
if ($lastexitcode -ne 0) {
throw "Failure while restoring packages."
}
Expand Down
7 changes: 3 additions & 4 deletions tools/Install-DotNetSdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,18 @@ Function Get-FileFromWeb([Uri]$Uri, $OutDir) {
}

Function Get-InstallerExe(
$Version,
[Version]$Version,
$Architecture,
[ValidateSet('Sdk','Runtime','WindowsDesktop')]
[string]$sku
) {
# Get the latest/actual version for the specified one
$TypedVersion = [Version]$Version
if ($TypedVersion.Build -eq -1) {
if ($Version.Build -eq -1) {
$versionInfo = -Split (Invoke-WebRequest -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sku/$Version/latest.version" -UseBasicParsing)
$Version = $versionInfo[-1]
}

$majorMinor = "$($TypedVersion.Major).$($TypedVersion.Minor)"
$majorMinor = "$($Version.Major).$($Version.Minor)"
$ReleasesFile = Join-Path $DotNetInstallScriptRoot "$majorMinor\releases.json"
if (!(Test-Path $ReleasesFile)) {
Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/$majorMinor/releases.json" -OutDir (Split-Path $ReleasesFile) | Out-Null
Expand Down

0 comments on commit acf19bc

Please sign in to comment.