-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing MSBuild with dotnet in build.yml (#199)
* Replaced MSBuild with dotnet in build.yml * Bump version to 5.1.1 back
- Loading branch information
1 parent
ce7ce3b
commit 471b66d
Showing
6 changed files
with
126 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,76 @@ | ||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'windows-2019' | ||
|
||
variables: | ||
solution: 'JWT.sln' | ||
buildConfiguration: 'Release' | ||
buildPlatform: 'Any CPU' | ||
dotNetVersion: '2.2.106' | ||
|
||
steps: | ||
- task: DotNetCoreInstaller@0 | ||
displayName: Install .NET Core v$(dotNetVersion) | ||
inputs: | ||
version: $(dotNetVersion) | ||
|
||
- task: MSBuild@1 | ||
displayName: Build solution | ||
inputs: | ||
solution: $(solution) | ||
msbuildArguments: /restore /t:build /p:CreatePackage=true /p:NoPackageAnalysis=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts | ||
configuration: $(BuildConfiguration) | ||
maximumCpuCount: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Run .NET Core tests | ||
inputs: | ||
command: 'test' | ||
projects: 'tests/**/JWT.Tests.Core.csproj' | ||
arguments: ' -c $(buildConfiguration) --no-build --no-restore' | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' | ||
testResultsFormat: 'xUnit' | ||
failTaskOnFailedTests: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Run .NET Framework tests | ||
inputs: | ||
command: 'test' | ||
projects: 'tests/**/JWT.Tests.NetFramework.csproj' | ||
arguments: ' -c $(buildConfiguration) --no-build --no-restore' | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' | ||
testResultsFormat: 'xUnit' | ||
failTaskOnFailedTests: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Package NuGet package | ||
inputs: | ||
command: pack | ||
packagesToPack: 'src/**/*.csproj' | ||
configuration: $(BuildConfiguration) | ||
nobuild: true | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: Publish build artifacts | ||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'windows-2019' | ||
|
||
variables: | ||
solution: 'JWT.sln' | ||
buildConfiguration: 'Release' | ||
buildPlatform: 'Any CPU' | ||
coreVersion: '2.2.106' | ||
nugetVersion: '4.9.4' | ||
|
||
steps: | ||
- task: DotNetCoreInstaller@0 | ||
displayName: Install .NET Core v$(coreVersion) | ||
inputs: | ||
version: $(coreVersion) | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Restore NuGet packages for .NET Core' | ||
inputs: | ||
command: 'restore' | ||
projects: '**/*.csproj' | ||
|
||
- task: NuGetToolInstaller@0 | ||
displayName: Install NuGet v$(nugetVersion) | ||
inputs: | ||
versionSpec: $(nugetVersion) | ||
checkLatest: true | ||
|
||
- task: NuGetCommand@2 | ||
displayName: 'Restore NuGet packages for .NET Framework' | ||
inputs: | ||
command: 'restore' | ||
restoreSolution: $(solution) | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Build solution' | ||
inputs: | ||
command: 'build' | ||
projects: '$(solution)' | ||
arguments: '-c $(buildConfiguration)' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Run .NET Core tests | ||
inputs: | ||
command: 'test' | ||
projects: 'tests/**/JWT.Tests.Core.csproj' | ||
arguments: ' -c $(buildConfiguration) --no-build --no-restore' | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' | ||
testResultsFormat: 'xUnit' | ||
failTaskOnFailedTests: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Run .NET Framework tests | ||
inputs: | ||
command: 'test' | ||
projects: 'tests/**/JWT.Tests.NetFramework.csproj' | ||
arguments: ' -c $(buildConfiguration) --no-build --no-restore' | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' | ||
testResultsFormat: 'xUnit' | ||
failTaskOnFailedTests: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Package NuGet package | ||
inputs: | ||
command: pack | ||
packagesToPack: 'src/**/*.csproj' | ||
configuration: $(BuildConfiguration) | ||
nobuild: true | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: Publish build artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net462" /> | ||
<package id="xunit" version="2.4.1" targetFramework="net462" /> | ||
<package id="xunit.abstractions" version="2.0.3" targetFramework="net462" /> | ||
<package id="xunit.analyzers" version="0.10.0" targetFramework="net462" /> | ||
<package id="xunit.assert" version="2.4.1" targetFramework="net462" /> | ||
<package id="xunit.core" version="2.4.1" targetFramework="net462" /> | ||
<package id="xunit.extensibility.core" version="2.4.1" targetFramework="net462" /> | ||
<package id="xunit.extensibility.execution" version="2.4.1" targetFramework="net462" /> | ||
<package id="xunit.runner.visualstudio" version="2.4.1" targetFramework="net462" developmentDependency="true" /> | ||
</packages> |