11trigger :
22- ' *'
3-
43pool :
54 vmImage : ' windows-2022'
6-
75variables :
8- - name : solution
9- value : ' **/*.sln'
10- readonly : true
11- - name : buildPlatform
12- value : ' Any CPU'
13- readonly : true
14- - name : buildConfiguration
15- value : ' Release'
16- readonly : true
17- - name : currentVsixVersion
18- value : ' '
19- readonly : false
20- # - name: previousVsixVersion
21- # value: ''
22- # readonly: false
6+ solution : ' **/*.sln'
7+ buildPlatform : ' Any CPU'
8+ buildConfiguration : ' Release'
239
2410
2511
@@ -29,156 +15,58 @@ jobs:
2915 steps :
3016
3117 - task : PowerShell@2
32- displayName : ' test get var'
33- inputs :
34- targetType : ' inline'
35- script : |
36- echo "Global current vsix version = $(currentVsixVersion)"
37- echo "c vsix = $env:CURRENTVSIXVERSION"
38- #echo "Global previous vsix version = $(previousVsixVersion)"
39- #echo "p vsix = $env:PREVIOUSVSIXVERSION"
40-
41- - task : PowerShell@2
42- displayName : ' test set var'
43- name : SetVersion1
18+ name : CurrentVsixManifest
19+ displayName : ' Read current vsix version from manifest file'
4420 inputs :
4521 targetType : ' inline'
4622 script : |
47- echo "##vso[task.setvariable variable=currentVsixVersion]testValue1.1"
48- echo "##vso[task.setvariable variable=previousVsixVersion;isOutput=true]testValue1.2"
49-
50- - task : PowerShell@2
51- displayName : ' test get var'
23+ $vsixManifestPath = Resolve-Path $(Build.SourcesDirectory)\src\SqlQueryTools\source.extension.vsixmanifest
24+ [xml]$vsixManifestContent = Get-Content $vsixManifestPath
25+ $vsixVersion = $vsixManifestContent.PackageManifest.Metadata.Identity.Version
26+ echo "Found vsix version = $vsixVersion"
27+ echo "##vso[task.setvariable variable=VsixVersion;isOutput=true]$vsixVersion"
28+
29+ - task : DownloadGitHubRelease@0
30+ displayName : ' Download the latest release from GitHub'
5231 inputs :
53- targetType : ' inline'
54- script : |
55- echo "Global current vsix version = $(currentVsixVersion)"
56- echo "c vsix = $env:CURRENTVSIXVERSION"
57- echo "Global previous vsix version = $(SetVersion1.previousVsixVersion)"
58- #echo "p vsix = $env:PREVIOUSVSIXVERSION"
59-
60- - task : PowerShell@2
61- displayName : ' test set var'
62- name : SetVersion2
32+ connection : ' github release connection'
33+ userRepository : ' gmarginet/SqlQueryTools'
34+ defaultVersionType : ' latest'
35+ itemPattern : ' **/*.vsix'
36+ downloadPath : ' $(Build.StagingDirectory)/PreviousGitHubRelease'
37+
38+ - task : ExtractFiles@1
39+ displayName : ' Extract the latest release'
6340 inputs :
64- targetType : ' inline '
65- script : |
66- echo "##vso[task.setvariable variable=currentVsixVersion]testValue2.1"
67- echo "##vso[task.setvariable variable=previousVsixVersion;isOutput=true]testValue2.2"
41+ archiveFilePatterns : ' $(System.ArtifactsDirectory)/PreviousGitHubRelease/*.vsix '
42+ destinationFolder : ' $(System.ArtifactsDirectory)/PreviousGitHubRelease '
43+ cleanDestinationFolder : true
44+ overwriteExistingFiles : false
6845
6946 - task : PowerShell@2
70- displayName : ' test get var'
47+ name : PreviousVsixManifest
48+ displayName : ' Read previous vsix version from manifest file'
7149 inputs :
7250 targetType : ' inline'
7351 script : |
74- echo "Global current vsix version = $(currentVsixVersion)"
75- echo "c vsix = $env:CURRENTVSIXVERSION"
76- echo "Global previous vsix version = $(SetVersion1.previousVsixVersion)"
77- echo "Global previous vsix version = $(SetVersion2.previousVsixVersion)"
78- #echo "p vsix = $env:PREVIOUSVSIXVERSION"
79-
80- # - powershell: |
81- # $vsixManifestPath = Resolve-Path $(Build.SourcesDirectory)\src\SqlQueryTools\source.extension.vsixmanifest
82- # #Write-Host "vsixManifestPath = $vsixManifestPath"
83- # [xml]$vsixManifestContent = Get-Content $vsixManifestPath
84- # $vsixVersion = $vsixManifestContent.PackageManifest.Metadata.Identity.Version
85- # echo "Found vsix version = $vsixVersion"
86- # #Write-Host "##vso[task.setvariable variable=MyVsixVersion;isOutput=true]$vsixVersion"
87- # echo "##vso[task.setvariable variable=currentVsixVersion]$vsixVersion"
88- # name: GetCurrentVersion
89- # displayName: 'Read current vsix version from manifest file'
52+ $vsixManifestPath = Resolve-Path $(System.ArtifactsDirectory)\PreviousGitHubRelease\extension.vsixmanifest
53+ [xml]$vsixManifestContent = Get-Content $vsixManifestPath
54+ $vsixVersion = $vsixManifestContent.PackageManifest.Metadata.Identity.Version
55+ echo "Found vsix version = $vsixVersion"
56+ echo "##vso[task.setvariable variable=VsixVersion;isOutput=true]$vsixVersion"
9057
91- # - powershell: |
92- # Write-Host "currentVsixVersion = $(currentVsixVersion)"
93- # #Write-Host "VsixVersion = $(MyVsixVersion)"
94- # $buildInfo = @{
95- # VsixVersion = $(MyVsixVersion)
96- # }
97- # $buildInfo | ConvertTo-Json | Out-File "$(Build.ArtifactStagingDirectory)\BuildInfo.json"
98- # displayName: 'Create BuildInfo.json'
9958
100- # - task: PublishBuildArtifacts@1
101- # displayName: 'Publish artifact'
102- # inputs:
103- # artifactName: 'drop'
104- # TargetPath: '$(Build.ArtifactStagingDirectory)'
10559
106-
107-
108- - job : Check
109- displayName : ' Check if the current build needs to be released'
110- dependsOn : Build_SqlQueryTools
111- variables :
112- previousVsixVersion : $[ dependencies.Build_SqlQueryTools.outputs['SetVersion2.previousVsixVersion'] ]
113- condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
114- steps :
115-
116- - task : PowerShell@2
117- displayName : ' test get var'
118- inputs :
119- targetType : ' inline'
120- script : |
121- #echo "Global current vsix version = $(currentVsixVersion)"
122- #echo "c vsix = $env:CURRENTVSIXVERSION"
123- echo "Previous vsix version = $(previousVsixVersion)"
124- #echo "p vsix = $env:PREVIOUSVSIXVERSION"
125- #echo "pd vsix = $(dependencies.Build_SqlQueryTools.outputs['SetVersion2.previousVsixVersion'])"
126-
127- # - task: DownloadGitHubRelease@0
128- # displayName: 'Download the latest release from GitHub'
129- # inputs:
130- # connection: 'github release connection'
131- # userRepository: 'gmarginet/SqlQueryTools'
132- # defaultVersionType: 'latest'
133- # itemPattern: '**/*.vsix'
134- # downloadPath: '$(System.ArtifactsDirectory)'
135-
136- # - task: ExtractFiles@1
137- # displayName: 'Extract the latest release'
138- # inputs:
139- # archiveFilePatterns: '$(System.ArtifactsDirectory)/*.vsix'
140- # destinationFolder: '$(System.ArtifactsDirectory)/PreviousRelease'
141- # cleanDestinationFolder: true
142- # overwriteExistingFiles: false
143-
144- # - powershell: |
145- # Write-Host "currentVsixVersion = $(currentVsixVersion)"
146- # $previousVsixManifestPath = Resolve-Path $(System.ArtifactsDirectory)\PreviousRelease\extension.vsixmanifest
147- # Write-Host "previousVsixManifestPath = $previousVsixManifestPath"
148- # [xml]$previousVsixManifestContent = Get-Content $previousVsixManifestPath
149- # $previousVsixVersion = $previousVsixManifestContent.PackageManifest.Metadata.Identity.Version
150- # Write-Host "previousVsixVersion = $previousVsixVersion"
151- # Write-Host "##vso[task.setvariable variable=MyPreviousVsixVersion;]$previousVsixVersion"
152- # displayName: 'Read previous vsix version from manifest file of previous release'
153-
154-
155-
156- - job : Deploy
60+ - job : Deploy_SqlQueryTools
61+ displayName : ' Deploy latest SqlQueryTools commit'
15762 dependsOn :
15863 - Build_SqlQueryTools
159- - Check
160- condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(dependencies.Build_SqlQueryTools.outputs['SetVersion2.previousVsixVersion'], ''), eq('1', '2'))
64+ condition : and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(dependencies.Build_SqlQueryTools.outputs['CurrentVsixManifest.VsixVersion'], dependencies.Build_SqlQueryTools.outputs['PreviousVsixManifest.VsixVersion']), eq('1', '2'))
16165 steps :
16266
16367 - task : PowerShell@2
164- displayName : ' test get var '
68+ displayName : ' tmp '
16569 inputs :
16670 targetType : ' inline'
16771 script : |
168- echo "Global current vsix version = $(currentVsixVersion)"
169- echo "c vsix = $env.CURRENTVSIXVERSION"
170- echo "Global current vsix version = $(previousVsixVersion)"
171- echo "c vsix = $env.PREVIOUSVSIXVERSION"
172-
173- # - task: DownloadBuildArtifacts@1
174- # displayName: 'Download artifact'
175- # inputs:
176- # artifactName: 'drop'
177- # downloadPath: '$(System.ArtifactsDirectory)'
178- # - powershell: |
179- # echo "Current vsix version = $(currentVsixVersion)"
180- # $buildInfoJsonPath = Resolve-Path $(System.ArtifactsDirectory)\drop\BuildInfo.json
181- # Write-Host "buildInfoJsonPath = $buildInfoJsonPath"
182- # $buildInfo = Get-Content $buildInfoJsonPath | ConvertFrom-Json
183- # Write-Host "vsixVersion = $($buildInfo.VsixVersion)"
184- # displayName: 'Read BuildInfo.json'
72+ echo "Deploy"
0 commit comments