1
1
parameters :
2
2
- name : mono_branch
3
- displayName : Branch
3
+ displayName : Branch of build
4
4
type : string
5
5
default : main
6
6
values :
@@ -38,12 +38,14 @@ jobs:
38
38
- checkout : none
39
39
40
40
- script : |
41
+ set -e
41
42
gh api repos/mono/mono/statuses/${{ parameters.mono_commit }} --raw-field "state=pending" --raw-field "context=PKG-mono" --raw-field "target_url=$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
42
43
displayName: Set pending GitHub status
43
44
env:
44
45
GITHUB_TOKEN: $(GITHUB_TOKEN)
45
46
46
47
- script : |
48
+ set -e
47
49
cd $(Build.SourcesDirectory)
48
50
MONO_SIGNED_PKG_DIR="${{ parameters.mono_branch }}/${{ parameters.mac_build_number }}/${{ parameters.mono_commit }}"
49
51
az storage blob download-batch -s build-package-osx-mono -d . --pattern "$MONO_SIGNED_PKG_DIR/unsigned/*"
@@ -61,10 +63,15 @@ jobs:
61
63
AZURE_STORAGE_KEY: $(AZURE_STORAGE_KEY)
62
64
63
65
- script : |
66
+ set -e
64
67
cd $(Build.SourcesDirectory)/payload
65
68
mkdir -p $(Build.ArtifactStagingDirectory)/mac_entitled
66
69
for i in $(find Library -type f); do
67
70
if file $i | grep Mach-O > /dev/null; then
71
+ if [ "$(basename $i)" == "Microsoft.CodeAnalysis.CSharp.dll.dylib" ]; then
72
+ echo "Remove i386 slice from $i"
73
+ lipo -remove i386 $i -o $i
74
+ fi
68
75
echo "Codesigning $i"
69
76
codesign -s - -f --options runtime --entitlements $(Build.SourcesDirectory)/mac-entitlements.plist $i
70
77
ditto -V $i $(Build.ArtifactStagingDirectory)/mac_entitled/$i
73
80
displayName: Codesign Mach-O files
74
81
75
82
- script : |
83
+ set -e
76
84
cd $(Build.ArtifactStagingDirectory)
77
85
hdiutil create mac_entitled_to_sign.dmg -ov -volname "MacEntitledToSign" -fs HFS+ -srcfolder "mac_entitled"
78
86
displayName: Archive binaries into .dmg for signing
@@ -105,13 +113,15 @@ jobs:
105
113
]
106
114
107
115
- script : |
116
+ set -e
108
117
cd $(Build.ArtifactStagingDirectory)
109
118
mkdir -p mac_entitled_signed
110
119
hdiutil attach mac_entitled_to_sign.dmg
111
120
cp -R /Volumes/MacEntitledToSign/Library mac_entitled_signed
112
121
displayName: 'Extract binaries after signing'
113
122
114
123
- script : |
124
+ set -e
115
125
cd $(Build.ArtifactStagingDirectory)/mac_entitled_signed
116
126
for i in $(find Library -type f); do
117
127
chmod +x $i
@@ -120,6 +130,7 @@ jobs:
120
130
displayName: Replace files with signed ones
121
131
122
132
- script : |
133
+ set -e
123
134
cd $(Build.SourcesDirectory)
124
135
pkgbuild --analyze --root $PWD/expanded $PWD/expanded/Info.plist
125
136
mono_version=$(grep packageIdentifier $PWD/expanded/Distribution | sed -E 's/.*version="([0-9\.]+)".*/\1/g')
@@ -130,6 +141,7 @@ jobs:
130
141
displayName: pkgbuild and productbuild
131
142
132
143
- script : |
144
+ set -e
133
145
cd $(Build.ArtifactStagingDirectory)
134
146
hdiutil create mono-to-sign.dmg -ov -volname "MonoToSign" -fs HFS+ -srcfolder "mono-to-sign"
135
147
displayName: Archive .pkg into .dmg for signing
@@ -154,6 +166,7 @@ jobs:
154
166
]
155
167
156
168
- script : |
169
+ set -e
157
170
cd $(Build.ArtifactStagingDirectory)
158
171
mkdir -p mono-signed
159
172
hdiutil attach mono-to-sign.dmg
@@ -182,6 +195,7 @@ jobs:
182
195
]
183
196
184
197
- script : |
198
+ set -e
185
199
cd $(Build.ArtifactStagingDirectory)
186
200
MONO_SIGNED_PKG="$(Build.ArtifactStagingDirectory)/mono-signed/$MONO_PKG_NAME"
187
201
echo "##vso[task.setvariable variable=MONO_SIGNED_PKG;]$MONO_SIGNED_PKG"
@@ -191,6 +205,7 @@ jobs:
191
205
displayName: Validate .pkg
192
206
193
207
- script : |
208
+ set -e
194
209
mono_sha=$(shasum --binary --algorithm 256 $MONO_SIGNED_PKG | cut -d ' ' -f 1)
195
210
mono_mdfive=$(md5 -q $MONO_SIGNED_PKG)
196
211
mono_size=$(stat -f "%z" $MONO_SIGNED_PKG)
@@ -216,6 +231,7 @@ jobs:
216
231
artifact : NotarizedPKG
217
232
218
233
- script : |
234
+ set -e
219
235
cd $(Build.ArtifactStagingDirectory)
220
236
az storage blob upload-batch -s mono-signed --destination-path "$MONO_SIGNED_PKG_DIR" --pattern "*" -d build-package-osx-mono --account-name xamjenkinsartifact
221
237
displayName: Upload artifacts to blob storage
@@ -224,6 +240,7 @@ jobs:
224
240
AZURE_STORAGE_KEY: $(AZURE_STORAGE_KEY)
225
241
226
242
- script : |
243
+ set -e
227
244
gh api repos/mono/mono/statuses/${{ parameters.mono_commit }} --raw-field "state=success" --raw-field "context=PKG-mono" --raw-field "target_url=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/$MONO_SIGNED_PKG_DIR/$MONO_PKG_NAME"
228
245
gh api repos/mono/mono/statuses/${{ parameters.mono_commit }} --raw-field "state=success" --raw-field "context=artifacts.json" --raw-field "target_url=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/$MONO_SIGNED_PKG_DIR/artifacts.json"
229
246
displayName: Set success GitHub status
0 commit comments