@@ -22,78 +22,119 @@ parameters:
22
22
type : boolean
23
23
default : false
24
24
25
+ - name : DoESRP
26
+ displayName : Do ESRP
27
+ type : boolean
28
+ default : false
29
+
30
+ # these 2 parameters are used for debugging.
31
+ - name : SpecificArtifact
32
+ displayName : Use Specific Artifact (Debugging only)
33
+ type : boolean
34
+ default : false
35
+
36
+ - name : BuildId
37
+ displayName : Pipeline BuildId, you could find it in the URL
38
+ type : string
39
+ default : ' 0'
40
+
25
41
stages :
26
42
- stage : MacOS_C_API_Packaging_CPU
27
43
dependsOn : []
28
44
jobs :
29
- - ${{ if eq(parameters.BuildForAllArchs, true) }} :
30
45
- template : mac-cpu-packing-jobs.yml
31
46
parameters :
32
47
MacosArch : ' x86_64'
33
48
AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
34
49
AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
35
50
WithCache : ${{ parameters.WithCache }}
36
- - template : mac-cpu-packing-jobs.yml
37
- parameters :
38
- MacosArch : ' arm64'
39
- AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
40
- AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
41
- WithCache : ${{ parameters.WithCache }}
42
- - template : mac-cpu-packing-jobs.yml
43
- parameters :
44
- MacosArch : ' universal2'
45
- AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
46
- AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
47
- WithCache : ${{ parameters.WithCache }}
48
- - job : MacOS_C_API_Package_Publish_All
49
- dependsOn :
50
- - MacOS_C_API_Packaging_CPU_x86_64
51
- - MacOS_C_API_Packaging_CPU_arm64
52
- - MacOS_C_API_Packaging_CPU_universal2
53
- pool :
54
- vmImage : ' macOS-12'
55
- steps :
56
- - task : DownloadPipelineArtifact@2
57
- inputs :
58
- artifact : ' onnxruntime-osx-x86_64'
59
- targetPath : ' $(Build.ArtifactStagingDirectory)'
60
- - task : DownloadPipelineArtifact@2
61
- inputs :
62
- artifact : ' onnxruntime-osx-arm64'
63
- targetPath : ' $(Build.ArtifactStagingDirectory)'
64
- - task : DownloadPipelineArtifact@2
65
- inputs :
66
- artifact : ' onnxruntime-osx-universal2'
67
- targetPath : ' $(Build.ArtifactStagingDirectory)'
68
- - task : PublishPipelineArtifact@1
69
- inputs :
70
- targetPath : ' $(Build.ArtifactStagingDirectory)'
71
- artifact : ' onnxruntime-osx'
72
- condition : ' succeededOrFailed()'
73
- - template : component-governance-component-detection-steps.yml
51
+
52
+ - ${{ if eq(parameters.BuildForAllArchs, true) }} :
53
+ - template : mac-cpu-packing-jobs.yml
74
54
parameters :
75
- condition : ' succeeded'
76
- - ${{ if ne(parameters.BuildForAllArchs, true) }} :
77
- - template : mac-cpu-packing-jobs.yml
78
- parameters :
79
- MacosArch : ' x86_64'
80
- AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
81
- AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
82
- WithCache : ${{ parameters.WithCache }}
83
- - job : MacOS_C_API_Package_Publish_x86_64
84
- dependsOn : MacOS_C_API_Packaging_CPU_x86_64
55
+ MacosArch : ' arm64'
56
+ AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
57
+ AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
58
+ WithCache : ${{ parameters.WithCache }}
59
+ - template : mac-cpu-packing-jobs.yml
60
+ parameters :
61
+ MacosArch : ' universal2'
62
+ AllowReleasedOpsetOnly : ${{ parameters.AllowReleasedOpsetOnly }}
63
+ AdditionalBuildFlags : ${{ parameters.AdditionalBuildFlags }}
64
+ WithCache : ${{ parameters.WithCache }}
65
+
66
+ - stage : MacOS_C_API_Package_Publish
67
+ dependsOn : MacOS_C_API_Packaging_CPU
68
+ jobs :
69
+ - job : MacOS_C_API_Package_Publish
85
70
pool :
86
71
vmImage : ' macOS-12'
87
72
steps :
88
- - task : DownloadPipelineArtifact@2
89
- inputs :
90
- artifact : ' onnxruntime-osx-x86_64'
91
- targetPath : ' $(Build.ArtifactStagingDirectory)'
73
+ - checkout : none
74
+ - template : flex-downloadPipelineArtifact.yml
75
+ parameters :
76
+ StepName : ' Download Pipeline onnxruntime-osx-x86_64'
77
+ ArtifactName : ' onnxruntime-osx-x86_64'
78
+ TargetPath : ' $(Build.ArtifactStagingDirectory)'
79
+ SpecificArtifact : ${{ parameters.SpecificArtifact }}
80
+ BuildId : ${{ parameters.BuildId }}
81
+
82
+ - ${{ if eq(parameters.BuildForAllArchs, true) }} :
83
+ - template : flex-downloadPipelineArtifact.yml
84
+ parameters :
85
+ StepName : ' Download Pipeline onnxruntime-osx-arm64'
86
+ ArtifactName : ' onnxruntime-osx-arm64'
87
+ TargetPath : ' $(Build.ArtifactStagingDirectory)'
88
+ SpecificArtifact : ${{ parameters.SpecificArtifact }}
89
+ BuildId : ${{ parameters.BuildId }}
90
+ - template : flex-downloadPipelineArtifact.yml
91
+ parameters :
92
+ StepName : ' Download Pipeline onnxruntime-osx-universal2'
93
+ ArtifactName : ' onnxruntime-osx-universal2'
94
+ TargetPath : ' $(Build.ArtifactStagingDirectory)'
95
+ SpecificArtifact : ${{ parameters.SpecificArtifact }}
96
+ BuildId : ${{ parameters.BuildId }}
97
+
98
+ - ${{ if eq(parameters.DoESRP, true)}} :
99
+ - script : |
100
+ pushd '$(Build.ArtifactStagingDirectory)'
101
+ find . '*.tgz' -exec tar -zxvf {} \;
102
+ rm -f *.tgz;
103
+ find . -type d -name 'onnxruntime-osx-*' -exec zip -FSr --symlinks {}.zip {} \;
104
+ find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
105
+ ls -l
106
+ popd
107
+ displayName: tgz to zip
108
+ - template : mac-esrp-dylib.yml
109
+ parameters :
110
+ FolderPath : ' $(Build.ArtifactStagingDirectory)'
111
+ DisplayName : ' ESRP - Sign Mac'
112
+ DoEsrp : true
113
+ Pattern : ' *.zip'
114
+ - script : |
115
+ pushd '$(Build.ArtifactStagingDirectory)'
116
+ find . '*.zip' -exec unzip {} \;
117
+ rm -f *.zip;
118
+ find . -type d -name 'onnxruntime-osx-*' -exec tar -czf {}.tgz {} \;
119
+ find . -type d -name 'onnxruntime-osx-*' -exec rm -rf {} \;
120
+ ls -l
121
+ popd
122
+ displayName: zip to tgz
123
+ - bash : |
124
+ set -ex
125
+ mkdir -p $(Agent.TempDirectory)/macpackage
126
+ find $(Build.ArtifactStagingDirectory) -name "*.tgz" -exec tar -zxvf {} -C $(Agent.TempDirectory)/macpackage \;
127
+ find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec codesign -dvvv {} \;
128
+ find $(Agent.TempDirectory)/macpackage -name "*.dylib" -exec ls -l {} \;
129
+ rm -rf $(Agent.TempDirectory)/macpackage
130
+ displayName: 'Verify code signing'
131
+
92
132
- task : PublishPipelineArtifact@1
93
133
inputs :
94
134
targetPath : ' $(Build.ArtifactStagingDirectory)'
95
135
artifact : ' onnxruntime-osx'
96
136
condition : ' succeededOrFailed()'
137
+
97
138
- template : component-governance-component-detection-steps.yml
98
139
parameters :
99
- condition : ' succeeded'
140
+ condition : ' succeeded'
0 commit comments