Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
82 changes: 44 additions & 38 deletions .vsts-dnup-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pipeline: https://dev.azure.com/dnceng/internal/_build?definitionId=
# Pipeline: https://dev.azure.com/dnceng/internal/_build?definitionId=1544

trigger:
batch: true
Expand Down Expand Up @@ -44,11 +44,17 @@ variables:
value: -publish
- name: _signArgument
value: -sign /p:SignCoreSdk=true
- name: _TeamName
value: DotNet-Cli
- name: _BuildConfig
value: Release
- name: _officialBuildProperties
# The OfficialBuilder property is set to Microsoft for the official build only.
# This property is checked in Directory.Build.props and adds the MICROSOFT_ENABLE_TELEMETRY constant.
# This constant is used in CompileOptions.cs to set both TelemetryOptOutDefault and TelemetryOptOutDefaultString.
value: /p:DotNetPublishUsingPipelines=true /p:OfficialBuilder=Microsoft /p:OfficialBuildId=$(Build.BuildNumber)
- name: _SignType
value: real

resources:
repositories:
Expand Down Expand Up @@ -84,45 +90,45 @@ extends:
ignoreDirectories: artifacts, .packages

stages:
############### BUILD STAGE ###############
############### WINDOWS ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
parameters:
pool:
name: $($(DncEngInternalBuildPool))
image: windows.vs2022.amd64
os: windows
emoji: 🪟
helixTargetQueue: windows.amd64.vs2022.pre
oneESCompat:
templateFolderName: templates-official
publishTaskPrefix: 1ES.
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
preSteps:
- powershell: New-Item -ItemType Directory -Path $(Build.SourcesDirectory)/artifacts/bin -Force
displayName: Create artifacts/bin directory
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
timeoutInMinutes: 180
windowsJobParameterSets:
### OFFICIAL ###
- categoryName: Official
publishArgument: $(_publishArgument)
signArgument: $(_signArgument)
officialBuildProperties: $(_officialBuildProperties) /p:BuildWorkloads=true
enableDefaultArtifacts: true
runTests: false
publishRetryConfig: true
variables:
_SignType: real

############### PACKAGE STAGE ###############
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- stage: publish
displayName: Publish
- stage: tests
displayName: 🧪 dnup tests
jobs:
### Windows ###
- template: /eng/pipelines/templates/jobs/dnup/dnup-tests.yml@self
parameters:
pool:
name: $(DncEngInternalBuildPool)
image: windows.vs2022.amd64
os: windows
emoji: 🪟
helixTargetQueue: windows.amd64.vs2022.pre
oneESCompat:
templateFolderName: templates-official
publishTaskPrefix: 1ES.
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
preSteps:
- powershell: New-Item -ItemType Directory -Path $(Build.SourcesDirectory)/artifacts/bin -Force
displayName: Create artifacts/bin directory
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
timeoutInMinutes: 180
windowsJobParameterSets:
### OFFICIAL ###
- categoryName: Official
publishArgument: $(_publishArgument)
signArgument: $(_signArgument)
officialBuildProperties: $(_officialBuildProperties) /p:BuildWorkloads=true
enableDefaultArtifacts: true
runTests: false
publishRetryConfig: true
variables:
_SignType: real
### Packaging ###
- stage: package
displayName: 📦 Package dnup
dependsOn: []
jobs:
- template: /eng/pipelines/templates/jobs/dnup-library-package.yml@self
- template: /eng/pipelines/templates/jobs/dnup/dnup-library-package.yml@self
parameters:
pool:
name: $(DncEngInternalBuildPool)
Expand Down
9 changes: 5 additions & 4 deletions .vsts-dnup-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pr:
branches:
include:
- dnup
- release/dnup
paths:
include:
- src/Installer/dnup/
Expand All @@ -29,7 +30,7 @@ stages:
displayName: 🏰 dnup tests
jobs:
############### WINDOWS ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
- template: /eng/pipelines/templates/jobs/dnup/dnup-tests.yml@self
parameters:
pool:
name: $(DncEngPublicBuildPool)
Expand All @@ -39,7 +40,7 @@ stages:
helixTargetQueue: windows.amd64.vs2022.pre.open

############### LINUX ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
- template: /eng/pipelines/templates/jobs/dnup/dnup-tests.yml@self
parameters:
pool:
name: $(DncEngPublicBuildPool)
Expand All @@ -49,7 +50,7 @@ stages:
helixTargetQueue: ubuntu.2204.amd64.open

############### MACOS ###############
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
- template: /eng/pipelines/templates/jobs/dnup/dnup-tests.yml@self
parameters:
pool:
name: Azure Pipelines
Expand All @@ -60,7 +61,7 @@ stages:

