Skip to content

Commit cf22d3d

Browse files
authored
Merge pull request #76 from microsoft/alzollin/publishPipeline
Added publish release pipeline.
2 parents 3801a81 + 241db78 commit cf22d3d

1 file changed

Lines changed: 221 additions & 0 deletions

File tree

.pipelines/publish_release.yml

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
trigger: none
2+
name: $(Date:yyyyMMdd).$(Rev:r)
3+
parameters:
4+
- name: notifyUsers
5+
type: string
6+
default: ''
7+
- name: approversUsers
8+
type: string
9+
default: ''
10+
resources:
11+
pipelines:
12+
- pipeline: '_MSStoreCLI-BuildRelease'
13+
project: 'Pax'
14+
source: 'MSStoreCLI\MSStore CLI - Release'
15+
trigger:
16+
branches:
17+
include:
18+
- rel/v*
19+
repositories:
20+
- repository: 1ESPipelineTemplates
21+
type: git
22+
name: 1ESPipelineTemplates/1ESPipelineTemplates
23+
ref: refs/tags/release
24+
extends:
25+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
26+
parameters:
27+
pool:
28+
name: Azure-Pipelines-1ESPT-ExDShared
29+
image: windows-latest
30+
os: windows
31+
stages:
32+
- stage: GitHub_Release_And_MSStore
33+
displayName: GitHub Release + MSStore
34+
jobs:
35+
- job: PreDeploymentApprovalJob
36+
displayName: Pre-Deployment Approval
37+
condition: succeeded()
38+
timeoutInMinutes: 43200
39+
pool: server
40+
steps:
41+
- task: ManualValidation@1
42+
inputs:
43+
notifyUsers: $(notifyUsers)
44+
approvers: $(approversUsers)
45+
- job: GitHubRelease_And_MSStore
46+
displayName: GitHub Release + MSStore
47+
dependsOn: PreDeploymentApprovalJob
48+
condition: succeeded()
49+
timeoutInMinutes: 0
50+
templateContext:
51+
type: releaseJob
52+
isProduction: true
53+
inputs:
54+
- input: pipelineArtifact
55+
pipeline: '_MSStoreCLI-BuildRelease'
56+
artifactName: 'CLI-linux-x64'
57+
targetPath: '$(Pipeline.Workspace)/CLI-linux-x64'
58+
- input: pipelineArtifact
59+
pipeline: '_MSStoreCLI-BuildRelease'
60+
artifactName: 'CLI-linux-arm64'
61+
targetPath: '$(Pipeline.Workspace)/CLI-linux-arm64'
62+
- input: pipelineArtifact
63+
pipeline: '_MSStoreCLI-BuildRelease'
64+
artifactName: 'MSIX-arm64'
65+
targetPath: '$(Pipeline.Workspace)/MSIX-arm64'
66+
- input: pipelineArtifact
67+
pipeline: '_MSStoreCLI-BuildRelease'
68+
artifactName: 'MSIX-x64'
69+
targetPath: '$(Pipeline.Workspace)/MSIX-x64'
70+
- input: pipelineArtifact
71+
pipeline: '_MSStoreCLI-BuildRelease'
72+
artifactName: 'CLI-win-arm64'
73+
targetPath: '$(Pipeline.Workspace)/CLI-win-arm64'
74+
- input: pipelineArtifact
75+
pipeline: '_MSStoreCLI-BuildRelease'
76+
artifactName: 'CLI-win-x64'
77+
targetPath: '$(Pipeline.Workspace)/CLI-win-x64'
78+
- input: pipelineArtifact
79+
pipeline: '_MSStoreCLI-BuildRelease'
80+
artifactName: 'CLI-osx-x64'
81+
targetPath: '$(Pipeline.Workspace)/CLI-osx-x64'
82+
- input: pipelineArtifact
83+
pipeline: '_MSStoreCLI-BuildRelease'
84+
artifactName: 'CLI-osx-arm64'
85+
targetPath: '$(Pipeline.Workspace)/CLI-osx-arm64'
86+
steps:
87+
- task: ArchiveFiles@2
88+
displayName: Archive Windows x64
89+
inputs:
90+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-win-x64
91+
includeRootFolder: false
92+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-win-x64.zip
93+
- task: ArchiveFiles@2
94+
displayName: Archive Windows arm64
95+
inputs:
96+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-win-arm64
97+
includeRootFolder: false
98+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-win-arm64.zip
99+
- task: ArchiveFiles@2
100+
displayName: Archive Linux x64
101+
inputs:
102+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-linux-x64
103+
includeRootFolder: false
104+
archiveType: tar
105+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-linux-x64.tar.gz
106+
- task: ArchiveFiles@2
107+
displayName: Archive Linux arm64
108+
inputs:
109+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-linux-arm64
110+
includeRootFolder: false
111+
archiveType: tar
112+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-linux-arm64.tar.gz
113+
- task: ArchiveFiles@2
114+
displayName: Archive MacOS x64
115+
inputs:
116+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-osx-x64
117+
includeRootFolder: false
118+
archiveType: tar
119+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-osx-x64.tar.gz
120+
- task: ArchiveFiles@2
121+
displayName: Archive MacOS arm64
122+
inputs:
123+
rootFolderOrFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/CLI-osx-arm64
124+
includeRootFolder: false
125+
archiveType: tar
126+
archiveFile: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/MSStoreCLI-osx-arm64.tar.gz
127+
- task: PowerShell@2
128+
displayName: Create Hashfiles
129+
inputs:
130+
targetType: inline
131+
script: |-
132+
foreach($file in Get-FileHash -Path "$(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/*.tar.gz" -Algorithm SHA256) {
133+
$content = $file.Hash.ToLower() + " " + [System.IO.Path]::GetFileName($file.Path)
134+
$path = $file.Path + ".sha256.txt"
135+
$content | Out-File $path
136+
}
137+
foreach($file in Get-FileHash -Path "$(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/*.zip" -Algorithm SHA256) {
138+
$content = $file.Hash.ToLower() + " " + [System.IO.Path]::GetFileName($file.Path)
139+
$path = $file.Path + ".sha256.txt"
140+
$content | Out-File $path
141+
}
142+
- task: GitHubRelease@1
143+
displayName: GitHub release (create)
144+
inputs:
145+
gitHubConnection: github_msstorecli
146+
repositoryName: Microsoft/msstore-cli
147+
tagSource: userSpecifiedTag
148+
tag: $(Build.SourceBranchName)
149+
title: Microsoft Store CLI $(Build.SourceBranchName)
150+
releaseNotesSource: inline
151+
assets: |-
152+
$(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/**/*.tar.gz
153+
$(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/**/*.zip
154+
$(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/**/*.sha256.txt
155+
isDraft: true
156+
isPreRelease: true
157+
changeLogCompareToRelease: lastNonDraftRelease
158+
- task: MS-RDX-MRO.windows-store-publish-dev.publish-task.store-publish@3
159+
displayName: 'Publish Store'
160+
inputs:
161+
serviceEndpoint: MSStoreCLI - StoreBroker
162+
appId: 9P53PC5S0PHJ
163+
sourceFolder: $(System.DefaultWorkingDirectory)/_MSStore CLI - Build Release/
164+
contents: |-
165+
MSIX-x64/*_x64.msix
166+
MSIX-arm64/*_arm64.msix
167+
force: true
168+
skipPolling: true
169+
deletePackages: true
170+
numberOfPackagesToKeep: 0
171+
targetPublishMode: Manual
172+
Visibility: Private
173+
- stage: HomeBrew
174+
displayName: MacOS HomeBrew Deployment
175+
dependsOn: GitHub_Release_And_MSStore
176+
variables:
177+
- name: GitHubPAT
178+
value:
179+
jobs:
180+
- job: PreDeploymentApprovalJob
181+
displayName: Pre-Deployment Approval
182+
condition: succeeded()
183+
timeoutInMinutes: 0
184+
pool: server
185+
steps:
186+
- task: ManualValidation@1
187+
inputs:
188+
notifyUsers: $(notifyUsers)
189+
approvers: $(approversUsers)
190+
- job: HomeBrewDeployment
191+
displayName: HomeBrew Deployment
192+
dependsOn: PreDeploymentApprovalJob
193+
condition: succeeded()
194+
timeoutInMinutes: 0
195+
steps:
196+
- task: CmdLine@2
197+
displayName: Checkout HomeBrew Repo
198+
inputs:
199+
script: git clone https://oauth2:$(GitHubPAT)@github.com/microsoft/homebrew-msstore-cli.git .
200+
- task: DownloadGitHubRelease@0
201+
displayName: Download GitHub Release
202+
inputs:
203+
connection: github_msstorecli
204+
userRepository: Microsoft/msstore-cli
205+
defaultVersionType: specificTag
206+
version: $(Build.SourceBranchName)
207+
itemPattern: '*.sha256.txt'
208+
- task: PowerShell@2
209+
displayName: Update Ruby file
210+
inputs:
211+
filePath: update-formula.ps1
212+
arguments: $(Build.SourceBranchName)
213+
- task: CmdLine@2
214+
displayName: Git operations
215+
inputs:
216+
script: |-
217+
git config user.email "msstore.cli.dev.bot@microsoft.com"
218+
git config user.name "MSStore CLI Dev Bot"
219+
git add -f Formula\msstore-cli.rb
220+
git commit -m "Update formula with new release ($(Build.SourceBranchName))."
221+
git push origin main

0 commit comments

Comments
 (0)