-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-and-release.yml
126 lines (123 loc) · 4.21 KB
/
build-and-release.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
trigger:
- none
pool:
vmImage: "ubuntu-latest"
variables:
- group: vg-release
stages:
- stage: Run_and_publish_unit_tests
jobs:
- job:
steps:
- task: NodeTool@0
displayName: Install Node10
inputs:
versionSpec: '10.x'
- task: TfxInstaller@3
displayName: Install Tfx - Task Builder Utilities
inputs:
version: "v0.7.x"
- task: Npm@1
displayName: Install task dependencies
inputs:
command: 'install'
workingDir: 'cosmosUploadTask'
verbose: true
- task: Bash@3
displayName: Compile Javascript
inputs:
targetType: "inline"
script: |
cd cosmosUploadTask
tsc
- task: Npm@1
displayName: Run Tests
inputs:
command: 'custom'
workingDir: 'cosmosUploadTask/tests'
customCommand: 'test'
verbose: true
- task: PublishTestResults@2
displayName: Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/ResultsFile.xml'
- stage: Package_extension_and_publish_build_artifacts
jobs:
- job:
steps:
- task: TfxInstaller@3
displayName: Instal Tfx
inputs:
version: "v0.7.x"
- task: Npm@1
displayName: Install the task
inputs:
command: 'install'
workingDir: 'cosmosUploadTask'
- task: Bash@3
displayName: Compile Javascript
inputs:
targetType: "inline"
script: |
cd cosmosUploadTask
tsc
- task: QueryAzureDevOpsExtensionVersion@3
displayName: Get current task version
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'MarketplaceConnection'
publisherId: '$(PublisherID)'
extensionId: '$(ExtensionID)'
versionAction: 'Minor'
outputVariable: 'Task.Extension.Version'
- task: PackageAzureDevOpsExtension@3
displayName: Package the task
inputs:
rootFolder: '$(System.DefaultWorkingDirectory)'
publisherId: '$(PublisherID)'
extensionId: '$(ExtensionID)'
extensionName: '$(ExtensionName)'
extensionVersion: '$(Task.Extension.Version)'
updateTasksVersion: false
extensionVisibility: 'public'
extensionPricing: 'free'
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: "**/*.vsix"
TargetFolder: "$(Build.ArtifactStagingDirectory)"
- task: PublishBuildArtifacts@1
displayName: Publish the build artifact
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(ArtifactName)'
publishLocation: 'Container'
- stage: Download_build_artifacts_and_publish_the_extension
jobs:
- job:
steps:
- task: TfxInstaller@3
displayName: Instal Tfx
inputs:
version: "v0.7.x"
- task: DownloadBuildArtifacts@0
displayName: Download the build artifact
inputs:
buildType: "current"
downloadType: "single"
artifactName: "$(ArtifactName)"
downloadPath: "$(System.DefaultWorkingDirectory)"
- task: PublishAzureDevOpsExtension@3
displayName: Publish to VS Marketplace
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'MarketplaceConnection'
fileType: 'vsix'
vsixFile: "$(ArtifactName)/$(ArtifactName)-*.vsix"
publisherId: '$(PublisherID)'
extensionId: '$(ExtensionID)'
extensionName: '$(ExtensionName)'
updateTasksVersion: false
extensionVisibility: 'public'
extensionPricing: 'free'