### ARM64 ###
- ${{ if eq(parameters.enableArm64Job, true) }}:
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
- template: /eng/pipelines/templates/jobs/dnup/dnup-tests.yml@self
parameters:
pool:
name: Azure Pipelines
Expand Down
5 changes: 5 additions & 0 deletions .vsts-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ pr:
- documentation/*
- README.md
- CODEOWNERS
- .vsts-dnup-ci.yml
- .vsts-dnup-pr.yml
- /eng/pipelines/templates/jobs/dnup/*
- src/Installer/*
- test/dnup.Tests/*

parameters:
- name: enableArm64Job
Expand Down
Empty file.
58 changes: 58 additions & 0 deletions eng/pipelines/templates/jobs/dnup/dnup-library-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
parameters:
### GENERAL ###
variables: {}
dependsOn: ''
helixTargetQueue: ''
oneESCompat:
templateFolderName: templates
publishTaskPrefix: ''
container: ''
helixTargetContainer: ''
categoryName: dnup
runTests: true
publishRetryConfig: false
publishXunitResults: false
enableSbom: true
timeoutInMinutes: 150

jobs:
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/job/job.yml
parameters:
displayName: '${{ parameters.pool.emoji }} dnup package: ${{ parameters.pool.os }} (${{ parameters.helixTargetQueue }})'
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
strategy: ${{ parameters.strategy }}
helixRepo: dotnet/sdk
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
enableMicrobuild: true
enablePublishBuildAssets: true
enableTelemetry: true
enablePublishUsingPipelines: true
enableSbom: ${{ parameters.enableSbom }}
variables:
- ${{ insert }}: ${{ parameters.variables }}
dependsOn: ${{ parameters.dependsOn }}
preSteps: ${{ parameters.preSteps }}
templateContext:
sdl:
binskim:
analyzeTargetGlob: +:f|eng\**\*.props;+:f|artifacts\bin\**\*.dll;+:f|artifacts\bin\**\*.exe;-:f|artifacts\bin\**\msdia140.dll;-:f|artifacts\bin\**\pgort140.dll;-:f|artifacts\bin\*Tests\**;-:f|**\Microsoft.NET.Runtime.Emscripten**\tools\**;-:f|**\CodeCoverage\**;-:f|artifacts\bin\**\capstone.dll;
outputs:
- output: pipelineArtifact
displayName: '🌐 Publish dnup library packages'
condition: always()
targetPath: '$(Build.SourcesDirectory)/artifacts/packages/Release/NonShipping/'
artifactName: 'dnup-library-packages'
publishLocation: Container

steps:
- ${{ if eq(parameters.pool.os, 'windows') }}:
- powershell: |
& .\restore.cmd
displayName: 🍱 Bootstrap toolset (Windows)
- powershell: |
& .\.dotnet\dotnet build test\dnup.Tests\dnup.Tests.csproj -c Release
displayName: 💻 Build Windows
- powershell: |
& .\.dotnet\dotnet pack .\src\Installer\Microsoft.Dotnet.Installation\Microsoft.Dotnet.Installation.csproj
displayName: 📦 Package dnup library
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
sdl:
binskim:
analyzeTargetGlob: +:f|eng\**\*.props;+:f|artifacts\bin\**\*.dll;+:f|artifacts\bin\**\*.exe;-:f|artifacts\bin\**\msdia140.dll;-:f|artifacts\bin\**\pgort140.dll;-:f|artifacts\bin\*Tests\**;-:f|**\Microsoft.NET.Runtime.Emscripten**\tools\**;-:f|**\CodeCoverage\**;-:f|artifacts\bin\**\capstone.dll;
outputs:
- output: pipelineArtifact
displayName: '🌐 Publish Test Artifacts'
condition: always()
targetPath: '$(Build.SourcesDirectory)/artifacts/dnupTestResults'
artifactName: 'dnupTestResults_${{ parameters.pool.os }}'
publishLocation: Container

steps:
- ${{ if eq(parameters.pool.os, 'windows') }}:
Expand Down Expand Up @@ -79,10 +86,3 @@ jobs:
testResultsFiles: '**/dnup-tests.trx'
searchFolder: $(Build.SourcesDirectory)/artifacts/dnupTestResults
testRunTitle: 'dnup ${{ parameters.pool.os }}'
- task: PublishBuildArtifacts@1
displayName: ⬇️ Publish test artifacts
condition: always()
inputs:
PathtoPublish: $(Build.SourcesDirectory)/artifacts/dnupTestResults
ArtifactName: dnupTestResults_${{ parameters.pool.os }}
publishLocation: Container
Loading