Skip to content

Commit 307f9aa

Browse files
authored
[release/8.0.1xx-xcode15.4] Merge main CI changes into our release branch (#21108)
We do not intend to merge this branch back into main so it is safe to bring all CI changes at once in order to be in sync and avoid merge conflict cherry-picking commits
1 parent 8e5feb5 commit 307f9aa

File tree

12 files changed

+1120
-1105
lines changed

12 files changed

+1120
-1105
lines changed

tools/devops/automation/build-pipeline.yml

Lines changed: 206 additions & 205 deletions
Large diffs are not rendered by default.

tools/devops/automation/build-pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ extends:
246246
forceInsertion: ${{ parameters.forceInsertion }}
247247
skipESRP: ${{ parameters.skipESRP }}
248248
pushNugets: false
249+
pushNugetsToMaestro: false
249250
${{ if ne(length(parameters.testConfigurations), 0)}}:
250251
testConfigurations: ${{ parameters.testConfigurations }}
251252
deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }}

tools/devops/automation/scripts/bash/compare.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ mkdir -p "$CHANGE_DETECTION_RESULTS_DIR"
2121

2222
cd "$XAM_TOP"
2323

24+
if test -z "$PR_ID"; then
25+
PR_ID=$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
26+
fi
27+
2428
# Figure out the base hash we want to compare against
2529
if [[ $PR_ID ]]; then
2630
git fetch --no-tags --progress https://github.com/xamarin/xamarin-macios +refs/pull/"$PR_ID"/*:refs/remotes/origin/pr/"$PR_ID"/*

tools/devops/automation/scripts/generate_agent_logs.ps1

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,28 @@ param
2121
# the build started
2222

2323
# User name can be anything. It is the personal access token (PAT) token that matters.
24-
$user= "AnyUser"
25-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user, $VstsToken)))
26-
$headers = @{Authorization = "Basic {0}" -f $base64AuthInfo}
27-
28-
# get the url of the build
29-
$url= $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI + "$Env:SYSTEM_TEAMPROJECT/_apis/build/builds/" + $Env:BUILD_BUILDID + "?api-version=5.1"
30-
$buildPipeline= Invoke-RestMethod -Uri $url -Headers $headers -Method Get
31-
32-
$start=[DateTime]::Parse($buildPipeline.startTime).ToString("yyyy-MM-dd HH:mm:ss")
33-
34-
$end=Get-Date -Format "yyyy-MM-dd HH:mm:ss"
35-
Write-Host "end time: $end"
36-
37-
if (-not $Predicate) {
38-
log show --style $Style --start "$start" --end "$end" > $Output
39-
} else {
40-
log show --predicate $Predicate --style $Style --start "$start" --end "$end" > $Output
24+
try {
25+
$user= "AnyUser"
26+
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user, $VstsToken)))
27+
$headers = @{Authorization = "Basic {0}" -f $base64AuthInfo}
28+
29+
# get the url of the build
30+
$url= $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI + "$Env:SYSTEM_TEAMPROJECT/_apis/build/builds/" + $Env:BUILD_BUILDID + "?api-version=5.1"
31+
$buildPipeline= Invoke-RestMethod -Uri $url -Headers $headers -Method Get
32+
33+
$start=[DateTime]::Parse($buildPipeline.startTime).ToString("yyyy-MM-dd HH:mm:ss")
34+
35+
$end=Get-Date -Format "yyyy-MM-dd HH:mm:ss"
36+
Write-Host "end time: $end"
37+
38+
if (-not $Predicate) {
39+
log show --style $Style --start "$start" --end "$end" > $Output
40+
} else {
41+
log show --predicate $Predicate --style $Style --start "$start" --end "$end" > $Output
42+
}
43+
} catch {
44+
Write-Host "Exception occurred: $_"
45+
# Create the output file, because we later try to upload it as an artifact, and *not* uploading
46+
# if there's *no* file is much harder than just creating the file.
47+
New-Item -Path $Output -Value "$_"
4148
}
Lines changed: 146 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,159 @@
1+
# yamllint disable rule:line-length
12
parameters:
2-
- name: vsdropsPrefix
3-
type: string
3+
- name: vsdropsPrefix
4+
type: string
45

5-
- name: keyringPass
6-
type: string
6+
- name: keyringPass
7+
type: string
78

8-
- name: gitHubToken
9-
type: string
9+
- name: gitHubToken
10+
type: string
1011

