2021-05-13 23:12:30 +02:00
|
|
|
# From our friends at MUX: https://github.com/microsoft/microsoft-ui-xaml/blob/main/build/AzurePipelinesTemplates/MUX-BuildAndPublishPGONuGet-Job.yml
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
dependsOn: ''
|
|
|
|
pgoArtifact: PGO
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: BuildAndPublishPGONuGet
|
|
|
|
dependsOn: ${{ parameters.dependsOn }}
|
|
|
|
pool:
|
|
|
|
vmImage: 'windows-2019'
|
|
|
|
variables:
|
|
|
|
artifactsPath: $(Build.SourcesDirectory)\Artifacts
|
|
|
|
pgoToolsPath: $(Build.SourcesDirectory)\tools\PGODatabase
|
|
|
|
nuspecPath: $(pgoToolsPath)\NuSpecs
|
|
|
|
nuspecFilename: PGO.nuspec
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
inputs:
|
|
|
|
artifactName: ${{ parameters.pgoArtifact }}
|
|
|
|
downloadPath: $(artifactsPath)
|
2021-08-26 00:58:06 +02:00
|
|
|
|
|
|
|
- task: NuGetAuthenticate@0
|
|
|
|
inputs:
|
|
|
|
nuGetServiceConnections: 'Terminal Public Artifact Feed'
|
|
|
|
|
2021-05-13 23:12:30 +02:00
|
|
|
- task: NuGetToolInstaller@0
|
2021-08-26 00:58:06 +02:00
|
|
|
displayName: 'Use NuGet 5.8.0'
|
2021-05-13 23:12:30 +02:00
|
|
|
inputs:
|
2021-08-26 00:58:06 +02:00
|
|
|
versionSpec: 5.8.0
|
2021-05-13 23:12:30 +02:00
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: 'Copy pgd files to NuGet build directory'
|
|
|
|
inputs:
|
|
|
|
sourceFolder: $(artifactsPath)\${{ parameters.pgoArtifact }}
|
|
|
|
contents: '**\*.pgd'
|
|
|
|
targetFolder: $(nuspecPath)\tools
|
|
|
|
|
|
|
|
- task: powershell@2
|
|
|
|
displayName: 'Generate NuSpec file'
|
|
|
|
inputs:
|
|
|
|
targetType: filePath
|
|
|
|
filePath: $(pgoToolsPath)\generate-nuspec.ps1
|
|
|
|
workingDirectory: $(pgoToolsPath)
|
|
|
|
arguments: $(nuspecPath)\$(nuspecFilename).template $(nuspecPath)\$(nuspecFilename)
|
|
|
|
|
|
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
|
|
|
displayName: 'NuGet pack'
|
|
|
|
inputs:
|
|
|
|
command: pack
|
|
|
|
packagesToPack: '$(nuspecPath)\$(nuspecFilename)'
|
|
|
|
basePath: '$(nuspecPath)'
|
|
|
|
packDestination: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
inputs:
|
|
|
|
pathToPublish: $(Build.ArtifactStagingDirectory)
|
|
|
|
artifactName: ${{ parameters.pgoArtifact }}
|
|
|
|
|
|
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
|
|
|
displayName: 'NuGet push'
|
|
|
|
inputs:
|
|
|
|
command: push
|
2021-08-26 00:58:06 +02:00
|
|
|
nuGetFeedType: external
|
|
|
|
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
|
|
|
|
# The actual URL and PAT for this feed is configured at
|
|
|
|
# https://microsoft.visualstudio.com/Dart/_settings/adminservices
|
|
|
|
# This is the name of that connection
|
|
|
|
publishFeedCredentials: 'Terminal Public Artifact Feed'
|
|
|
|
feedsToUse: config
|
|
|
|
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
|