|
| 1 | +queue: VSEng-MicroBuildVS2017 |
| 2 | + |
| 3 | +steps: |
| 4 | +- task: CmdLine@2 |
| 5 | + inputs: |
| 6 | + script: | |
| 7 | + del /s /q "%userprofile%\.nuget\packages" |
| 8 | + del /s /q "%LocalAppData%\NuGet\Cache" |
| 9 | + del /s /q "%AppData%\tsd-cache" |
| 10 | + displayName: Purge package caches |
| 11 | + |
| 12 | +- task: MicroBuildIBCMergePlugin@0 |
| 13 | + inputs: |
| 14 | + branch: svc/d15svc |
| 15 | + |
| 16 | +- task: MicroBuildSigningPlugin@1 |
| 17 | + inputs: |
| 18 | + signType: $(SignType) |
| 19 | + |
| 20 | +- task: PowerShell@2 |
| 21 | + displayName: Set package upload feed |
| 22 | + inputs: |
| 23 | + targetType: inline |
| 24 | + script: | |
| 25 | + if ($env:SignType -eq 'Real') { |
| 26 | + $feedGuid = '09d8d03c-1ac8-456e-9274-4d2364527d99' |
| 27 | + } else { |
| 28 | + $feedGuid = 'da484c78-f942-44ef-b197-99e2a1bef53c' |
| 29 | + } |
| 30 | +
|
| 31 | + Write-Host "##vso[task.setvariable variable=feedGuid]$feedGuid" |
| 32 | +
|
| 33 | +- task: NuGetCommand@2 |
| 34 | + inputs: |
| 35 | + restoreSolution: '**\*.sln' |
| 36 | + feedsToUse: config |
| 37 | + nugetConfigPath: nuget.config |
| 38 | + displayName: Nuget restore packages |
| 39 | + |
| 40 | +- task: NuGetCommand@2 |
| 41 | + inputs: |
| 42 | + restoreSolution: '**\*.sln' |
| 43 | + feedsToUse: config |
| 44 | + nugetConfigPath: nuget.config |
| 45 | + displayName: Nuget restore packages (again, to workaround Nuget bug) |
| 46 | + |
| 47 | +- task: VSBuild@1 |
| 48 | + inputs: |
| 49 | + vsVersion: 15.0 |
| 50 | + msbuildArgs: /t:build,pack |
| 51 | + platform: $(BuildPlatform) |
| 52 | + configuration: $(BuildConfiguration) |
| 53 | + displayName: Build Visual Studio solution |
| 54 | + |
| 55 | +- task: MicroBuildCleanup@1 |
| 56 | + condition: succeededOrFailed() |
| 57 | + |
| 58 | +## The rest of these steps are for deployment and skipped for PR builds |
| 59 | + |
| 60 | +#- task: PublishBuildArtifacts@1 |
| 61 | +# inputs: |
| 62 | +# PathtoPublish: $(build.sourcesdirectory)/bin |
| 63 | +# ArtifactName: bin |
| 64 | +# ArtifactType: Container |
| 65 | +# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 66 | + |
| 67 | +- task: CopyFiles@1 |
| 68 | + inputs: |
| 69 | + SourceFolder: bin |
| 70 | + Contents: | |
| 71 | + Microsoft.VisualStudio.Threading/$(BuildConfiguration)/**/Microsoft.VisualStudio.Threading.dll |
| 72 | + Microsoft.VisualStudio.Threading/$(BuildConfiguration)/**/Microsoft.VisualStudio.Threading.pdb |
| 73 | + Microsoft.VisualStudio.Threading.Analyzers/$(BuildConfiguration)/**/Microsoft.VisualStudio.Threading.Analyzers.dll |
| 74 | + Microsoft.VisualStudio.Threading.Analyzers/$(BuildConfiguration)/**/Microsoft.VisualStudio.Threading.Analyzers.pdb |
| 75 | + TargetFolder: $(Build.ArtifactStagingDirectory)/symbols |
| 76 | + displayName: Collecting symbols artifacts |
| 77 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 78 | + |
| 79 | +- task: PublishBuildArtifacts@1 |
| 80 | + inputs: |
| 81 | + PathtoPublish: $(Build.ArtifactStagingDirectory)/symbols |
| 82 | + ArtifactName: symbols |
| 83 | + ArtifactType: Container |
| 84 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 85 | + |
| 86 | +- task: CopyFiles@1 |
| 87 | + inputs: |
| 88 | + Contents: | |
| 89 | + bin/**/$(BuildConfiguration)/**/*.nupkg |
| 90 | + TargetFolder: $(Build.ArtifactStagingDirectory)/deployables |
| 91 | + flattenFolders: true |
| 92 | + displayName: Collecting deployables |
| 93 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 94 | + |
| 95 | +- task: PublishBuildArtifacts@1 |
| 96 | + inputs: |
| 97 | + PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables |
| 98 | + ArtifactName: deployables |
| 99 | + ArtifactType: Container |
| 100 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 101 | + |
| 102 | +- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 |
| 103 | + inputs: |
| 104 | + symbolServiceURI: "https://microsoft.artifacts.visualstudio.com/DefaultCollection" |
| 105 | + requestName: "CollectionId/$(System.CollectionId)/ProjectId/$(System.TeamProjectId)/BuildId/$(Build.BuildId)" |
| 106 | + sourcePath: "$(Build.ArtifactStagingDirectory)/symbols" |
| 107 | + usePat: "false" |
| 108 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 109 | + |
| 110 | +- task: NuGetCommand@2 |
| 111 | + inputs: |
| 112 | + command: push |
| 113 | + searchPatternPush: '$(Build.SourcesDirectory)\bin\**\$(BuildConfiguration)\**\*.nupkg;!**\*.symbols.nupkg;!**/VS.*.nupkg' |
| 114 | + publishVstsFeed: $(feedGuid) |
| 115 | + allowPackageConflicts: true |
| 116 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
0 commit comments