11-
- name: xqaCertPass
12-
type: string
12+
- name: xqaCertPass
13+
type: string
1314

14-
- name: uploadBinlogs
15-
type: boolean
16-
default: true
15+
- name: uploadBinlogs
16+
type: boolean
17+
default: true
1718

18-
- name: signAndNotarize
19-
type: boolean
20-
default: true
19+
- name: signAndNotarize
20+
type: boolean
21+
default: true
2122

22-
- name: skipESRP
23-
type: boolean
24-
default: false # only to be used when testing the CI and we do not need a signed pkg
23+
- name: skipESRP
24+
type: boolean
25+
default: false # only to be used when testing the CI and we do not need a signed pkg
2526

26-
- name: isPR
27-
type: boolean
27+
- name: isPR
28+
type: boolean
2829

29-
- name: repositoryAlias
30-
type: string
31-
default: self
30+
- name: repositoryAlias
31+
type: string
32+
default: self
3233

33-
- name: commit
34-
type: string
35-
default: HEAD
34+
- name: commit
35+
type: string
36+
default: HEAD
3637

37-
- name: uploadPrefix
38-
type: string
39-
default: '$(MaciosUploadPrefix)'
38+
- name: uploadPrefix
39+
type: string
40+
default: '$(MaciosUploadPrefix)'
4041

