diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85274ff..826d6ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,9 +13,20 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - uses: nuget/setup-nuget@v1.0.2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100 + - uses: nuget/setup-nuget@v1.0.5 - name: Restore run: nuget restore src/BehaviorsSdk.sln - - uses: microsoft/setup-msbuild@v1.0.1 + - uses: microsoft/setup-msbuild@v1.0.2 - name: Build run: msbuild src/BehaviorsSdk.sln /p:Configuration=Release + - name: Pack Behaviors + if: success() + run: msbuild src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj /p:Configuration=Release -t:pack + - name: Upload NuGet Artifacts + if: success() + uses: actions/upload-artifact@v2 + with: + path: src/Microsoft.Xaml.Behaviors/bin/Release/*.nupkg diff --git a/Test/UnitTests/UnitTests.csproj b/Test/UnitTests/UnitTests.csproj index d47aa7b..8f722f4 100644 --- a/Test/UnitTests/UnitTests.csproj +++ b/Test/UnitTests/UnitTests.csproj @@ -1,6 +1,6 @@ - + - net45;netcoreapp3.0;netcoreapp3.1 + net45;netcoreapp3.1;net5.0-windows false true Library @@ -20,5 +20,5 @@ - + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 21a9b73..fb9f3c4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ pr: - rel/* pool: - vmImage: windows-2019 + vmImage: windows-latest variables: buildConfiguration: Release @@ -19,25 +19,29 @@ steps: custom: tool arguments: install --tool-path . nbgv displayName: Install NBGV tool - + - script: nbgv cloud displayName: Set Version -- task: MSBuild@1 +- task: UseDotNet@2 + displayName: 'Use .NET Core sdk 5.0' + inputs: + packageType: sdk + version: 5.0.100 + +- task: DotNetCoreCLI@2 displayName: Build Solution inputs: - solution: src/*.sln - msbuildArguments: /restore - configuration: $(buildConfiguration) - maximumCpuCount: false + command: build + projects: src/*.sln + arguments: '--configuration $(buildConfiguration)' -- task: MSBuild@1 +- task: DotNetCoreCLI@2 displayName: Pack Behaviors inputs: - solution: src/**/Microsoft.Xaml.Behaviors.csproj - msbuildArguments: /t:Pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory) - configuration: $(buildConfiguration) - maximumCpuCount: false + command: pack + packagesToPack: src/**/Microsoft.Xaml.Behaviors.csproj + arguments: '--configuration $(buildConfiguration)' - task: VSTest@2 displayName: Run Tests diff --git a/src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj b/src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj index 5815748..8bd3af3 100644 --- a/src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj +++ b/src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj @@ -1,6 +1,6 @@ - + - net45;netcoreapp3.0;netcoreapp3.1 + net45;netcoreapp3.1;net5.0-windows $(TargetsForTfmSpecificBuildOutput);IncludeProjectToProjectAssets Library Microsoft.Xaml.Behaviors.Wpf @@ -35,7 +35,7 @@ true true - + @@ -76,7 +76,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -103,7 +103,7 @@ + Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '3.0'))"> Design