parameters: buildConfig: '' archType: '' osGroup: '' osGroupName: '' containerName: '' crossrootfsDir: '' ### Product build jobs: - template: xplat-job.yml parameters: buildConfig: ${{ parameters.buildConfig }} archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osGroupName: ${{ parameters.osGroupName }} # Compute job name from template parameters name: ${{ format('build_{0}_{1}_{2}', parameters.osGroupName, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Build {0} {1} {2}', parameters.osGroupName, parameters.archType, parameters.buildConfig) }} # Run all steps in the container. # Note that the containers are resources defined in azure-pipelines.yml containerName: ${{ parameters.containerName }} crossrootfsDir: ${{ parameters.crossrootfsDir }} steps: # Install native dependencies # # This is only required for non-docker builds. - ${{ if eq(parameters.osGroup, 'OSX') }}: - script: sh eng/install-native-dependencies.sh $(osGroup) displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python - script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force displayName: Install native dependencies # Build - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - script: ./build.sh $(buildConfig) $(archType) $(crossArg) -skiptests displayName: Build product - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # TODO: IBCOptimize? EnforcePGO? pass an OfficialBuildId? SignType? file logging parameters? - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests displayName: Build product # Upload build as pipeline artifact - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - task: PublishPipelineArtifact@0 displayName: Save product build as pipeline artifact inputs: artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osGroupName, parameters.archType, parameters.buildConfig) }} targetPath: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper) - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - task: PublishPipelineArtifact@0 displayName: Save product build as pipeline artifact inputs: artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osGroup, parameters.archType, parameters.buildConfig) }} targetPath: $(Build.SourcesDirectory)\bin\Product\Windows_NT.$(archType).$(buildConfigUpper) # TODO: Sign - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - script: echo Sign! displayName: Sign Binaries (empty for now) # Get key vault secrets for publishing - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: AzureKeyVault@1 inputs: azureSubscription: 'DotNet-Engineering-Services_KeyVault' KeyVaultName: EngKeyVault SecretsFilter: 'dotnetfeed-storage-access-key-1,microsoft-symbol-server-pat,symweb-symbol-server-pat' # TODO: Build packages and publish official build #- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: # ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}: # # TODO: ensure that NUGET_PACKAGES path is correctly set # - script: .dotnet/dotnet msbuild src/restorearcadepublishtasks.proj /t:Restore # displayName: Restore tasks used to publish the build # - script: .dotnet/dotnet msbuild src/publishwitharcade.proj /t:PublishPackages /p:AzureFeedUrl=$(AzureFeedUrl) /p:AccountKey=$(AccountKey) # displayName: Publish official build # ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # # TODO: pass publish feed url and access token in from the internal pipeline # - script: .dotnet\dotnet.exe msbuild src\restorearcadepublishtasks.proj /t:Restore # displayName: Restore tasks used to publish the build # - script: .dotnet\dotnet.exe msbuild src\publishwitharcade.proj /t:PublishPackages /p:AzureFeedUrl=$(AzureFeedUrl) /p:AccountKey=$(AccountKey) # Kill tasks that hold onto files on Windows. Otherwise git clean # may fail for later jobs on the same agent. - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - script: eng/kill_tasks.cmd displayName: Kill tasks that hold on to files condition: always()