80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
# CI build with the upload to MyGet
|
|
|
|
variables:
|
|
DotNetVersion2: "2.1.x"
|
|
DotNetVersion3: "3.1.x"
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- master
|
|
tags:
|
|
'*'
|
|
|
|
# no PR builds
|
|
pr: none
|
|
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
|
|
steps:
|
|
- task: UseDotNet@2
|
|
displayName: force use of dotnet 2.1.x
|
|
inputs:
|
|
version: $(DotNetVersion2)
|
|
|
|
- task: UseDotNet@2
|
|
displayName: force use of dotnet 3.1.x
|
|
inputs:
|
|
version: $(DotNetVersion3)
|
|
|
|
# "restore" is run automatically by "build"
|
|
- task: VSBuild@1
|
|
displayName: build solution using VS (Release)
|
|
inputs:
|
|
solution: OpenTelemetry.proj
|
|
vsVersion: "latest"
|
|
platform: "AnyCPU"
|
|
configuration: "Release"
|
|
msbuildArgs: "/target:build /p:OS=$(Agent.OS)"
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: test using CLI
|
|
inputs:
|
|
command: "test"
|
|
projects: |
|
|
test/**/*.Tests.csproj
|
|
arguments: "-p:CollectCoverage=false --configuration Release"
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
- task: VSBuild@1
|
|
displayName: pack solution with symbols (Release)
|
|
inputs:
|
|
solution: OpenTelemetry.proj
|
|
vsVersion: "latest"
|
|
platform: "AnyCPU"
|
|
configuration: "Release"
|
|
msbuildArgs: "/target:pack /p:OS=$(Agent.OS) /p:SymbolPackageFormat=snupkg /p:NoBuild=true"
|
|
|
|
- task: CopyFiles@2
|
|
inputs:
|
|
contents: '**/bin/**/*.*nupkg'
|
|
targetFolder: $(Build.ArtifactStagingDirectory)
|
|
flattenFolders: true
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'Publish nugets to MyGet'
|
|
inputs:
|
|
command: push
|
|
nuGetFeedType: external
|
|
publishFeedCredentials: 'myget-opentelemetry'
|
|
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
|
|
|
|
# this task is required as symbols packages needs to be published manually.
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
|
|
ArtifactName: "drop"
|
|
ArtifactType: "Container"
|