|
| 1 | +parameters: |
| 2 | + buildConfig: '' |
| 3 | + archType: '' |
| 4 | + osGroup: '' |
| 5 | + |
| 6 | +### Product build |
| 7 | +jobs: |
| 8 | +- template: xplat-job.yml |
| 9 | + parameters: |
| 10 | + buildConfig: ${{ parameters.buildConfig }} |
| 11 | + archType: ${{ parameters.archType }} |
| 12 | + osGroup: ${{ parameters.osGroup }} |
| 13 | + |
| 14 | + # Compute job name from template parameters |
| 15 | + name: ${{ format('build_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }} |
| 16 | + displayName: ${{ format('Build {0} {1} {2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }} |
| 17 | + |
| 18 | + steps: |
| 19 | + |
| 20 | + # Install native dependencies |
| 21 | + - ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 22 | + - script: sh eng/install-native-dependencies.sh $(osGroup) |
| 23 | + displayName: Install native dependencies |
| 24 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 25 | + # Necessary to install python |
| 26 | + - script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force |
| 27 | + displayName: Install native dependencies |
| 28 | + |
| 29 | + |
| 30 | + # Run init-tools (pre-arcade dependency bootstrapping) |
| 31 | + # TODO: replace this with an arcade equivalent |
| 32 | + - ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 33 | + - script: ./init-tools.sh |
| 34 | + displayName: Init tools |
| 35 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 36 | + - script: .\init-tools.cmd |
| 37 | + displayName: Init tools |
| 38 | + |
| 39 | + |
| 40 | + # Sync |
| 41 | + - ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 42 | + - script: ./Tools/dotnetcli/dotnet msbuild build.proj /p:RestoreDuringBuild=true /t:Sync |
| 43 | + displayName: Sync |
| 44 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 45 | + - script: .\Tools\dotnetcli\dotnet.exe msbuild build.proj /p:RestoreDuringBuild=true /t:Sync |
| 46 | + displayName: Sync |
| 47 | + |
| 48 | + |
| 49 | + # Build |
| 50 | + - ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 51 | + - script: ./build.sh $(buildConfig) $(archType) -skipnuget -skiprestore |
| 52 | + displayName: Build product |
| 53 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 54 | + # TODO: IBCOptimize? EnforcePGO? pass an OfficialBuildId? SignType? file logging parameters? |
| 55 | + - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests -skipbuildpackages -skiprestore |
| 56 | + displayName: Build product |
| 57 | + |
| 58 | + |
| 59 | + # Upload build as pipeline artifact |
| 60 | + - ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 61 | + - task: PublishPipelineArtifact@0 |
| 62 | + displayName: Save product build as pipeline artifact |
| 63 | + inputs: |
| 64 | + artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osGroup, parameters.archType, parameters.buildConfig) }} |
| 65 | + targetPath: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper) |
| 66 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 67 | + - task: PublishPipelineArtifact@0 |
| 68 | + displayName: Save product build as pipeline artifact |
| 69 | + inputs: |
| 70 | + artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osGroup, parameters.archType, parameters.buildConfig) }} |
| 71 | + targetPath: $(Build.SourcesDirectory)\bin\Product\Windows_NT.$(archType).$(buildConfigUpper) |
| 72 | + |
| 73 | + |
| 74 | + # TODO: Sign |
| 75 | + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
| 76 | + - script: echo Sign! |
| 77 | + displayName: Sign Binaries (empty for now) |
| 78 | + |
| 79 | + |
| 80 | + # Get key vault secrets for publishing |
| 81 | + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
| 82 | + - task: AzureKeyVault@1 |
| 83 | + inputs: |
| 84 | + azureSubscription: 'DotNet-Engineering-Services_KeyVault' |
| 85 | + KeyVaultName: EngKeyVault |
| 86 | + SecretsFilter: 'dotnetfeed-storage-access-key-1,microsoft-symbol-server-pat,symweb-symbol-server-pat' |
| 87 | + |
| 88 | + |
| 89 | + # TODO: Build packages and publish official build |
| 90 | + #- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
| 91 | + # ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: |
| 92 | + # # TODO: ensure that NUGET_PACKAGES path is correctly set |
| 93 | + # - script: .dotnet/dotnet msbuild src/restorearcadepublishtasks.proj /t:Restore |
| 94 | + # displayName: Restore tasks used to publish the build |
| 95 | + # - script: .dotnet/dotnet msbuild src/publishwitharcade.proj /t:PublishPackages /p:AzureFeedUrl=$(AzureFeedUrl) /p:AccountKey=$(AccountKey) |
| 96 | + # displayName: Publish official build |
| 97 | + # ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 98 | + # # TODO: pass publish feed url and access token in from the internal pipeline |
| 99 | + # - script: .dotnet\dotnet.exe msbuild src\restorearcadepublishtasks.proj /t:Restore |
| 100 | + # displayName: Restore tasks used to publish the build |
| 101 | + # - script: .dotnet\dotnet.exe msbuild src\publishwitharcade.proj /t:PublishPackages /p:AzureFeedUrl=$(AzureFeedUrl) /p:AccountKey=$(AccountKey) |
| 102 | + |
| 103 | + # Kill tasks that hold onto files on Windows. Otherwise git clean |
| 104 | + # may fail for later jobs on the same agent. |
| 105 | + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: |
| 106 | + - script: eng/kill_tasks.cmd |
| 107 | + displayName: Kill tasks that hold on to files |
| 108 | + condition: always() |
0 commit comments