Skip to content

Commit 4fe29d4

Browse files
[Pipelines] Migrate to 1ES pipeline (#539)
* Migrate to 1ES pipeline * Remove unused binary for Binskim to pass
1 parent b85e766 commit 4fe29d4

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

.azuredevops/appcenter-sdk-unity-build-release-1es.yml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ trigger:
44
pr:
55
- master
66
- develop
7+
8+
variables:
9+
- name: EDITOR_URL_WIN
10+
value: 'https://download.unity3d.com/download_unity/61fce66342ad/Windows64EditorInstaller/UnitySetup64-2018.4.18f1.exe'
11+
- name: IL2CPP_SUPPORT_URL
12+
value: 'https://download.unity3d.com/download_unity/61fce66342ad/TargetSupportInstaller/UnitySetup-UWP-IL2CPP-Support-for-Editor-2018.4.18f1.exe'
13+
- name: NUGET_FEED_ID
14+
value: 'AppCenter'
15+
716
resources:
817
repositories:
918
- repository: self
@@ -13,75 +22,79 @@ resources:
1322
type: git
1423
name: 1ESPipelineTemplates/1ESPipelineTemplates
1524
ref: refs/tags/release
16-
name: $(Build.SourceBranchName)_$(date:yyyyMMdd)$(rev:.r)
25+
name: ${{ replace(variables['Build.SourceBranchName'], '/', '-') }}_$(date:yyyyMMdd)$(rev:.r)
1726
extends:
1827
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
1928
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2029
${{ else }}:
2130
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
2231
parameters:
2332
pool:
24-
name: 1ES-PT-Windows-2022
33+
name: 1ES-PT-Windows-2019
2534
os: windows
2635
customBuildTags:
2736
- ES365AIMigrationTooling-BulkMigrated
2837
sdl:
2938
sourceAnalysisPool: 1ES-PT-Windows-2022
3039
stages:
3140
- stage: BuildAppCenterSDKUnity
32-
dependsOn: []
3341
jobs:
3442
- job: sdkBuildJob
3543
displayName: BuildAppCenterSDKUnity
3644
cancelTimeoutInMinutes: 1
3745
templateContext:
3846
outputs:
3947
- output: pipelineArtifact
40-
displayName: 'Publish Artifact: framework'
41-
path: '$(Build.ArtifactStagingDirectory)'
42-
artifactName: assemblies
48+
displayName: 'Publish Artifact: UnityPackages'
49+
path: 'output'
50+
artifactName: UnityPackages
4351
steps:
52+
- task: AzureKeyVault@2
53+
displayName: 'Download KeyValult Variables'
54+
inputs:
55+
azureSubscription: 'AC - Dev Infra & Build Pool'
56+
KeyVaultName: 'mobile-center-sdk'
57+
SecretsFilter: 'appcenter-sdk-unity-serial-number-windows,appcenter-sdk-unity-username,appcenter-sdk-unity-password,appcensk-appcenter-token,appcenter-sdk-blob-storage-access-secret'
58+
RunAsPreJob: false
4459
- task: PowerShell@2
4560
displayName: 'Install Unity'
4661
inputs:
4762
targetType: filePath
4863
filePath: ./build.ps1
4964
arguments: '-Target="Install-Unity-Windows" -Verbosity="Diagnostic"'
50-
5165
- task: UseDotNet@2
5266
displayName: 'Use .Net Core sdk 3.0.100'
5367
inputs:
5468
version: 3.0.100
55-
5669
- task: PowerShell@2
5770
displayName: 'Activate Unity'
5871
inputs:
5972
targetType: filePath
6073
filePath: ./build.ps1
61-
arguments: '-Target="RegisterUnity" -UnitySerialNumber="$(UNITY_SERIAL_NUMBER_WINDOWS)" -UnityUsername="$(UNITY_USERNAME)" -UnityPassword="$(UNITY_PASSWORD)" -Verbosity="Diagnostic"'
62-
74+
arguments: '-Target="RegisterUnity" -UnitySerialNumber="$(appcenter-sdk-unity-serial-number-windows)" -UnityUsername="$(appcenter-sdk-unity-username)" -UnityPassword="$(appcenter-sdk-unity-password)" -Verbosity="Diagnostic"'
6375
- script: |
64-
echo After activating unity, some important .meta files are deleted, so they must be un-deleted
65-
git config --global user.email "[email protected]"
66-
git config --global user.name "Your Name"
67-
git stash
68-
displayName: 'git stash'
69-
76+
git submodule init
77+
git submodule update
78+
displayName: 'Fetch submodules'
79+
- script: |
80+
echo Removing unnecessary file to prevent Binskim failure. This file used for tests and not required for build.
81+
rm BreakpadSupport/breakpad-support/src/main/cpp/google-breakpad/src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe
82+
displayName: 'Remove dump_syms_regtest64.exe'
7083
- task: PowerShell@2
7184
displayName: 'Create Packages'
7285
inputs:
7386
targetType: filePath
7487
filePath: ./build.ps1
75-
arguments: '-Target="CreatePackages" -NuGetPassword="$(NUGET_PASSWORD)" -NuGetFeedId="$(NUGET_FEED_ID)" -StorageAuthParams="$(AZURE_STORAGE_CONNECTION_STRING)" -Verbosity="Diagnostic"'
88+
arguments: '-Target="CreatePackages" -NuGetPassword="$(appcensk-appcenter-token)" -NuGetFeedId="$(NUGET_FEED_ID)" -StorageAuthParams="$(appcenter-sdk-blob-storage-access-secret)" -Verbosity="Diagnostic"'
7689
ignoreLASTEXITCODE: true
7790
pwsh: true
78-
7991
- task: PowerShell@2
8092
displayName: 'Unregister Unity'
8193
inputs:
8294
targetType: filePath
8395
filePath: ./build.ps1
84-
96+
arguments: '-Target="UnregisterUnity" -UnitySerialNumber="$(appcenter-sdk-unity-serial-number-windows)" -UnityUsername="$(appcenter-sdk-unity-username)" -UnityPassword="$(appcenter-sdk-unity-password)" -Verbosity="Diagnostic"'
97+
condition: always()
8598
- powershell: |
8699
$change_log_found = $False
87100
$change_log = Foreach ($line in Get-Content "CHANGELOG.md") {
@@ -95,40 +108,34 @@ extends:
95108
}
96109
}
97110
($change_log | Out-String).Trim() | Set-Content "RELEASE.md"
98-
displayName: 'Generate RELEASE.MD'
99-
111+
displayName: 'Generate RELEASE.MD'
100112
- powershell: |
101113
$input = Get-Content .\UnityPackageSpecs\AppCenter.unitypackagespec -Raw
102114
$xml = [xml]$input
103115
$version = ($xml.package | Where { $_.name -eq "AppCenter" }).version
104116
Write-Host $version
105117
Write-Host "##vso[task.setvariable variable=version]$version"
106118
displayName: 'Extract Version'
107-
108119
- task: ExtractFiles@1
109120
displayName: 'Extract AppCenter for APIScan '
110121
inputs:
111122
archiveFilePatterns: 'output/AppCenter-*.unitypackage'
112123
destinationFolder: 'apiscan-folder/AppCenter/'
113-
114124
- task: ExtractFiles@1
115125
displayName: 'Extract AppCenterAnalytics for APIScan'
116126
inputs:
117127
archiveFilePatterns: 'output/AppCenterAnalytics-*.unitypackage'
118128
destinationFolder: 'apiscan-folder/AppCenterAnalytics/'
119-
120129
- task: ExtractFiles@1
121130
displayName: 'Extract AppCenterCrashes for APIScan'
122131
inputs:
123132
archiveFilePatterns: 'output/AppCenterCrashes-*.unitypackage'
124133
destinationFolder: 'apiscan-folder/AppCenterCrashes/'
125-
126134
- task: ExtractFiles@1
127135
displayName: 'Extract AppCenterDistribute for APIScan'
128136
inputs:
129137
archiveFilePatterns: 'output/AppCenterDistribute-*.unitypackage'
130138
destinationFolder: 'apiscan-folder/AppCenterDistribute/'
131-
132139
- task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@2
133140
displayName: 'Run APIScan'
134141
inputs:

0 commit comments

Comments
 (0)