Skip to content

Change official build to use 1ES templates #7048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try compliant replacement for PublishBuildArtifacts
  • Loading branch information
Jo Shields committed Mar 1, 2024
commit c9f0d7934ab6b38efcb55293220a5b12a902af2a
120 changes: 48 additions & 72 deletions build/vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,17 @@ extends:
image: 1es-ubuntu-2204-pt
os: linux
container: CentosContainer
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Only build native assets to avoid conflicts.
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=x64 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish Linux package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

################################################################################
- job: Linux_arm
################################################################################
Expand All @@ -80,20 +77,17 @@ extends:
image: 1es-ubuntu-2204-pt
os: linux
container: UbuntuCrossArmContainer
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Only build native assets to avoid conflicts.
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=arm /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish Linux_arm package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

################################################################################
- job: Linux_arm64
################################################################################
Expand All @@ -104,50 +98,50 @@ extends:
image: 1es-ubuntu-2204-pt
os: linux
container: UbuntuCrossArm64Container
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Only build native assets to avoid conflicts.
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=arm64 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish Linux_arm64 package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

################################################################################
- job: MacOS
################################################################################
pool:
name: Azure Pipelines
vmImage: macOS-12
os: macOS
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
- script: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 && rm '/usr/local/bin/2to3-3.11' && brew unlink libomp && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula
displayName: Install build dependencies
# Only build native assets to avoid conflicts.
- script: ./build.sh -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=x64 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish macOS package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

################################################################################
- job: MacOS_Apple_Silicon
################################################################################
pool:
name: Azure Pipelines
vmImage: macOS-12
os: macOS
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Work around MacOS Homebrew image/environment bug: https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076
- script: |
Expand All @@ -160,36 +154,24 @@ extends:
- script: ./build.sh -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=arm64 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish macOS_M1 package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

################################################################################
- job: Windows_arm64
################################################################################
pool:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022-pt
os: windows
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Only build native assets to avoid conflicts.
- script: ./build.cmd -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=arm64 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish Windows_arm64 package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

# Terminate all dotnet build processes.
- script: $(Build.SourcesDirectory)/.dotnet/dotnet.exe build-server shutdown
displayName: Dotnet Server Shutdown
Expand All @@ -203,20 +185,17 @@ extends:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022-pt
os: windows
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:
# Only build native assets to avoid conflicts.
- script: ./build.cmd -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=x86 /p:CopyPackageAssets=true
displayName: Build Native Assets

- task: PublishBuildArtifacts@1
displayName: Publish Windows_x86 package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

# Terminate all dotnet build processes.
- script: $(Build.SourcesDirectory)/.dotnet/dotnet.exe build-server shutdown
displayName: Dotnet Server Shutdown
Expand All @@ -231,6 +210,12 @@ extends:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022-pt
os: windows
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container
steps:

# Build both native and managed assets.
Expand All @@ -243,15 +228,6 @@ extends:
verbosity: 'Verbose'
alertWarningLevel: 'High'

- task: PublishBuildArtifacts@1
displayName: Publish Windows_x64 package assets
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
artifactName: pkgassets
artifactType: container

- template: /eng/common/templates/steps/generate-sbom.yml@self

# Terminate all dotnet build processes.
- script: $(Build.SourcesDirectory)/.dotnet/dotnet.exe build-server shutdown
displayName: Dotnet Server Shutdown
Expand Down