|
| 1 | +name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr) |
| 2 | + |
| 3 | +parameters: |
| 4 | +- name: "PushPackageToInternalFeed" |
| 5 | + type: boolean |
| 6 | + default: true |
| 7 | + |
| 8 | +variables: |
| 9 | +- template: ${{variables['System.DefaultWorkingDirectory']}}\build\WindowsAppSDK-Versions.yml |
| 10 | +- template: ${{variables['System.DefaultWorkingDirectory']}}\build\WindowsAppSDK-CommonVariables.yml |
| 11 | + |
| 12 | +resources: |
| 13 | + repositories: |
| 14 | + - repository: templates |
| 15 | + type: git |
| 16 | + name: OneBranch.Pipelines/GovernedTemplates |
| 17 | + ref: refs/heads/main |
| 18 | + |
| 19 | +extends: |
| 20 | + template: v2/Microsoft.NonOfficial.yml@templates # https://aka.ms/obpipelines/templates |
| 21 | + parameters: |
| 22 | + platform: |
| 23 | + name: 'windows_undocked' # windows undocked |
| 24 | + |
| 25 | + stages: |
| 26 | + - stage: PackageDevCheck |
| 27 | + dependsOn: [] |
| 28 | + jobs: |
| 29 | + - job: PackageDevCheck |
| 30 | + pool: |
| 31 | + # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs |
| 32 | + type: windows |
| 33 | + variables: |
| 34 | + ob_outputDirectory: '$(Build.ArtifactStagingDirectory)\NuGet' |
| 35 | + steps: |
| 36 | + - task: PowerShell@2 |
| 37 | + displayName: Update version |
| 38 | + inputs: |
| 39 | + targetType: 'inline' |
| 40 | + script: | |
| 41 | + Write-Host version: '$(version)' |
| 42 | + [xml]$publicNuspec = Get-Content -Encoding utf8 -Path $(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec |
| 43 | + $publicNuspec.package.metadata.version = '$(version)' |
| 44 | + Set-Content -Encoding utf8 -Value $publicNuspec.OuterXml $(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec |
| 45 | +
|
| 46 | + - task: CopyFiles@2 |
| 47 | + displayName: 'Add DevCheck.ps1 to Nuget' |
| 48 | + inputs: |
| 49 | + SourceFolder: '$(Build.SourcesDirectory)\tools\DevCheck' |
| 50 | + Contents: | |
| 51 | + DevCheck.ps1 |
| 52 | + TargetFolder: '$(Build.SourcesDirectory)\PackLocation' |
| 53 | + flattenFolders: false |
| 54 | + |
| 55 | + - task: CopyFiles@2 |
| 56 | + displayName: 'Add License.txt to Nuget' |
| 57 | + inputs: |
| 58 | + SourceFolder: '$(Build.SourcesDirectory)' |
| 59 | + Contents: | |
| 60 | + LICENSE |
| 61 | + TargetFolder: '$(Build.SourcesDirectory)\PackLocation' |
| 62 | + flattenFolders: false |
| 63 | + |
| 64 | + - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 |
| 65 | + displayName: 'Pack DevCheckPackage' |
| 66 | + inputs: |
| 67 | + command: 'pack' |
| 68 | + packagesToPack: '$(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec' |
| 69 | + versioningScheme: off |
| 70 | + basePath: '$(Build.SourcesDirectory)\PackLocation' |
| 71 | + packDestination: '$(ob_outputDirectory)' |
| 72 | + |
| 73 | + - ${{ if eq(parameters.PushPackageToInternalFeed, 'true') }}: |
| 74 | + - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 |
| 75 | + displayName: 'NuGet push package to Project.Reunion.nuget.internal' |
| 76 | + inputs: |
| 77 | + command: 'push' |
| 78 | + packagesToPush: '$(ob_outputDirectory)\Microsoft.WinAppSDK.DevCheck.*.nupkg' |
| 79 | + verbosityPush: 'Detailed' |
| 80 | + nuGetFeedType: 'internal' |
| 81 | + # ignore conflicts which come from rerunning with the same input packages |
| 82 | + allowPackageConflicts: true |
| 83 | + #Note: The project qualifier is always required when using a feed name. Also, do not use organization scoped feeds. |
| 84 | + publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' |
0 commit comments