diff --git a/.vsts-dnup-ci.yml b/.vsts-dnup-ci.yml index f0523037a8d6..6af482154a3c 100644 --- a/.vsts-dnup-ci.yml +++ b/.vsts-dnup-ci.yml @@ -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 @@ -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: @@ -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) diff --git a/.vsts-dnup-pr.yml b/.vsts-dnup-pr.yml index 7b58f5f735c0..be58e8dfa3a2 100644 --- a/.vsts-dnup-pr.yml +++ b/.vsts-dnup-pr.yml @@ -6,6 +6,7 @@ pr: branches: include: - dnup + - release/dnup paths: include: - src/Installer/dnup/ @@ -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) @@ -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) @@ -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 @@ -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 diff --git a/.vsts-pr.yml b/.vsts-pr.yml index a0ce56e66843..6ac53bd7ebb9 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -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 diff --git a/eng/pipelines/templates/jobs/dnup-library-package.yml b/eng/pipelines/templates/jobs/dnup-library-package.yml deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/eng/pipelines/templates/jobs/dnup/dnup-library-package.yml b/eng/pipelines/templates/jobs/dnup/dnup-library-package.yml new file mode 100644 index 000000000000..d061b4613dbf --- /dev/null +++ b/eng/pipelines/templates/jobs/dnup/dnup-library-package.yml @@ -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 diff --git a/eng/pipelines/templates/jobs/dnup-tests.yml b/eng/pipelines/templates/jobs/dnup/dnup-tests.yml similarity index 93% rename from eng/pipelines/templates/jobs/dnup-tests.yml rename to eng/pipelines/templates/jobs/dnup/dnup-tests.yml index 0477def2d581..4b670eac75cb 100644 --- a/eng/pipelines/templates/jobs/dnup-tests.yml +++ b/eng/pipelines/templates/jobs/dnup/dnup-tests.yml @@ -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') }}: @@ -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