|
| 1 | +trigger: |
| 2 | + - master |
| 3 | + - refs/tags/* |
1 | 4 |
|
2 | 5 | variables: |
3 | | - MONO_VERSION: 5_16_0 |
4 | | - XCODE_VERSION: 10.1 |
5 | | - VERBOSITY: minimal |
6 | | - API_TOOLS_VERSION: 1.0.2-preview.13 |
7 | | - BINDERATOR_VERSION: 0.4.0 |
8 | | - DOTNET_CORE_VERSION: 2.2.x |
| 6 | + BUILD_NUMBER: $(Build.BuildNumber) |
| 7 | +# XAMARIN_ANDROID_PATH: <path to Xamarin.Android> |
9 | 8 |
|
10 | 9 | resources: |
11 | 10 | repositories: |
12 | | - - repository: xamarin-templates |
| 11 | + - repository: internal-templates |
13 | 12 | type: github |
14 | 13 | name: xamarin/yaml-templates |
15 | 14 | endpoint: xamarin |
| 15 | + - repository: components |
| 16 | + type: github |
| 17 | + name: xamarin/XamarinComponents |
| 18 | + endpoint: xamarin |
16 | 19 |
|
17 | 20 | jobs: |
18 | | - |
19 | | - - job: build |
20 | | - displayName: 'Build Libraries & NuGets (macOS)' |
21 | | - timeoutInMinutes: 360 |
22 | | - pool: |
23 | | - vmImage: macos-10.13 |
24 | | - steps: |
25 | | - # Make sure to select the correct Xamarin and mono |
26 | | - - bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION) |
27 | | - displayName: 'Switch to the latest Xamarin SDK' |
28 | | - - bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer |
29 | | - displayName: 'Switch to the latest Xcode' |
30 | | - # install dotnet and tools |
31 | | - - bash: echo '##vso[task.setvariable variable=PATH;]'$PATH:$HOME/.dotnet/tools |
32 | | - displayName: 'Add ~/.dotnet/tools to the PATH environment variable' |
33 | | - condition: eq(variables['System.JobName'], 'macos') |
34 | | - - task: UseDotNet@2 |
35 | | - displayName: 'Use the correct version of the .NET Core SDK' |
36 | | - inputs: |
37 | | - version: $(DOTNET_CORE_VERSION) |
38 | | - # Install dotnet tools |
39 | | - - powershell: | |
40 | | - dotnet tool install -g xamarin.androidbinderator.tool --version $(BINDERATOR_VERSION) |
41 | | - displayName: 'Install dotnet tools' |
42 | | - # Build the libraries and packages |
43 | | - - bash: sh build.sh --target=ci --settings_skipverification=true --verbosity=$(VERBOSITY) |
44 | | - displayName: 'Build NuGets' |
45 | | - - script: | |
46 | | - # Make a temp folder to move the created nugets to before we fat package them |
47 | | - mkdir -p $(Build.SourcesDirectory)/tmp/nuget |
48 | | - mkdir -p $(Build.SourcesDirectory)/tmp/output |
49 | | - # Move all of the nupkg files from output into the temp folder we just created |
50 | | - mv $(Build.SourcesDirectory)/output/*.nupkg $(Build.SourcesDirectory)/tmp/nuget |
51 | | - # Move the remaining output bits to a temp location so they don't get overwritten |
52 | | - mv $(Build.SourcesDirectory)/output/* $(Build.SourcesDirectory)/tmp/output |
53 | | - sh build.sh --script nuget.cake \ |
54 | | - --localSource=$(Build.SourcesDirectory)/tmp/nuget \ |
55 | | - --packagesPath=$(Build.SourcesDirectory)/tmp/pkgs \ |
56 | | - --workingPath=$(Build.SourcesDirectory)/tmp/working \ |
57 | | - --outputPath=$(Build.SourcesDirectory)/output \ |
58 | | - --incrementVersion=False \ |
59 | | - --packLatestOnly=True \ |
60 | | - --useExplicitVersion=True |
61 | | - # Move the other output bits back to the original output folder |
62 | | - mv $(Build.SourcesDirectory)/tmp/output/* $(Build.SourcesDirectory)/output |
63 | | - displayName: 'NuGet FAT' |
64 | | - enabled: false |
65 | | - # Publish the artifacts |
66 | | - - task: PublishBuildArtifacts@1 |
67 | | - displayName: 'Publish unsigned artifacts' |
68 | | - inputs: |
69 | | - pathToPublish: '$(Build.SourcesDirectory)/output' |
70 | | - artifactName: 'nuget' |
71 | | - |
72 | | - - job: build_windows |
73 | | - displayName: 'Build Libraries & NuGets (Windows)' |
74 | | - timeoutInMinutes: 360 |
75 | | - pool: |
76 | | - vmImage: vs2017-win2016 |
77 | | - steps: |
78 | | - # install dotnet and tools |
79 | | - - bash: echo '##vso[task.setvariable variable=PATH;]'$PATH:$HOME/.dotnet/tools |
80 | | - displayName: 'Add ~/.dotnet/tools to the PATH environment variable' |
81 | | - condition: eq(variables['System.JobName'], 'macos') |
82 | | - - task: UseDotNet@2 |
83 | | - displayName: 'Use the correct version of the .NET Core SDK' |
84 | | - inputs: |
85 | | - version: $(DOTNET_CORE_VERSION) |
86 | | - # Install necessary tools |
87 | | - - powershell: | |
88 | | - dotnet tool install -g xamarin.androidbinderator.tool --version $(BINDERATOR_VERSION) |
89 | | - displayName: 'Install dotnet tools' |
90 | | - # Build the libraries and packages |
91 | | - - powershell: .\build.ps1 --target=ci --settings_skipverification=true --verbosity=$(VERBOSITY) |
92 | | - displayName: 'Build everything' |
93 | | - # Publish the artifacts |
94 | | - - task: PublishBuildArtifacts@1 |
95 | | - displayName: 'Publish Windows artifacts' |
96 | | - inputs: |
97 | | - pathToPublish: '$(Build.SourcesDirectory)/output' |
98 | | - artifactName: 'windows_output' |
99 | | - # Run some internal auditing |
100 | | - - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: |
101 | | - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
102 | | - condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
103 | | - displayName: Component Detection - Log |
104 | | - inputs: |
105 | | - scanType: LogOnly |
106 | | - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
107 | | - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') |
108 | | - displayName: Component Detection - Report |
109 | | - - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1 |
110 | | - condition: eq(variables['System.TeamProject'], 'devdiv') |
111 | | - displayName: 'PoliCheck' |
112 | | - inputs: |
113 | | - targetType: F |
114 | | - |
115 | | - # only sign the packages when running on Windows, and using the private server which has the certificates |
| 21 | + - template: .ci/build.yml@components |
| 22 | + parameters: |
| 23 | + cakeExtraArgs: '--settings_skipverification=true --nuget_useinprocessclient=false' |
| 24 | + tools: |
| 25 | + - 'xamarin.androidbinderator.tool': '0.4.0' |
| 26 | + - 'xamarin.androidx.migration.tool': '1.0.0-preview03' |
| 27 | + postBuildSteps: |
| 28 | + - script: | |
| 29 | + # Make a temp folder to move the created nugets to before we fat package them |
| 30 | + mkdir -p $(Build.SourcesDirectory)/tmp/nuget |
| 31 | + mkdir -p $(Build.SourcesDirectory)/tmp/output |
| 32 | + # Move all of the nupkg files from output into the temp folder we just created |
| 33 | + mv $(Build.SourcesDirectory)/output/*.nupkg $(Build.SourcesDirectory)/tmp/nuget |
| 34 | + # Move the remaining output bits to a temp location so they don't get overwritten |
| 35 | + mv $(Build.SourcesDirectory)/output/* $(Build.SourcesDirectory)/tmp/output |
| 36 | + sh build.sh --script nuget.cake \ |
| 37 | + --localSource=$(Build.SourcesDirectory)/tmp/nuget \ |
| 38 | + --packagesPath=$(Build.SourcesDirectory)/tmp/pkgs \ |
| 39 | + --workingPath=$(Build.SourcesDirectory)/tmp/working \ |
| 40 | + --outputPath=$(Build.SourcesDirectory)/output \ |
| 41 | + --incrementVersion=False \ |
| 42 | + --packLatestOnly=True \ |
| 43 | + --useExplicitVersion=True |
| 44 | + # Move the other output bits back to the original output folder |
| 45 | + mv $(Build.SourcesDirectory)/tmp/output/* $(Build.SourcesDirectory)/output |
| 46 | + displayName: 'NuGet FAT' |
| 47 | + enabled: false |
| 48 | + # Run some internal auditing on Windows |
| 49 | + - ${{ if and(eq(variables['System.TeamProject'], 'devdiv'), eq(variables['System.JobName'], 'windows')) }}: |
| 50 | + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 51 | + condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
| 52 | + displayName: Component Detection - Log |
| 53 | + inputs: |
| 54 | + scanType: LogOnly |
| 55 | + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 56 | + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') |
| 57 | + displayName: Component Detection - Report |
| 58 | + - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1 |
| 59 | + condition: eq(variables['System.TeamProject'], 'devdiv') |
| 60 | + displayName: 'PoliCheck' |
| 61 | + inputs: |
| 62 | + targetType: F |
116 | 63 | - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: |
117 | | - - job: signing |
118 | | - displayName: Signing NuGets |
119 | | - dependsOn: build |
120 | | - pool: |
121 | | - name: VSEng-XamarinCustom |
122 | | - demands: |
123 | | - - corpnet |
124 | | - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'],'refs/tags/')) |
125 | | - steps: |
126 | | - # don't checkout code and sign the packages |
127 | | - - checkout: none |
128 | | - - template: sign-artifacts.yml@xamarin-templates |
129 | | - parameters: |
130 | | - targetFolder: '$(Build.ArtifactStagingDirectory)/signed' |
131 | | - # publish the signed packages |
132 | | - - task: PublishBuildArtifacts@1 |
133 | | - displayName: 'Publish Signed NuGets' |
134 | | - inputs: |
135 | | - artifactName: nuget-signed |
136 | | - pathToPublish: '$(Build.ArtifactStagingDirectory)/signed' |
| 64 | + - template: sign-artifacts/jobs/v1.yml@internal-templates |
| 65 | + parameters: |
| 66 | + dependsOn: [ 'build' ] |
0 commit comments