|
| 1 | +variables: |
| 2 | +- template: templates\variables.yml |
| 3 | +- name: SignType |
| 4 | + value: Test |
| 5 | +- name: TeamName |
| 6 | + value: MSBuild |
| 7 | + |
| 8 | +trigger: |
| 9 | + batch: true |
| 10 | + branches: |
| 11 | + include: |
| 12 | + - 'main' |
| 13 | + - 'refs/tags/*' |
| 14 | + |
| 15 | +# no PR triggers |
| 16 | +pr: none |
| 17 | + |
| 18 | +jobs: |
| 19 | +- job: OfficialBuild |
| 20 | + displayName: Official Build |
| 21 | + variables: |
| 22 | + VsInstallDir: $(Build.ArtifactStagingDirectory)/vs |
| 23 | + pool: |
| 24 | + name: VSEngSS-MicroBuild2022-1ES |
| 25 | + steps: |
| 26 | + - task: PowerShell@2 |
| 27 | + displayName: 'Update SignType, Build Number, and Add Build Tag for tagged commits' |
| 28 | + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) |
| 29 | + inputs: |
| 30 | + targetType: 'inline' |
| 31 | + script: | |
| 32 | + Write-Host "Updating SignType to 'Real'" |
| 33 | + Write-Host "##vso[task.setvariable variable=SignType;]Real" |
| 34 | + Write-Host "" |
| 35 | + $buildTag = [System.Text.RegularExpressions.Regex]::Match("$(Build.SourceBranchName)", "v.*") |
| 36 | + if($buildTag.Success -eq $true) |
| 37 | + { |
| 38 | + Write-Host "Updating VSTS build number to ""$buildTag""" |
| 39 | + Write-Host "##vso[build.updatebuildnumber]$buildTag" |
| 40 | + Write-Host "" |
| 41 | + Write-Host "Adding build tag ""$buildTag""" |
| 42 | + Write-Host "##vso[build.addbuildtag]$buildTag" |
| 43 | + } |
| 44 | +
|
| 45 | + - task: MicroBuildSigningPlugin@1 |
| 46 | + displayName: 'Install MicroBuild Signing Plugin' |
| 47 | + inputs: |
| 48 | + signType: '$(SignType)' |
| 49 | + zipSources: false |
| 50 | + |
| 51 | + - checkout: self |
| 52 | + # Fetch all history for versioning |
| 53 | + fetchDepth: 0 |
| 54 | + |
| 55 | + - template: templates\build.yml |
| 56 | + parameters: |
| 57 | + RepoRoot: $(Build.SourcesDirectory) |
| 58 | + |
| 59 | + - task: NuGetCommand@2 |
| 60 | + displayName: 'Push NuGet Packages to nuget.org' |
| 61 | + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) |
| 62 | + inputs: |
| 63 | + command: 'push' |
| 64 | + packagesToPush: '$(ArtifactsDirectory)/**/*.nupkg' |
| 65 | + nuGetFeedType: 'external' |
| 66 | + publishFeedCredentials: 'MSBuildCache-Push' |
| 67 | + |
| 68 | + - publish: $(LogDirectory) |
| 69 | + displayName: Publish Logs |
| 70 | + artifact: '$(System.JobDisplayName) logs' |
| 71 | + condition: always() |
0 commit comments