|
| 1 | +parameters: |
| 2 | + name: OSTarget |
| 3 | + type: string |
| 4 | + default: 'win-x86' |
| 5 | + |
| 6 | +steps: |
| 7 | + - task: MicroBuildSigningPlugin@3 |
| 8 | + displayName: 'Install microbuild signing plugin' |
| 9 | + condition: notin(variables['Build.Reason'], 'PullRequest') |
| 10 | + inputs: |
| 11 | + signType: 'Real' |
| 12 | + zipSources: false |
| 13 | + |
| 14 | + - task: UseDotNet@2 |
| 15 | + displayName: 'Use .Net Core SDK 3.1.x' |
| 16 | + inputs: |
| 17 | + version: 3.1.x |
| 18 | + |
| 19 | + - task: DotNetCoreCLI@2 |
| 20 | + displayName: 'dotnet restore' |
| 21 | + inputs: |
| 22 | + command: restore |
| 23 | + projects: | |
| 24 | + src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj |
| 25 | + src/Publish/SignLayout.csproj |
| 26 | + restoreDirectory: '$(Build.BinariesDirectory)' |
| 27 | + |
| 28 | + - task: DotNetCoreCLI@2 |
| 29 | + displayName: 'dotnet publish LanguageServer' |
| 30 | + inputs: |
| 31 | + command: publish |
| 32 | + publishWebProjects: false |
| 33 | + projects: src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj |
| 34 | + arguments: '-c $(BuildConfiguration) -r ${{ parameters.OSTarget }} -o $(Build.BinariesDirectory)/out /p:SignType=None /p:Version=$(Build.BuildNumber)' |
| 35 | + zipAfterPublish: false |
| 36 | + modifyOutputPath: false |
| 37 | + condition: and(succeeded(), ne('${{ parameters.OSTarget }}', 'any')) |
| 38 | + |
| 39 | + - task: DotNetCoreCLI@2 |
| 40 | + displayName: 'dotnet publish LanguageServer for Any' |
| 41 | + inputs: |
| 42 | + command: publish |
| 43 | + publishWebProjects: false |
| 44 | + projects: src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj |
| 45 | + arguments: '-c $(BuildConfiguration) -o $(Build.BinariesDirectory)/out /p:SignType=None /p:Version=$(Build.BuildNumber)' |
| 46 | + zipAfterPublish: false |
| 47 | + modifyOutputPath: false |
| 48 | + condition: and(succeeded(), eq('${{ parameters.OSTarget }}', 'any')) |
| 49 | + |
| 50 | + - task: MSBuild@1 |
| 51 | + displayName: 'Sign assemblies' |
| 52 | + condition: notin(variables['Build.Reason'], 'PullRequest') |
| 53 | + inputs: |
| 54 | + solution: src/Publish/SignLayout.csproj |
| 55 | + platform: '$(BuildPlatform)' |
| 56 | + configuration: '$(BuildConfiguration)' |
| 57 | + msbuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\out /p:SignServer=true /p:SignParser=true' |
| 58 | + |
| 59 | + - task: NuGetCommand@2 |
| 60 | + displayName: 'NuGet pack language server' |
| 61 | + inputs: |
| 62 | + command: pack |
| 63 | + packagesToPack: 'src/LanguageServer/Impl/Python-Language-Server.nuspec' |
| 64 | + packDestination: '$(Build.ArtifactStagingDirectory)\packages' |
| 65 | + versioningScheme: byEnvVar |
| 66 | + versionEnvVar: NugetPackageVersion |
| 67 | + buildProperties: 'os=-${{ parameters.OSTarget }}' |
| 68 | + basePath: '$(Build.BinariesDirectory)/out' |
| 69 | + |
| 70 | + - task: NuGetCommand@2 |
| 71 | + displayName: 'NuGet pack parsing' |
| 72 | + inputs: |
| 73 | + command: pack |
| 74 | + packagesToPack: 'src/Parsing/Impl/Microsoft-Python-Parsing.nuspec' |
| 75 | + packDestination: '$(Build.ArtifactStagingDirectory)\packages' |
| 76 | + versioningScheme: byEnvVar |
| 77 | + versionEnvVar: NugetPackageVersion |
| 78 | + buildProperties: 'os=-${{ parameters.OSTarget }}' |
| 79 | + basePath: '$(Build.BinariesDirectory)/out' |
| 80 | + |
| 81 | + - task: MSBuild@1 |
| 82 | + displayName: 'Sign packages' |
| 83 | + condition: notin(variables['Build.Reason'], 'PullRequest') |
| 84 | + inputs: |
| 85 | + solution: src/Publish/SignLayout.csproj |
| 86 | + platform: '$(BuildPlatform)' |
| 87 | + configuration: '$(BuildConfiguration)' |
| 88 | + msbuildArguments: '/p:OutputPath=$(Build.ArtifactStagingDirectory)\packages /p:SignPackage=true /p:Version=$(Build.BuildNumber)' |
| 89 | + |
| 90 | + - task: MicroBuildArchiveSymbols@1 |
| 91 | + inputs: |
| 92 | + SymbolsFeatureName: 'MPLS' |
| 93 | + SymbolsSymwebProject: 'VS' |
| 94 | + SymbolsEmailContacts: 'ptvscore@microsoft.com' |
| 95 | + SymbolsUncPath: $(Build.BinariesDirectory)/out |
| 96 | + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq('${{ parameters.OSTarget }}', 'any'), eq(variables['ShouldPublishNuget'], 'True'), eq(variables['SignType'], 'real')) |
| 97 | + |
| 98 | + - task: NuGetCommand@2 |
| 99 | + displayName: 'NuGet publish parsing ' |
| 100 | + inputs: |
| 101 | + command: push |
| 102 | + packagesToPush: '$(Build.ArtifactStagingDirectory)/**/Microsoft.Python.Parsing*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' |
| 103 | + nuGetFeedType: external |
| 104 | + publishFeedCredentials: 'rchiodo_nuget' |
| 105 | + condition: and(succeeded(), eq(variables['ShouldPublishNuget'], 'True'), eq('${{ parameters.OSTarget }}', 'any'), notin(variables['Build.Reason'], 'PullRequest')) |
| 106 | + timeoutInMinutes: 20 |
| 107 | + |
| 108 | + - task: MicroBuildCleanup@1 |
| 109 | + displayName: 'Execute cleanup tasks' |
| 110 | + condition: succeededOrFailed() |
0 commit comments