Skip to content

Commit c56b0b1

Browse files
committed
.azure-pipelines/release.yml: add macOS builds
Add macOS release build definitions on Azure Pipelines. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent ec08da1 commit c56b0b1

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.azure-pipelines/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ parameters:
1818
#
1919
# 1ES Pipeline Templates do not allow using a matrix strategy so we create
2020
# a YAML object parameter with and foreach to create jobs for each entry.
21+
# Each OS has its own matrix object since their build steps differ.
2122
#
2223
- name: windows_matrix
2324
type: object
@@ -29,6 +30,22 @@ parameters:
2930
image: win-x86_64-ado1es
3031
os: windows
3132

33+
- name: macos_matrix
34+
type: object
35+
default:
36+
- id: macos_x64
37+
jobName: 'macOS (x64)'
38+
runtime: osx-x64
39+
pool: 'Azure Pipelines'
40+
image: macOS-latest
41+
os: macos
42+
- id: macos_arm64
43+
jobName: 'macOS (ARM64)'
44+
runtime: osx-arm64
45+
pool: 'Azure Pipelines'
46+
image: macOS-latest
47+
os: macos
48+
3249
variables:
3350
- name: 'esrpConnectionName'
3451
value: 'ESRP-1ESGitClient'
@@ -180,3 +197,67 @@ extends:
180197
# "toolVersion": "1.0"
181198
# }
182199
# ]
200+
201+
#
202+
# macOS build jobs
203+
#
204+
- ${{ each dim in parameters.macos_matrix }}:
205+
- job: ${{ dim.id }}
206+
displayName: ${{ dim.jobName }}
207+
pool:
208+
name: ${{ dim.pool }}
209+
image: ${{ dim.image }}
210+
os: ${{ dim.os }}
211+
templateContext:
212+
outputs:
213+
- output: pipelineArtifact
214+
targetPath: '$(Build.ArtifactStagingDirectory)/payload'
215+
artifactName: '${{ dim.runtime }}_payload'
216+
- output: pipelineArtifact
217+
targetPath: '$(Build.ArtifactStagingDirectory)/symbols'
218+
artifactName: '${{ dim.runtime }}_symbols'
219+
- output: pipelineArtifact
220+
targetPath: '$(Build.ArtifactStagingDirectory)/installers'
221+
artifactName: '${{ dim.runtime }}_installers'
222+
steps:
223+
- checkout: self
224+
- task: Bash@3
225+
displayName: 'Get version'
226+
inputs:
227+
targetType: inline
228+
script: |
229+
echo "##vso[task.setvariable variable=VERSION]$(cat ./VERSION | sed -E 's/.[0-9]+$//')"
230+
- task: UseDotNet@2
231+
displayName: 'Use .NET 8 SDK'
232+
inputs:
233+
packageType: sdk
234+
version: '8.x'
235+
- task: Bash@3
236+
displayName: 'Build payload'
237+
inputs:
238+
targetType: filePath
239+
filePath: './src/osx/Installer.Mac/layout.sh'
240+
arguments: |
241+
--runtime="${{ dim.runtime }}" \
242+
--configuration="Release" \
243+
--output="$(Build.ArtifactStagingDirectory)/payload" \
244+
--symbol-output="$(Build.ArtifactStagingDirectory)/symbols"
245+
- task: Bash@3
246+
displayName: 'Build component package'
247+
inputs:
248+
targetType: filePath
249+
filePath: './src/osx/Installer.Mac/pack.sh'
250+
arguments: |
251+
--version="$(VERSION)" \
252+
--payload="$(Build.ArtifactStagingDirectory)/payload" \
253+
--output="$(Build.ArtifactStagingDirectory)/pkg/com.microsoft.gitcredentialmanager.component.pkg"
254+
- task: Bash@3
255+
displayName: 'Build installer package'
256+
inputs:
257+
targetType: filePath
258+
filePath: './src/osx/Installer.Mac/dist.sh'
259+
arguments: |
260+
--version="$(VERSION)" \
261+
--runtime="${{ dim.runtime }}" \
262+
--package-path="$(Build.ArtifactStagingDirectory)/pkg" \
263+
--output="$(Build.ArtifactStagingDirectory)/installers/gcm-${{ dim.runtime }}-$(VERSION).pkg"

0 commit comments

Comments
 (0)