4142
steps:
42-
- template: build.yml
43-
parameters:
44-
isPR: ${{ parameters.isPR }}
45-
repositoryAlias: ${{ parameters.repositoryAlias }}
46-
commit: ${{ parameters.commit }}
47-
vsdropsPrefix: ${{ parameters.vsdropsPrefix }}
48-
keyringPass: ${{ parameters.keyringPass }}
49-
gitHubToken: ${{ parameters.gitHubToken }}
50-
xqaCertPass: ${{ parameters.xqaCertPass }}
51-
buildSteps:
52-
# build not signed .pkgs for the SDK
53-
- bash: |
54-
set -x
55-
set -e
56-
rm -Rf $(Build.SourcesDirectory)/package/*.pkg
57-
rm -Rf $(Build.SourcesDirectory)/package/notarized/*.pkg
58-
time make -C $(Build.SourcesDirectory)/xamarin-macios/ package
59-
name: packages
60-
displayName: 'Build Packages'
61-
condition: and(succeeded(), contains(variables['configuration.BuildPkgs'], 'True'))
62-
timeoutInMinutes: 180
63-
64-
# build nugets
65-
- bash: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/build-nugets.sh
66-
displayName: 'Build Nugets'
67-
condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True'), ne(variables['ENABLE_DOTNET'], ''))
68-
timeoutInMinutes: 180
69-
70-
- bash: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/generate-workload-rollback.sh
71-
name: workload_file
72-
displayName: 'Generate "WorkloadRollback.json"'
73-
74-
- task: 1ES.PublishPipelineArtifact@1
75-
displayName: 'Publish WorkloadRollback.json'
76-
inputs:
77-
path: $(Build.SourcesDirectory)/WorkloadRollback.json
78-
artifact: '${{ parameters.uploadPrefix }}WorkloadRollback'
79-
continueOnError: true
80-
81-
- bash: |
82-
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=IOS_PACKAGE_VERSION)
83-
IOS_PACKAGE_VERSION=${var#*=}
84-
IOS_PACKAGE_VERSION=$(echo $IOS_PACKAGE_VERSION | cut -d "+" -f1)
85-
86-
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MAC_PACKAGE_VERSION)
87-
MAC_PACKAGE_VERSION=${var#*=}
88-
MAC_PACKAGE_VERSION=$(echo $MAC_PACKAGE_VERSION | cut -d "+" -f1)
89-
90-
PKG_DST="$(Build.SourcesDirectory)/PkgsVersions.json"
91-
92-
echo "{" > $PKG_DST
93-
echo "\"iOS\": \"$IOS_PACKAGE_VERSION\"," >> $PKG_DST
94-
echo "\"macOS\": \"$MAC_PACKAGE_VERSION\"" >> $PKG_DST
95-
echo "}" >> $PKG_DST
96-
97-
echo "PkgVersions.json file contents:"
98-
echo "$(cat $PKG_DST)"
99-
name: pkg_versions_file
100-
displayName: 'Generate PkgsVersions.json'
101-
102-
- task: 1ES.PublishPipelineArtifact@1
103-
displayName: 'Publish PkgsVersions.json'
104-
inputs:
105-
path: $(Build.SourcesDirectory)/PkgsVersions.json
106-
artifact: '${{ parameters.uploadPrefix }}PkgsVersions'
107-
continueOnError: true
108-
109-
# upload each of the pkgs into the pipeline artifacts
110-
- task: 1ES.PublishPipelineArtifact@1
111-
displayName: 'Publish Build Artifacts'
112-
inputs:
113-
path: $(Build.SourcesDirectory)/package
114-
artifact: '${{ parameters.uploadPrefix }}not-signed-package'
115-
continueOnError: true
116-
117-
- bash: |
118-
set -x
119-
set -e
120-
121-
make -C $(Build.SourcesDirectory)/xamarin-macios/tests package-test-libraries.zip
122-
name: introPkg
123-
displayName: 'Package test libraries dependencies'
124-
continueOnError: true # not a terrible blocking issue
125-
timeoutInMinutes: 60
126-
127-
- task: 1ES.PublishPipelineArtifact@1
128-
displayName: 'Publish test libraries dependencies'
129-
inputs:
130-
path: $(Build.SourcesDirectory)/xamarin-macios/tests/package-test-libraries.zip
131-
artifact: '${{ parameters.uploadPrefix }}package-test-libraries'
132-
continueOnError: true
133-
134-
- task: 1ES.PublishPipelineArtifact@1
135-
displayName: 'Publish Build.props'
136-
inputs:
137-
path: $(Build.SourcesDirectory)/xamarin-macios/Build.props
138-
artifact: '${{ parameters.uploadPrefix }}Build.props'
139-
continueOnError: true
140-
141-
- ${{ if eq(parameters.uploadBinlogs, true) }}:
142-
# Copy all the binlogs to a separate directory, keeping directory structure.
143-
- script: |
144-
set -x
145-
mkdir -p $(Build.ArtifactStagingDirectory)/all-binlogs
146-
rsync -av --prune-empty-dirs --include '*/' --include '*.binlog' --exclude '*' $(Build.SourcesDirectory)/xamarin-macios $(Build.ArtifactStagingDirectory)/all-binlogs
147-
displayName: Copy all binlogs
148-
continueOnError: true
149-
condition: succeededOrFailed()
150-
151-
# Publish all the binlogs we collected in the previous step
152-
- task: 1ES.PublishPipelineArtifact@1
153-
displayName: 'Publish Artifact: All binlogs'
154-
inputs:
155-
path: $(Build.ArtifactStagingDirectory)/all-binlogs
156-
artifact: '${{ parameters.uploadPrefix }}all-binlogs-$(Build.BuildId)-$(System.StageAttempt)-$(System.JobAttempt)'
157-
continueOnError: true
158-
condition: succeededOrFailed()
43+
- template: build.yml
44+
parameters:
45+
isPR: ${{ parameters.isPR }}
46+
repositoryAlias: ${{ parameters.repositoryAlias }}
47+
commit: ${{ parameters.commit }}
48+
vsdropsPrefix: ${{ parameters.vsdropsPrefix }}
49+
keyringPass: ${{ parameters.keyringPass }}
50+
gitHubToken: ${{ parameters.gitHubToken }}
51+
xqaCertPass: ${{ parameters.xqaCertPass }}
52+
buildSteps:
53+
# build not signed .pkgs for the SDK
54+
- bash: |
55+
set -x
56+
set -e
57+
rm -Rf $(Build.SourcesDirectory)/package/*.pkg
58+
rm -Rf $(Build.SourcesDirectory)/package/notarized/*.pkg
59+
time make -C $(Build.SourcesDirectory)/xamarin-macios/ package
60+
name: packages
61+
displayName: 'Build Packages'
62+
condition: and(succeeded(), contains(variables['configuration.BuildPkgs'], 'True'))
63+
timeoutInMinutes: 180
64+
65+
# build nugets
66+
- bash: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/build-nugets.sh
67+
displayName: 'Build Nugets'
68+
condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True'), ne(variables['ENABLE_DOTNET'], ''))
69+
timeoutInMinutes: 180
70+
71+
- bash: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/generate-workload-rollback.sh
72+
name: workload_file
73+
displayName: 'Generate "WorkloadRollback.json"'
74+
75+
- task: 1ES.PublishPipelineArtifact@1
76+
displayName: 'Publish WorkloadRollback.json'
77+
inputs:
78+
path: $(Build.SourcesDirectory)/WorkloadRollback.json
79+
artifact: '${{ parameters.uploadPrefix }}WorkloadRollback'
80+
continueOnError: true
81+
82+
- bash: |
83+
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=IOS_PACKAGE_VERSION)
84+
IOS_PACKAGE_VERSION=${var#*=}
85+
IOS_PACKAGE_VERSION=$(echo $IOS_PACKAGE_VERSION | cut -d "+" -f1)
86+
87+
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MAC_PACKAGE_VERSION)
88+
MAC_PACKAGE_VERSION=${var#*=}
89+
MAC_PACKAGE_VERSION=$(echo $MAC_PACKAGE_VERSION | cut -d "+" -f1)
90+
91+
PKG_DST="$(Build.SourcesDirectory)/PkgsVersions.json"
92+
93+
echo "{" > $PKG_DST
94+
echo "\"iOS\": \"$IOS_PACKAGE_VERSION\"," >> $PKG_DST
95+
echo "\"macOS\": \"$MAC_PACKAGE_VERSION\"" >> $PKG_DST
96+
echo "}" >> $PKG_DST
97+
98+
echo "PkgVersions.json file contents:"
99+
echo "$(cat $PKG_DST)"
100+
name: pkg_versions_file
101+
displayName: 'Generate PkgsVersions.json'
102+
103+
- task: 1ES.PublishPipelineArtifact@1
104+
displayName: 'Publish PkgsVersions.json'
105+
inputs:
106+
path: $(Build.SourcesDirectory)/PkgsVersions.json
107+
artifact: '${{ parameters.uploadPrefix }}PkgsVersions'
108+
continueOnError: true
109+
110+
# upload each of the pkgs into the pipeline artifacts
111+
- task: 1ES.PublishPipelineArtifact@1
112+
displayName: 'Publish Build Artifacts'
113+
inputs:
114+
path: $(Build.SourcesDirectory)/package
115+
artifact: '${{ parameters.uploadPrefix }}not-signed-package'
116+
continueOnError: true
117+
118+
- bash: |
119+
set -x
120+
set -e
121+
122+
make -C $(Build.SourcesDirectory)/xamarin-macios/tests package-test-libraries.zip
123+
name: introPkg
124+
displayName: 'Package test libraries dependencies'
125+
continueOnError: true # not a terrible blocking issue
126+
timeoutInMinutes: 60
127+
128+
- task: 1ES.PublishPipelineArtifact@1
129+
displayName: 'Publish test libraries dependencies'
130+
inputs:
131+
path: $(Build.SourcesDirectory)/xamarin-macios/tests/package-test-libraries.zip
132+
artifact: '${{ parameters.uploadPrefix }}package-test-libraries'
133+
continueOnError: true
134+
135+
- task: 1ES.PublishPipelineArtifact@1
136+
displayName: 'Publish Build.props'
137+
inputs:
138+
path: $(Build.SourcesDirectory)/xamarin-macios/Build.props
139+
artifact: '${{ parameters.uploadPrefix }}Build.props'
140+
continueOnError: true
141+
142+
- ${{ if eq(parameters.uploadBinlogs, true) }}:
143+
# Copy all the binlogs to a separate directory, keeping directory structure.
144+
- script: |
145+
set -x
146+
mkdir -p $(Build.ArtifactStagingDirectory)/all-binlogs
147+
rsync -av --prune-empty-dirs --include '*/' --include '*.binlog' --exclude '*' $(Build.SourcesDirectory)/xamarin-macios $(Build.ArtifactStagingDirectory)/all-binlogs
148+
displayName: Copy all binlogs
149+
continueOnError: true
150+
condition: succeededOrFailed()
151+
152+
# Publish all the binlogs we collected in the previous step
153+
- task: 1ES.PublishPipelineArtifact@1
154+
displayName: 'Publish Artifact: All binlogs'
155+
inputs:
156+
path: $(Build.ArtifactStagingDirectory)/all-binlogs
157+
artifact: '${{ parameters.uploadPrefix }}all-binlogs-$(Build.BuildId)-$(System.StageAttempt)-$(System.JobAttempt)'
158+
continueOnError: true
159+
condition: succeededOrFailed()

0 commit comments

Comments
 (0)