python-language-server/build/azure-pipeline-steps.yml

113 строки
4.3 KiB
YAML

parameters:
name: OSTarget
type: string
default: 'win-x86'
steps:
- task: MicroBuildSigningPlugin@3
displayName: 'Install microbuild signing plugin'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
signType: 'Real'
zipSources: false
- task: UseDotNet@2
displayName: 'Use .Net Core SDK 3.1.x'
inputs:
version: 3.1.x
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: |
src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj
src/Publish/SignLayout.csproj
restoreDirectory: '$(Build.BinariesDirectory)'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish LanguageServer'
inputs:
command: publish
publishWebProjects: false
projects: src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj
arguments: '-c $(BuildConfiguration) -r ${{ parameters.OSTarget }} -o $(Build.BinariesDirectory)/out /p:SignType=None /p:Version=$(Build.BuildNumber)'
zipAfterPublish: false
modifyOutputPath: false
condition: and(succeeded(), ne('${{ parameters.OSTarget }}', 'any'))
- task: DotNetCoreCLI@2
displayName: 'dotnet publish LanguageServer for Any'
inputs:
command: publish
publishWebProjects: false
projects: src/LanguageServer/Impl/Microsoft.Python.LanguageServer.csproj
arguments: '-c $(BuildConfiguration) -o $(Build.BinariesDirectory)/out /p:SignType=None /p:Version=$(Build.BuildNumber)'
zipAfterPublish: false
modifyOutputPath: false
condition: and(succeeded(), eq('${{ parameters.OSTarget }}', 'any'))
- task: MSBuild@1
displayName: 'Sign assemblies'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
solution: src/Publish/SignLayout.csproj
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:OutputPath=$(Build.BinariesDirectory)\out /p:SignServer=true /p:SignParser=true'
- task: NuGetCommand@2
displayName: 'NuGet pack language server'
inputs:
command: pack
packagesToPack: 'src/LanguageServer/Impl/Python-Language-Server.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)\packages'
versioningScheme: byEnvVar
versionEnvVar: NugetPackageVersion
buildProperties: 'os=-${{ parameters.OSTarget }}'
basePath: '$(Build.BinariesDirectory)/out'
- task: NuGetCommand@2
displayName: 'NuGet pack parsing'
inputs:
command: pack
packagesToPack: 'src/Parsing/Impl/Microsoft-Python-Parsing.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)\packages'
versioningScheme: byEnvVar
versionEnvVar: NugetPackageVersion
buildProperties: 'os=-${{ parameters.OSTarget }}'
basePath: '$(Build.BinariesDirectory)/out'
- task: MSBuild@1
displayName: 'Sign packages'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
solution: src/Publish/SignLayout.csproj
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:OutputPath=$(Build.ArtifactStagingDirectory)\packages /p:SignPackage=true /p:Version=$(Build.BuildNumber)'
- task: PublishSymbols@2
inputs:
SymbolsFolder: '$(Build.BinariesDirectory)'
SearchPattern: '**/out/**/*.pdb'
SymbolServerType: 'TeamServices'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq('${{ parameters.OSTarget }}', 'any'), eq(variables['ShouldPublishNuget'], 'True'), eq(variables['SignType'], 'real'))
# If API key expires, you need to generate a new one here:
# https://www.nuget.org/account/apikeys
# You'll need admin permission to associate the key with the Python Tools org
- task: NuGetCommand@2
displayName: 'NuGet publish parsing '
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/Microsoft.Python.Parsing*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'python_language_server_nuget'
condition: and(succeeded(), eq(variables['ShouldPublishNuget'], 'True'), eq('${{ parameters.OSTarget }}', 'any'), notin(variables['Build.Reason'], 'PullRequest'))
timeoutInMinutes: 20
- task: MicroBuildCleanup@1
displayName: 'Execute cleanup tasks'
condition: succeededOrFailed()