summaryrefslogtreecommitdiff
path: root/eng/build-job.yml
diff options
context:
space:
mode:
authorSven Boemer <sbomer@gmail.com>2018-12-14 17:03:40 -0800
committerGitHub <noreply@github.com>2018-12-14 17:03:40 -0800
commit483135b05e853290d6890f9f5f72aa0bb96aca23 (patch)
tree173e74d54e25364c317ed894729dbf62665e041a /eng/build-job.yml
parent1df63bdbce55f2feb60238c244c6723dd9530e82 (diff)
downloadcoreclr-483135b05e853290d6890f9f5f72aa0bb96aca23.tar.gz
coreclr-483135b05e853290d6890f9f5f72aa0bb96aca23.tar.bz2
coreclr-483135b05e853290d6890f9f5f72aa0bb96aca23.zip
Publish packages in Azure DevOps official build (#21536)
This enables coreclr participation in dependency flow.
Diffstat (limited to 'eng/build-job.yml')
-rw-r--r--eng/build-job.yml81
1 files changed, 57 insertions, 24 deletions
diff --git a/eng/build-job.yml b/eng/build-job.yml
index 98710b42aa..d8a5f61102 100644
--- a/eng/build-job.yml
+++ b/eng/build-job.yml
@@ -2,7 +2,7 @@ parameters:
buildConfig: ''
archType: ''
osGroup: ''
- osGroupName: ''
+ osIdentifier: ''
containerName: ''
crossrootfsDir: ''
@@ -13,17 +13,39 @@ jobs:
buildConfig: ${{ parameters.buildConfig }}
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
- osGroupName: ${{ parameters.osGroupName }}
+ osIdentifier: ${{ parameters.osIdentifier }}
# 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) }}
+ name: ${{ format('build_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
+ displayName: ${{ format('Build {0} {1} {2}', parameters.osIdentifier, 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 }}
+ gatherAssetManifests: true
+ variables:
+ - name: osIdentifier
+ value: ${{ parameters.osIdentifier }}
+ - name: portableBuildArg
+ value: ''
+ # Ensure that we produce os-specific packages for the following distros:
+ - ${{ if in(parameters.osIdentifier, 'Linux_rhel6', 'Linux_rhel7', 'Linux_musl') }}:
+ - name: portableBuildArg
+ value: '-portablebuild=false'
+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ # Variables used to publish packages to blob feed
+ - name: dotnetfeedUrl
+ value: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
+ - name: dotnetfeedPAT
+ value: $(dotnetfeed-storage-access-key-1)
+ # Variables used by arcade to gather asset manifests
+ - name: _DotNetPublishToBlobFeed
+ value: true
+ - name: _BuildConfig
+ value: $(buildConfigUpper)
+
steps:
# Install native dependencies
@@ -39,11 +61,11 @@ jobs:
# Build
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- - script: ./build.sh $(buildConfig) $(archType) $(crossArg) -skiptests
+ - script: ./build.sh $(buildConfig) $(archType) $(crossArg) -skiptests -skipnuget
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
+ - script: set __TestIntermediateDir=int&&build.cmd $(buildConfig) $(archType) -skiptests -skipbuildpackages
displayName: Build product
@@ -52,24 +74,24 @@ jobs:
- task: PublishPipelineArtifact@0
displayName: Save product build as pipeline artifact
inputs:
- artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osGroupName, parameters.archType, parameters.buildConfig) }}
+ artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, 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)
+ artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
+ targetPath: $(Build.SourcesDirectory)\bin\Product\$(osGroup).$(archType).$(buildConfigUpper)
# TODO: Sign
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(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')) }}:
+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- task: AzureKeyVault@1
inputs:
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
@@ -77,19 +99,30 @@ jobs:
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)
+ # Build packages and publish official build
+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - script: ./build-packages.sh -BuildArch=$(archType) -BuildType=$(buildConfigUpper) $(crossPackagesArg) -OfficialBuildId=$(Build.BuildNumber) $(portableBuildArg)
+ displayName: Build packages
+ - script: ./eng/common/build.sh /p:DotNetPublishToBlobFeed=true --ci --restore
+ displayName: Restore blob feed tasks
+ - script: ./eng/common/msbuild.sh --ci src/publishwitharcade.proj /p:__BuildType=$(buildConfigUpper) /p:__BuildArch=$(archType) /p:OSIdentifier=$(osIdentifier) /p:AzureFeedUrl=$(dotnetfeedUrl) /p:AzureAccountKey=$(dotnetfeedPAT)
+ displayName: Publish packages to blob feed
+ env:
+ # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed
+ NUGET_PACKAGES: $(Build.SourcesDirectory)/.packages
+ - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ # TODO: pass publish feed url and access token in from the internal pipeline
+ - script: build-packages.cmd -BuildArch=$(archType) -BuildType=$(buildConfigUpper) -OfficialBuildId=$(Build.BuildNumber)
+ displayName: Build packages
+ - powershell: eng\common\build.ps1 /p:DotNetPublishToBlobFeed=true -ci -restore
+ displayName: Restore blob feed tasks
+ - powershell: eng\common\msbuild.ps1 -ci src\publishwitharcade.proj /p:__BuildType=$(buildConfigUpper) /p:__BuildArch=$(archType) /p:OSIdentifier=$(osIdentifier) /p:AzureFeedUrl=$(dotnetfeedUrl) /p:AzureAccountKey=$(dotnetfeedPAT)
+ displayName: Publish packages to blob feed
+ env:
+ # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed
+ NUGET_PACKAGES: $(Build.SourcesDirectory)\.packages
+
# Kill tasks that hold onto files on Windows. Otherwise git clean
# may fail for later jobs on the same agent.