-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
56 lines (48 loc) · 1.95 KB
/
azure-pipelines.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
trigger:
- development
- master
variables:
extensionVisibility: 'private'
# The extension identifiers are set to non-default values on non-master branch builds
extensionName: 'Event Grid Subscription Extension'
extensionId: 'EventGridSubscriptionExtension'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: PowerShell@2
displayName: 'Configure version and extension visibility'
inputs:
targetType: 'inline'
script: |
$fileContents = Get-Content .\versioninfo.json -Raw
$versionInfo = ConvertFrom-Json $fileContents
$vsixVersion = $versionInfo.version + ".$(Build.BuildId)"
Write-Host "##vso[task.setvariable variable=vsixVersion]$vsixVersion"
if ("$(Build.SourceBranchName)" -eq "master") {
Write-Host "##vso[task.setvariable variable=extensionVisibility]public"
} else {
Write-Host "##vso[task.setvariable variable=extensionVisibility]private"
$extensionId = "CI-BUILD-$(extensionId)-$(Build.SourceBranchName)"
$extensionId = $extensionId.SubString(0, [math]::min(63, $extensionId.length))
Write-Host "##vso[task.setvariable variable=extensionId]$extensionId"
Write-Host "##vso[task.setvariable variable=extensionName]CI BUILD $(extensionName) - $(Build.SourceBranchName)"
}
- task: TfxInstaller@2
inputs:
version: 'v0.7.x'
- task: PackageAzureDevOpsExtension@2
inputs:
rootFolder: 'src'
outputPath: '$(Pipeline.Workspace)/output/RasmusWatjen.EventGridSubscriptionExtension-$(vsixVersion).vsix'
extensionVersion: '$(vsixVersion)'
updateTasksVersion: true
extensionId: '$(extensionId)'
extensionVisibility: '$(extensionVisibility)'
extensionName: '$(extensionName)'
- task: PublishAzureDevOpsExtension@2
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'VS Marketplace'
fileType: 'vsix'
vsixFile: '$(Pipeline.Workspace)/output/RasmusWatjen.EventGridSubscriptionExtension-$(vsixVersion).vsix'
updateTasksVersion: false