|
| 1 | + |
| 2 | +variables: |
| 3 | + MONO_VERSION: 5_16_0 |
| 4 | + XCODE_VERSION: 10.1 |
| 5 | + VERBOSITY: minimal |
| 6 | + |
| 7 | +resources: |
| 8 | + repositories: |
| 9 | + - repository: xamarin-templates |
| 10 | + type: github |
| 11 | + name: xamarin/yaml-templates |
| 12 | + endpoint: xamarin |
| 13 | + |
| 14 | +jobs: |
| 15 | + |
| 16 | + - job: build |
| 17 | + displayName: 'Build Libraries & NuGets (macOS)' |
| 18 | + pool: |
| 19 | + vmImage: macos-10.13 |
| 20 | + steps: |
| 21 | + # Make sure to select the correct Xamarin and mono |
| 22 | + - bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION) |
| 23 | + displayName: 'Switch to the latest Xamarin SDK' |
| 24 | + - 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 |
| 25 | + displayName: 'Switch to the latest Xcode' |
| 26 | + # Build the libraries and packages |
| 27 | + - bash: sh build.sh --target=ci --settings_skipverification=true --verbosity=$(VERBOSITY) |
| 28 | + displayName: 'Build NuGets' |
| 29 | + - script: | |
| 30 | + # Make a temp folder to move the created nugets to before we fat package them |
| 31 | + mkdir -p $(Build.SourcesDirectory)/tmp/nuget |
| 32 | + mkdir -p $(Build.SourcesDirectory)/tmp/output |
| 33 | + # Move all of the nupkg files from output into the temp folder we just created |
| 34 | + mv $(Build.SourcesDirectory)/output/*.nupkg $(Build.SourcesDirectory)/tmp/nuget |
| 35 | + # Move the remaining output bits to a temp location so they don't get overwritten |
| 36 | + mv $(Build.SourcesDirectory)/output/* $(Build.SourcesDirectory)/tmp/output |
| 37 | + sh build.sh --script nuget.cake \ |
| 38 | + --localSource=$(Build.SourcesDirectory)/tmp/nuget \ |
| 39 | + --packagesPath=$(Build.SourcesDirectory)/tmp/pkgs \ |
| 40 | + --workingPath=$(Build.SourcesDirectory)/tmp/working \ |
| 41 | + --outputPath=$(Build.SourcesDirectory)/output \ |
| 42 | + --incrementVersion=False \ |
| 43 | + --packLatestOnly=True \ |
| 44 | + --useExplicitVersion=True |
| 45 | + # Move the other output bits back to the original output folder |
| 46 | + mv $(Build.SourcesDirectory)/tmp/output/* $(Build.SourcesDirectory)/output |
| 47 | + displayName: 'NuGet FAT' |
| 48 | + enabled: false |
| 49 | + # Publish the artifacts |
| 50 | + - task: PublishBuildArtifacts@1 |
| 51 | + displayName: 'Publish unsigned artifacts' |
| 52 | + inputs: |
| 53 | + pathToPublish: '$(Build.SourcesDirectory)/output' |
| 54 | + artifactName: 'nuget' |
| 55 | + |
| 56 | + - job: build_windows |
| 57 | + displayName: 'Build Libraries & NuGets (Windows)' |
| 58 | + pool: |
| 59 | + vmImage: vs2017-win2016 |
| 60 | + steps: |
| 61 | + # Build the libraries and packages |
| 62 | + - powershell: .\build.ps1 --target=ci --settings_skipverification=true --verbosity=$(VERBOSITY) |
| 63 | + displayName: 'Build everything' |
| 64 | + # Publish the artifacts |
| 65 | + - task: PublishBuildArtifacts@1 |
| 66 | + displayName: 'Publish Windows artifacts' |
| 67 | + inputs: |
| 68 | + pathToPublish: '$(Build.SourcesDirectory)/output' |
| 69 | + artifactName: 'windows_output' |
| 70 | + # Run some internal auditing |
| 71 | + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: |
| 72 | + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 73 | + condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
| 74 | + displayName: Component Detection - Log |
| 75 | + inputs: |
| 76 | + scanType: LogOnly |
| 77 | + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 78 | + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') |
| 79 | + displayName: Component Detection - Report |
| 80 | + - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1 |
| 81 | + condition: eq(variables['System.TeamProject'], 'devdiv') |
| 82 | + displayName: 'PoliCheck' |
| 83 | + inputs: |
| 84 | + targetType: F |
| 85 | + |
| 86 | + # only sign the packages when running on Windows, and using the private server which has the certificates |
| 87 | + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: |
| 88 | + - job: signing |
| 89 | + displayName: Signing NuGets |
| 90 | + dependsOn: build |
| 91 | + pool: |
| 92 | + name: VSEng-XamarinCustom |
| 93 | + demands: |
| 94 | + - corpnet |
| 95 | + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'],'refs/tags/')) |
| 96 | + steps: |
| 97 | + # don't checkout code and sign the packages |
| 98 | + - checkout: none |
| 99 | + - template: sign-artifacts.yml@xamarin-templates |
| 100 | + parameters: |
| 101 | + targetFolder: '$(Build.ArtifactStagingDirectory)/signed' |
| 102 | + # publish the signed packages |
| 103 | + - task: PublishBuildArtifacts@1 |
| 104 | + displayName: 'Publish Signed NuGets' |
| 105 | + inputs: |
| 106 | + artifactName: nuget-signed |
| 107 | + pathToPublish: '$(Build.ArtifactStagingDirectory)/signed' |
0 commit comments