-
Notifications
You must be signed in to change notification settings - Fork 693
/
Copy pathInitialize_Build.yml
58 lines (54 loc) · 3.01 KB
/
Initialize_Build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
steps:
- task: PowerShell@1
displayName: "Check VSTS Personal Access Token"
inputs:
scriptType: "inlineScript"
inlineScript: |
. $(Build.Repository.LocalPath)\\scripts\\utils\\PostGitCommitStatus.ps1
CheckVstsPersonalAccessToken -VstsPersonalAccessToken $(System.AccessToken)
- task: PowerShell@1
displayName: "Initialize Git Commit Status on GitHub"
inputs:
scriptType: "inlineScript"
inlineScript: |
. $(Build.Repository.LocalPath)\\scripts\\utils\\PostGitCommitStatus.ps1
InitializeAllTestsToPending -PersonalAccessToken $(NuGetLurkerPersonalAccessToken) -CommitSha $(Build.SourceVersion)
condition: "not(eq(variables['ManualGitHubChecks'], 'false'))"
- task: PowerShell@1
displayName: "Update Build Number"
name: "updatebuildnumber"
inputs:
scriptType: "inlineScript"
inlineScript: |
try {
$FullBuildNumber = "$(SemanticVersion).$(BuildRevision)"
if ([System.String]::IsNullOrEmpty($env:VsTargetChannelOverride) -eq $false) {
$targetChannel = $env:VsTargetChannelOverride
} else {
$targetChannel = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetChannel) | Out-String).Trim()
}
if ([System.String]::IsNullOrEmpty($env:VsTargetChannelOverrideForTests) -eq $false) {
$targetChannelForTests = $env:VsTargetChannelOverrideForTests
} else {
$targetChannelForTests = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetChannelForTests) | Out-String).Trim()
}
$targetMajorVersion = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetMajorVersion) | Out-String).Trim()
Write-Host "##vso[task.setvariable variable=VsTargetChannel;isOutput=true]$targetChannel"
Write-Host "##vso[task.setvariable variable=VsTargetChannelForTests;isOutput=true]$targetChannelForTests"
Write-Host "##vso[task.setvariable variable=VsTargetMajorVersion;isOutput=true]$targetMajorVersion"
Write-Host "##vso[build.updatebuildnumber]$FullBuildNumber"
Write-Host "##vso[task.setvariable variable=BuildNumber;isOutput=true]$(BuildRevision)"
Write-Host "##vso[task.setvariable variable=FullVstsBuildNumber;isOutput=true]$FullBuildNumber"
} catch {
Write-Host "##vso[task.LogIssue type=error;]Unable to set build number"
exit 1
}
- task: PowerShell@1
displayName: "Add Build Tags"
inputs:
scriptType: "inlineScript"
inlineScript: |
Write-Host "##vso[build.addbuildtag]${env:BUILD_SOURCEVERSIONAUTHOR}"
Write-Host "##vso[build.addbuildtag]${env:BUILD_SOURCEBRANCHNAME}"
- task: ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'