From 320775f85c432ad5f097a1ab4795fda6552d1682 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 15:19:41 -0700 Subject: [PATCH 01/10] Remove CodeQL, CG --- .azure/pipelines/ci.yml | 863 +++++++++++------------- .azure/pipelines/jobs/default-build.yml | 3 - .config/tsaoptions.json | 12 - 3 files changed, 391 insertions(+), 487 deletions(-) delete mode 100644 .config/tsaoptions.json diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index f80b0da9438e..da2da27942fd 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -12,27 +12,6 @@ pr: include: - '*' -schedules: -- cron: 0 9 * * 1 - displayName: "Run CodeQL3000 weekly, Monday at 2:00 AM PDT" - branches: - include: - - release/2.1 - - release/6.0 - - release/7.0 - - main - always: true - -parameters: -# Parameter below is ignored in public builds. -# -# Choose whether to run the CodeQL3000 tasks. -# Manual builds align w/ official builds unless this parameter is true. -- name: runCodeQL3000 - default: false - displayName: Run CodeQL3000 tasks - type: boolean - variables: - name: ASPNETCORE_TEST_LOG_MAXPATH value: "200" # Keep test log file name length low enough for artifact zipping @@ -52,8 +31,6 @@ variables: /t:GeneratePropsFiles /t:BuildSharedFx $(BuildNumberArg)' -- name: runCodeQL3000 - value: ${{ or(eq(variables['Build.Reason'], 'Schedule'), and(eq(variables['Build.Reason'], 'Manual'), eq(parameters.runCodeQL3000, 'true'))) }} - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - name: PB_ISFINALBUILD value: ${{ coalesce(variables.PB_ISFINALBUILD, 'true') }} @@ -61,184 +38,344 @@ variables: value: ${{ coalesce(variables.PB_SignType, 'real') }} jobs: -- ${{ if and(ne(variables['System.TeamProject'], 'public'), eq(variables.runCodeQL3000, 'true')) }}: - - template: jobs/default-build.yml - parameters: - jobName: build - jobDisplayName: Build and run CodeQL3000 - agentOs: Windows - codeSign: false - timeoutInMinutes: 180 +- template: jobs/default-build.yml + parameters: + jobName: Windows_Build + jobDisplayName: "Build and test: Windows" + buildArgs: $(BuildNumberArg) + codeSign: true + beforeBuild: + - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1" + displayName: Setup IISExpress test certificates + # Skip tests by default in internal non-PR builds. + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: variables: - # No need for testing here. - PB_SKIPTESTS: true - # Security analysis is included in normal runs. Disable its auto-injection. - skipNugetSecurityAnalysis: true - # Do not let CodeQL3000 Extension gate scan frequency. - Codeql.Cadence: 0 - # Enable CodeQL3000 unconditionally so it may be run on any branch. - Codeql.Enabled: true - # Ignore the small amount of infrastructure Python code in this repo. - Codeql.Language: cpp,csharp,java,javascript - Codeql.ExcludePathPatterns: submodules - # Ignore test and infrastructure code. - Codeql.SourceRoot: src - # CodeQL3000 needs this plumbed along as a variable to enable TSA. - Codeql.TSAEnabled: ${{ eq(variables['Build.Reason'], 'Schedule') }} - # Default expects tsaoptions.json under SourceRoot. - Codeql.TSAOptionsPath: '$(Build.SourcesDirectory)/.config/tsaoptions.json' - beforeBuild: - - task: CodeQL3000Init@0 - displayName: CodeQL Initialize - - script: "echo ##vso[build.addbuildtag]CodeQL3000" - displayName: 'Set CI CodeQL3000 tag' - condition: ne(variables.CODEQL_DIST,'') - buildArgs: $(BuildNumberArg) /p:UseSharedCompilation=false - afterBuild: - - task: CodeQL3000Finalize@0 - displayName: CodeQL Finalize - artifacts: - - name: Build_Logs - path: artifacts/log/ - publishOnError: true - includeForks: true + PB_SKIPTESTS: ${{ coalesce(variables.PB_SKIPTESTS, 'true') }} -- ${{ else }}: # regular build - - template: jobs/default-build.yml - parameters: - jobName: Windows_Build - jobDisplayName: "Build and test: Windows" - buildArgs: $(BuildNumberArg) - codeSign: true - beforeBuild: - - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1" - displayName: Setup IISExpress test certificates - # Skip tests by default in internal non-PR builds. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - variables: - PB_SKIPTESTS: ${{ coalesce(variables.PB_SKIPTESTS, 'true') }} - - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - job: Windows_SharedFx - displayName: Build Windows x64/x86 SharedFx - dependsOn: Windows_Build - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NodeTool@0 - displayName: Install Node 10.x - inputs: - versionSpec: 10.x - - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' - displayName: Install JDK 11 - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: MicroBuildSigningPlugin@2 - displayName: Install MicroBuild Signing plugin - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - - task: DownloadBuildArtifacts@0 - displayName: Download artifacts - inputs: - artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy artifacts to .deps/ +- ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - job: Windows_SharedFx + displayName: Build Windows x64/x86 SharedFx + dependsOn: Windows_Build + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals 1es-windows-2019 + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NodeTool@0 + displayName: Install Node 10.x + inputs: + versionSpec: 10.x + - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' + displayName: Install JDK 11 + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild Signing plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-Release + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/ + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(SharedFxArgs) + /p:SharedFxRID=win-x64 + /bl:artifacts/logs/SharedFx-win-x64.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build win-x64 SharedFX + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(SharedFxArgs) + /p:SharedFxRID=win-x86 + /bl:artifacts/logs/SharedFx-win-x86.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build win-x86 SharedFX + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(BuildNumberArg) + /p:SkipArtifactInfoTargets=true + /p:DisableSignCheck=true + /t:DoCodeSigning + /bl:artifacts/logs/CodeSign.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Code Sign + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - task: MicroBuildCleanup@1 + displayName: Cleanup MicroBuild tasks + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: PublishBuildArtifacts@1 + displayName: Upload artifacts + condition: always() + continueOnError: true inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/ - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(SharedFxArgs) - /p:SharedFxRID=win-x64 - /bl:artifacts/logs/SharedFx-win-x64.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build win-x64 SharedFX - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes + pathtoPublish: artifacts/ + artifactName: artifacts-Windows-SharedFx + artifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Upload dependencies.g.props condition: always() - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(SharedFxArgs) - /p:SharedFxRID=win-x86 - /bl:artifacts/logs/SharedFx-win-x86.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build win-x86 SharedFX - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes + continueOnError: true + inputs: + pathtoPublish: .deps/dependencies.g.props + artifactName: artifacts-dependencies-props + artifactType: Container + parallel: true + + - job: Windows_Installers + displayName: Build Windows Installers + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals 1es-windows-2019 + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild Signing plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download dependencies.g.props + inputs: + artifactName: artifacts-dependencies-props + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/SharedFX/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/fx/ + - task: CopyFiles@2 + displayName: Copy SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/packages/ + contents: 'Microsoft.AspNetCore.AspNetCoreModule*.nupkg' + targetFolder: $(Build.SourcesDirectory)/.deps/ANCM/ + - task: CopyFiles@2 + displayName: Copy dependencies.g.props to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-dependencies-props/ + contents: 'dependencies.g.props' + targetFolder: $(Build.SourcesDirectory)/.deps/ + - task: UseDotNet@2 + displayName: Use .NET Core SDK 2.1 + inputs: + packageType: sdk + version: 2.1.x + installationPath: $(Agent.TempDirectory)/dotnet + workingDirectory: $(Agent.TempDirectory) + - powershell: src/Installers/Windows/build.ps1 + -Config Release + -BuildNumber $(Build.BuildId) + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Run src/Installers/Windows/build.ps1 + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: PublishBuildArtifacts@1 + displayName: Upload artifacts condition: always() - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(BuildNumberArg) - /p:SkipArtifactInfoTargets=true - /p:DisableSignCheck=true - /t:DoCodeSigning - /bl:artifacts/logs/CodeSign.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Code Sign - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes + continueOnError: true + inputs: + pathtoPublish: artifacts/ + artifactName: artifacts-Windows-Installers + artifactType: Container + parallel: true + + - job: Package_Archive + displayName: Build Package Archive + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals 1es-windows-2019 + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ + - script: .\build.cmd + -ci + $(BuildNumberArg) + /p:SignType=$(_SignType) + /t:BuildFallbackArchive + /bl:artifacts/logs/PackageArchive.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build Package Archive + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: PublishBuildArtifacts@1 + displayName: Upload artifacts condition: always() - - task: MicroBuildCleanup@1 - displayName: Cleanup MicroBuild tasks + continueOnError: true + inputs: + pathtoPublish: artifacts/ + artifactName: artifacts-Package-Archive + artifactType: Container + parallel: true + + - job: SharedFX_Installers + displayName: Build SharedFX Installers + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals 1es-windows-2019 + variables: + LC_ALL: 'en_US.UTF-8' + LANG: 'en_US.UTF-8' + LANGUAGE: 'en_US.UTF-8' + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: DownloadBuildArtifacts@0 + displayName: Download Windows SharedFx artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy Windows SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ + - script: .\build.cmd + -ci + $(BuildNumberArg) + /t:BuildInstallers + /bl:artifacts/logs/SharedFx-Installers.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build SharedFX Installers + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: PublishBuildArtifacts@1 + displayName: Upload artifacts condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Windows-SharedFx - artifactType: Container - parallel: true - - task: PublishBuildArtifacts@1 - displayName: Upload dependencies.g.props - condition: always() - continueOnError: true - inputs: - pathtoPublish: .deps/dependencies.g.props - artifactName: artifacts-dependencies-props - artifactType: Container - parallel: true - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true + continueOnError: true + inputs: + pathtoPublish: artifacts/ + artifactName: artifacts-SharedFx-Installers + artifactType: Container + parallel: true - - job: Windows_Installers - displayName: Build Windows Installers - dependsOn: Windows_SharedFx + # Only run the publish job if this is a prodcon build + - ${{ if variables['ProductBuildId'] }}: + - job: Publish + displayName: Publish + dependsOn: + - Windows_Installers + - SharedFX_Installers + - Package_Archive timeoutInMinutes: 90 workspace: clean: all @@ -257,320 +394,102 @@ jobs: inputs: command: custom arguments: 'locals all -clear' - - task: MicroBuildSigningPlugin@2 - displayName: Install MicroBuild Signing plugin + - task: DownloadBuildArtifacts@0 + displayName: Download Windows artifacts inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + artifactName: artifacts-Windows-Release + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - task: DownloadBuildArtifacts@0 - displayName: Download artifacts + displayName: Download Windows SharedFx artifacts inputs: artifactName: artifacts-Windows-SharedFx downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - task: DownloadBuildArtifacts@0 - displayName: Download dependencies.g.props + displayName: Download Package Archive artifacts inputs: - artifactName: artifacts-dependencies-props + artifactName: artifacts-Package-Archive downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy SharedFx artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/SharedFX/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/fx/ - - task: CopyFiles@2 - displayName: Copy SharedFx artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/packages/ - contents: 'Microsoft.AspNetCore.AspNetCoreModule*.nupkg' - targetFolder: $(Build.SourcesDirectory)/.deps/ANCM/ - - task: CopyFiles@2 - displayName: Copy dependencies.g.props to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-dependencies-props/ - contents: 'dependencies.g.props' - targetFolder: $(Build.SourcesDirectory)/.deps/ - - task: UseDotNet@2 - displayName: Use .NET Core SDK 2.1 - inputs: - packageType: sdk - version: 2.1.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - powershell: src/Installers/Windows/build.ps1 - -Config Release - -BuildNumber $(Build.BuildId) - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Run src/Installers/Windows/build.ps1 - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Windows-Installers - artifactType: Container - parallel: true - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true - - - job: Package_Archive - displayName: Build Package Archive - dependsOn: Windows_SharedFx - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' + - task: DownloadBuildArtifacts@0 + displayName: Download SharedFx installer artifacts inputs: - command: custom - arguments: 'locals all -clear' + artifactName: artifacts-SharedFx-Installers + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - task: DownloadBuildArtifacts@0 - displayName: Download artifacts + displayName: Download Windows installer artifacts inputs: - artifactName: artifacts-Windows-SharedFx + artifactName: artifacts-Windows-Installers downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - task: CopyFiles@2 - displayName: Copy artifacts to .deps/ + displayName: Copy Windows artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/build/ + contents: '**/*.tgz' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy Windows SharedFx artifacts to .deps/assets inputs: sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: | + SharedFx/** + OobArchives/** + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy Package Archive artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Package-Archive/lzma/ contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ - - script: .\build.cmd - -ci - $(BuildNumberArg) - /p:SignType=$(_SignType) - /t:BuildFallbackArchive - /bl:artifacts/logs/PackageArchive.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build Package Archive - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Package-Archive - artifactType: Container - parallel: true - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true - - - job: SharedFX_Installers - displayName: Build SharedFX Installers - dependsOn: Windows_SharedFx - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - LC_ALL: 'en_US.UTF-8' - LANG: 'en_US.UTF-8' - LANGUAGE: 'en_US.UTF-8' - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + - task: CopyFiles@2 + displayName: Copy SharedFx Installer artifacts to .deps/assets inputs: - command: custom - arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 - displayName: Download Windows SharedFx artifacts + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-SharedFx-Installers/installers/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + - task: CopyFiles@2 + displayName: Copy Windows Installer artifacts to .deps/assets inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Installers/bin/Release/installers/ + contents: | + en-US/*.msi + **/*.exe + **/*.wixlib + **/*.nupkg + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/ + displayName: Copy Windows SharedFx artifacts to .deps/packages inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/Packages/ contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ + targetFolder: $(Build.SourcesDirectory)/.deps/packages/ + - task: DeleteFiles@1 + displayName: Delete korebuild.json + inputs: + contents: korebuild.json - script: .\build.cmd -ci $(BuildNumberArg) - /t:BuildInstallers - /bl:artifacts/logs/SharedFx-Installers.binlog + /t:Publish + /p:BuildBranch=$(Build.SourceBranchName) + /bl:artifacts/logs/Publish.binlog env: PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) PB_ASSETROOTURL: $(PB_AssetRootUrl) PB_RESTORESOURCE: $(PB_RestoreSource) PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build SharedFX Installers + displayName: Publish - powershell: eng\scripts\KillProcesses.ps1 displayName: Kill processes condition: always() - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - task: PublishBuildArtifacts@1 - displayName: Upload artifacts + displayName: Upload logs condition: always() continueOnError: true inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-SharedFx-Installers + pathtoPublish: artifacts/logs + artifactName: artifacts-Publish artifactType: Container - parallel: true - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true - - # Only run the publish job if this is a prodcon build - - ${{ if variables['ProductBuildId'] }}: - - job: Publish - displayName: Publish - dependsOn: - - Windows_Installers - - SharedFX_Installers - - Package_Archive - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 - displayName: Download Windows artifacts - inputs: - artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Windows SharedFx artifacts - inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Package Archive artifacts - inputs: - artifactName: artifacts-Package-Archive - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download SharedFx installer artifacts - inputs: - artifactName: artifacts-SharedFx-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Windows installer artifacts - inputs: - artifactName: artifacts-Windows-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy Windows artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/build/ - contents: '**/*.tgz' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ - contents: | - SharedFx/** - OobArchives/** - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Package Archive artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Package-Archive/lzma/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - - task: CopyFiles@2 - displayName: Copy SharedFx Installer artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-SharedFx-Installers/installers/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - - task: CopyFiles@2 - displayName: Copy Windows Installer artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Installers/bin/Release/installers/ - contents: | - en-US/*.msi - **/*.exe - **/*.wixlib - **/*.nupkg - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/packages - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/Packages/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/packages/ - - task: DeleteFiles@1 - displayName: Delete korebuild.json - inputs: - contents: korebuild.json - - script: .\build.cmd - -ci - $(BuildNumberArg) - /t:Publish - /p:BuildBranch=$(Build.SourceBranchName) - /bl:artifacts/logs/Publish.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Publish - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload logs - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/logs - artifactName: artifacts-Publish - artifactType: Container - parallel: true - - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true \ No newline at end of file + parallel: true \ No newline at end of file diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index d1294364f4c4..adaada545da8 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -193,6 +193,3 @@ jobs: - task: MicroBuildCleanup@1 displayName: Cleanup MicroBuild tasks condition: always() - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true diff --git a/.config/tsaoptions.json b/.config/tsaoptions.json deleted file mode 100644 index 1688609163cf..000000000000 --- a/.config/tsaoptions.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "areaPath": "DevDiv\\ASP.NET Core", - "codebaseName": "AspNetCore", - "instanceUrl": "https://devdiv.visualstudio.com/", - "iterationPath": "DevDiv", - "notificationAliases": [ - "aspnetcore-build@microsoft.com" - ], - "projectName": "DEVDIV", - "repositoryName": "AspNetCore", - "template": "TFSDEVDIV" -} From 4a87052b7092e7091f7ab0ed02707f1e60e4f8ad Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 15:28:31 -0700 Subject: [PATCH 02/10] Convert to 1es pipelines --- .azure/pipelines/ci.yml | 925 ++++++++++++------------ .azure/pipelines/jobs/default-build.yml | 19 +- 2 files changed, 470 insertions(+), 474 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index da2da27942fd..d0dbf3e6dc23 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -19,477 +19,476 @@ variables: value: $(Agent.BuildDirectory)/.dotnet - name: TeamName value: AspNetCore -- ${{ if eq(variables['System.TeamProject'], 'public') }}: - - name: BuildNumberArg - value: '' -- ${{ if ne(variables['System.TeamProject'], 'public') }}: - - name: BuildNumberArg - value: '/p:BuildNumber=$(Build.BuildId)' - - name: SharedFxArgs - value: '/t:Prepare - /t:Restore - /t:GeneratePropsFiles - /t:BuildSharedFx - $(BuildNumberArg)' -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: +- name: BuildNumberArg + value: '/p:BuildNumber=$(Build.BuildId)' +- name: SharedFxArgs + value: '/t:Prepare + /t:Restore + /t:GeneratePropsFiles + /t:BuildSharedFx + $(BuildNumberArg)' +- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - name: PB_ISFINALBUILD value: ${{ coalesce(variables.PB_ISFINALBUILD, 'true') }} - name: PB_SignType value: ${{ coalesce(variables.PB_SignType, 'real') }} -jobs: -- template: jobs/default-build.yml +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: - jobName: Windows_Build - jobDisplayName: "Build and test: Windows" - buildArgs: $(BuildNumberArg) - codeSign: true - beforeBuild: - - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1" - displayName: Setup IISExpress test certificates - # Skip tests by default in internal non-PR builds. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - variables: - PB_SKIPTESTS: ${{ coalesce(variables.PB_SKIPTESTS, 'true') }} - -- ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - job: Windows_SharedFx - displayName: Build Windows x64/x86 SharedFx - dependsOn: Windows_Build - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NodeTool@0 - displayName: Install Node 10.x - inputs: - versionSpec: 10.x - - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' - displayName: Install JDK 11 - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: MicroBuildSigningPlugin@2 - displayName: Install MicroBuild Signing plugin - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - - task: DownloadBuildArtifacts@0 - displayName: Download artifacts - inputs: - artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/ - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(SharedFxArgs) - /p:SharedFxRID=win-x64 - /bl:artifacts/logs/SharedFx-win-x64.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build win-x64 SharedFX - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(SharedFxArgs) - /p:SharedFxRID=win-x86 - /bl:artifacts/logs/SharedFx-win-x86.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build win-x86 SharedFX - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - script: .\build.cmd - -ci - /p:SignType=$(_SignType) - $(BuildNumberArg) - /p:SkipArtifactInfoTargets=true - /p:DisableSignCheck=true - /t:DoCodeSigning - /bl:artifacts/logs/CodeSign.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Code Sign - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - task: MicroBuildCleanup@1 - displayName: Cleanup MicroBuild tasks - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Windows-SharedFx - artifactType: Container - parallel: true - - task: PublishBuildArtifacts@1 - displayName: Upload dependencies.g.props - condition: always() - continueOnError: true - inputs: - pathtoPublish: .deps/dependencies.g.props - artifactName: artifacts-dependencies-props - artifactType: Container - parallel: true - - - job: Windows_Installers - displayName: Build Windows Installers - dependsOn: Windows_SharedFx - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: MicroBuildSigningPlugin@2 - displayName: Install MicroBuild Signing plugin - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - - task: DownloadBuildArtifacts@0 - displayName: Download artifacts - inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download dependencies.g.props - inputs: - artifactName: artifacts-dependencies-props - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy SharedFx artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/SharedFX/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/fx/ - - task: CopyFiles@2 - displayName: Copy SharedFx artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/packages/ - contents: 'Microsoft.AspNetCore.AspNetCoreModule*.nupkg' - targetFolder: $(Build.SourcesDirectory)/.deps/ANCM/ - - task: CopyFiles@2 - displayName: Copy dependencies.g.props to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-dependencies-props/ - contents: 'dependencies.g.props' - targetFolder: $(Build.SourcesDirectory)/.deps/ - - task: UseDotNet@2 - displayName: Use .NET Core SDK 2.1 - inputs: - packageType: sdk - version: 2.1.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - powershell: src/Installers/Windows/build.ps1 - -Config Release - -BuildNumber $(Build.BuildId) - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Run src/Installers/Windows/build.ps1 - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Windows-Installers - artifactType: Container - parallel: true + sdl: + sourceAnalysisPool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2022-pt + os: windows + stages: + - stage: build + displayName: Build + jobs: + - template: jobs/default-build.yml@self + parameters: + jobName: Windows_Build + jobDisplayName: "Build and test: Windows" + buildArgs: $(BuildNumberArg) + codeSign: true + beforeBuild: + - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1" + displayName: Setup IISExpress test certificates + # Skip tests by default in internal non-PR builds. + ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: + variables: + PB_SKIPTESTS: ${{ coalesce(variables.PB_SKIPTESTS, 'true') }} - - job: Package_Archive - displayName: Build Package Archive - dependsOn: Windows_SharedFx - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 - displayName: Download artifacts - inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ - - script: .\build.cmd - -ci - $(BuildNumberArg) - /p:SignType=$(_SignType) - /t:BuildFallbackArchive - /bl:artifacts/logs/PackageArchive.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build Package Archive - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-Package-Archive - artifactType: Container - parallel: true + - job: Windows_SharedFx + displayName: Build Windows x64/x86 SharedFx + dependsOn: Windows_Build + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2019-pt + os: windows + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NodeTool@0 + displayName: Install Node 10.x + inputs: + versionSpec: 10.x + - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' + displayName: Install JDK 11 + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild Signing plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-Release + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/ + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(SharedFxArgs) + /p:SharedFxRID=win-x64 + /bl:artifacts/logs/SharedFx-win-x64.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build win-x64 SharedFX + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(SharedFxArgs) + /p:SharedFxRID=win-x86 + /bl:artifacts/logs/SharedFx-win-x86.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build win-x86 SharedFX + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - script: .\build.cmd + -ci + /p:SignType=$(_SignType) + $(BuildNumberArg) + /p:SkipArtifactInfoTargets=true + /p:DisableSignCheck=true + /t:DoCodeSigning + /bl:artifacts/logs/CodeSign.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Code Sign + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - task: MicroBuildCleanup@1 + displayName: Cleanup MicroBuild tasks + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload artifacts + condition: always() + continueOnError: true + inputs: + path: artifacts/ + artifactName: artifacts-Windows-SharedFx + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload dependencies.g.props + condition: always() + continueOnError: true + inputs: + path: .deps/dependencies.g.props + artifactName: artifacts-dependencies-props - - job: SharedFX_Installers - displayName: Build SharedFX Installers - dependsOn: Windows_SharedFx - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - LC_ALL: 'en_US.UTF-8' - LANG: 'en_US.UTF-8' - LANGUAGE: 'en_US.UTF-8' - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 - displayName: Download Windows SharedFx artifacts - inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/ - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ - - script: .\build.cmd - -ci - $(BuildNumberArg) - /t:BuildInstallers - /bl:artifacts/logs/SharedFx-Installers.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Build SharedFX Installers - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload artifacts - condition: always() - continueOnError: true - inputs: - pathtoPublish: artifacts/ - artifactName: artifacts-SharedFx-Installers - artifactType: Container - parallel: true + - job: Windows_Installers + displayName: Build Windows Installers + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2019-pt + os: windows + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild Signing plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download dependencies.g.props + inputs: + artifactName: artifacts-dependencies-props + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/SharedFX/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/fx/ + - task: CopyFiles@2 + displayName: Copy SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/packages/ + contents: 'Microsoft.AspNetCore.AspNetCoreModule*.nupkg' + targetFolder: $(Build.SourcesDirectory)/.deps/ANCM/ + - task: CopyFiles@2 + displayName: Copy dependencies.g.props to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-dependencies-props/ + contents: 'dependencies.g.props' + targetFolder: $(Build.SourcesDirectory)/.deps/ + - task: UseDotNet@2 + displayName: Use .NET Core SDK 2.1 + inputs: + packageType: sdk + version: 2.1.x + installationPath: $(Agent.TempDirectory)/dotnet + workingDirectory: $(Agent.TempDirectory) + - powershell: src/Installers/Windows/build.ps1 + -Config Release + -BuildNumber $(Build.BuildId) + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Run src/Installers/Windows/build.ps1 + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload artifacts + condition: always() + continueOnError: true + inputs: + path: artifacts/ + artifactName: artifacts-Windows-Installers - # Only run the publish job if this is a prodcon build - - ${{ if variables['ProductBuildId'] }}: - - job: Publish - displayName: Publish - dependsOn: - - Windows_Installers - - SharedFX_Installers - - Package_Archive - timeoutInMinutes: 90 - workspace: - clean: all - pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 - variables: - _SignType: real - JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk - PB_SKIPTESTS: 'true' - steps: - - checkout: self - clean: true - - task: NuGetCommand@2 - displayName: 'Clear NuGet caches' - inputs: - command: custom - arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 - displayName: Download Windows artifacts - inputs: - artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Windows SharedFx artifacts - inputs: - artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Package Archive artifacts - inputs: - artifactName: artifacts-Package-Archive - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download SharedFx installer artifacts - inputs: - artifactName: artifacts-SharedFx-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 - displayName: Download Windows installer artifacts - inputs: - artifactName: artifacts-Windows-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CopyFiles@2 - displayName: Copy Windows artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/build/ - contents: '**/*.tgz' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ - contents: | - SharedFx/** - OobArchives/** - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Package Archive artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Package-Archive/lzma/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - - task: CopyFiles@2 - displayName: Copy SharedFx Installer artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-SharedFx-Installers/installers/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - - task: CopyFiles@2 - displayName: Copy Windows Installer artifacts to .deps/assets - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Installers/bin/Release/installers/ - contents: | - en-US/*.msi - **/*.exe - **/*.wixlib - **/*.nupkg - targetFolder: $(Build.SourcesDirectory)/.deps/assets/ - flattenFolders: true - - task: CopyFiles@2 - displayName: Copy Windows SharedFx artifacts to .deps/packages - inputs: - sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/Packages/ - contents: '**' - targetFolder: $(Build.SourcesDirectory)/.deps/packages/ - - task: DeleteFiles@1 - displayName: Delete korebuild.json - inputs: - contents: korebuild.json - - script: .\build.cmd - -ci - $(BuildNumberArg) - /t:Publish - /p:BuildBranch=$(Build.SourceBranchName) - /bl:artifacts/logs/Publish.binlog - env: - PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) - PB_ASSETROOTURL: $(PB_AssetRootUrl) - PB_RESTORESOURCE: $(PB_RestoreSource) - PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) - displayName: Publish - - powershell: eng\scripts\KillProcesses.ps1 - displayName: Kill processes - condition: always() - - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: - - task: PublishBuildArtifacts@1 - displayName: Upload logs + - job: Package_Archive + displayName: Build Package Archive + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2019-pt + os: windows + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: DownloadBuildArtifacts@0 + displayName: Download artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ + - script: .\build.cmd + -ci + $(BuildNumberArg) + /p:SignType=$(_SignType) + /t:BuildFallbackArchive + /bl:artifacts/logs/PackageArchive.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build Package Archive + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes condition: always() - continueOnError: true + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload artifacts + condition: always() + continueOnError: true + inputs: + path: artifacts/ + artifactName: artifacts-Package-Archive + + - job: SharedFX_Installers + displayName: Build SharedFX Installers + dependsOn: Windows_SharedFx + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2019-pt + os: windows + variables: + LC_ALL: 'en_US.UTF-8' + LANG: 'en_US.UTF-8' + LANGUAGE: 'en_US.UTF-8' + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: DownloadBuildArtifacts@0 + displayName: Download Windows SharedFx artifacts inputs: - pathtoPublish: artifacts/logs - artifactName: artifacts-Publish - artifactType: Container - parallel: true \ No newline at end of file + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy Windows SharedFx artifacts to .deps/ + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/Signed/ + - script: .\build.cmd + -ci + $(BuildNumberArg) + /t:BuildInstallers + /bl:artifacts/logs/SharedFx-Installers.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Build SharedFX Installers + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload artifacts + condition: always() + continueOnError: true + inputs: + path: artifacts/ + artifactName: artifacts-SharedFx-Installers + + # Only run the publish job if this is a prodcon build + - ${{ if variables['ProductBuildId'] }}: + - job: Publish + displayName: Publish + dependsOn: + - Windows_Installers + - SharedFX_Installers + - Package_Archive + timeoutInMinutes: 90 + workspace: + clean: all + pool: + name: NetCore1ESPool-Svc-Internal + image: 1es-windows-2019-pt + os: windows + variables: + _SignType: real + JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk + PB_SKIPTESTS: 'true' + steps: + - checkout: self + clean: true + - task: NuGetCommand@2 + displayName: 'Clear NuGet caches' + inputs: + command: custom + arguments: 'locals all -clear' + - task: DownloadBuildArtifacts@0 + displayName: Download Windows artifacts + inputs: + artifactName: artifacts-Windows-Release + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download Windows SharedFx artifacts + inputs: + artifactName: artifacts-Windows-SharedFx + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download Package Archive artifacts + inputs: + artifactName: artifacts-Package-Archive + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download SharedFx installer artifacts + inputs: + artifactName: artifacts-SharedFx-Installers + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: DownloadBuildArtifacts@0 + displayName: Download Windows installer artifacts + inputs: + artifactName: artifacts-Windows-Installers + downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CopyFiles@2 + displayName: Copy Windows artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/build/ + contents: '**/*.tgz' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy Windows SharedFx artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/ + contents: | + SharedFx/** + OobArchives/** + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy Package Archive artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Package-Archive/lzma/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + - task: CopyFiles@2 + displayName: Copy SharedFx Installer artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-SharedFx-Installers/installers/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + - task: CopyFiles@2 + displayName: Copy Windows Installer artifacts to .deps/assets + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Installers/bin/Release/installers/ + contents: | + en-US/*.msi + **/*.exe + **/*.wixlib + **/*.nupkg + targetFolder: $(Build.SourcesDirectory)/.deps/assets/ + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy Windows SharedFx artifacts to .deps/packages + inputs: + sourceFolder: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/Signed/Packages/ + contents: '**' + targetFolder: $(Build.SourcesDirectory)/.deps/packages/ + - task: DeleteFiles@1 + displayName: Delete korebuild.json + inputs: + contents: korebuild.json + - script: .\build.cmd + -ci + $(BuildNumberArg) + /t:Publish + /p:BuildBranch=$(Build.SourceBranchName) + /bl:artifacts/logs/Publish.binlog + env: + PB_PACKAGEVERSIONPROPSURL: $(PB_PackageVersionPropsUrl) + PB_ASSETROOTURL: $(PB_AssetRootUrl) + PB_RESTORESOURCE: $(PB_RestoreSource) + PB_PUBLISHBLOBFEEDKEY: $(PB_PublishBlobFeedKey) + displayName: Publish + - powershell: eng\scripts\KillProcesses.ps1 + displayName: Kill processes + condition: always() + - ${{ if eq(variables['system.pullrequest.isfork'], false) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: Upload logs + condition: always() + continueOnError: true + inputs: + path: artifacts/logs + artifactName: artifacts-Publish \ No newline at end of file diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index adaada545da8..9092eea0ba2d 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -81,7 +81,8 @@ jobs: demands: ImageOverride -equals 1es-windows-2019-open ${{ if ne(variables['System.TeamProject'], 'public') }}: name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals 1es-windows-2019 + image: 1es-windows-2019-pt + os: windows variables: AgentOsName: ${{ parameters.agentOs }} BuildScriptArgs: ${{ parameters.buildArgs }} @@ -162,32 +163,28 @@ jobs: testResultsFiles: 'artifacts/logs/**/*.trx' mergeTestResults: true - ${{ if and(eq(parameters.artifacts.publish, 'true'), eq(variables['system.pullrequest.isfork'], false)) }}: - - task: PublishBuildArtifacts@1 + - task: 1ES.PublishPipelineArtifact@1 displayName: Upload artifacts continueOnError: true inputs: ${{ if eq(parameters.buildDirectory, '') }}: - pathtoPublish: ${{ parameters.artifacts.path }} + path: ${{ parameters.artifacts.path }} ${{ if ne(parameters.buildDirectory, '') }}: - pathtoPublish: ${{ parameters.buildDirectory }}\${{ parameters.artifacts.path }} + path: ${{ parameters.buildDirectory }}\${{ parameters.artifacts.path }} ${{ if eq(parameters.artifacts.name, '') }}: artifactName: artifacts-$(AgentOsName)-$(BuildConfiguration) ${{ if ne(parameters.artifacts.name, '') }}: artifactName: ${{ parameters.artifacts.name }} - artifactType: Container - parallel: true - ${{ if and(eq(parameters.artifacts.publish, 'true'), ne(variables['system.pullrequest.isfork'], false)) }}: - - task: PublishBuildArtifacts@1 + - task: 1ES.PublishPipelineArtifact@1 displayName: Upload logs continueOnError: true inputs: ${{ if eq(parameters.buildDirectory, '') }}: - pathtoPublish: artifacts/logs/ + path: artifacts/logs/ ${{ if ne(parameters.buildDirectory, '') }}: - pathtoPublish: ${{ parameters.buildDirectory }}/artifacts/logs + path: ${{ parameters.buildDirectory }}/artifacts/logs artifactName: logs-$(AgentOsName)-$(BuildConfiguration) - artifactType: Container - parallel: true - ${{ parameters.afterBuild }} - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows')) }}: - task: MicroBuildCleanup@1 From 0e3fbf97104f1bca2c454f21327c632c2cd68fbe Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 15:28:39 -0700 Subject: [PATCH 03/10] Cleanup --- .azure/pipelines/ci-public.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .azure/pipelines/ci-public.yml diff --git a/.azure/pipelines/ci-public.yml b/.azure/pipelines/ci-public.yml new file mode 100644 index 000000000000..0716e49ad0a8 --- /dev/null +++ b/.azure/pipelines/ci-public.yml @@ -0,0 +1,34 @@ +# Configure which branches trigger builds +trigger: + batch: true + branches: + include: + - release/2.* + - internal/release/2.* + +# Run PR validation on all branches +pr: + branches: + include: + - '*' + +variables: +- name: ASPNETCORE_TEST_LOG_MAXPATH + value: "200" # Keep test log file name length low enough for artifact zipping +- name: DOTNET_HOME + value: $(Agent.BuildDirectory)/.dotnet +- name: TeamName + value: AspNetCore +- name: BuildNumberArg + value: '' + +jobs: +- template: jobs/default-build.yml + parameters: + jobName: Windows_Build + jobDisplayName: "Build and test: Windows" + buildArgs: $(BuildNumberArg) + codeSign: true + beforeBuild: + - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1" + displayName: Setup IISExpress test certificates \ No newline at end of file From 4e7d266c2230c43ce63f6ba39b53181339eeaa33 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 15:29:45 -0700 Subject: [PATCH 04/10] Resource --- .azure/pipelines/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index d0dbf3e6dc23..a9f86412b1bf 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -33,6 +33,14 @@ variables: - name: PB_SignType value: ${{ coalesce(variables.PB_SignType, 'real') }} +resources: + repositories: + # Repo: 1ESPipelineTemplates/1ESPipelineTemplates + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + extends: template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: From c0b93e4ea24cb6c494e743c415a66dfada08779f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 15:30:44 -0700 Subject: [PATCH 05/10] Path --- .azure/pipelines/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index a9f86412b1bf..528a935c1acd 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -53,7 +53,7 @@ extends: - stage: build displayName: Build jobs: - - template: jobs/default-build.yml@self + - template: .azure/pipelines/jobs/default-build.yml@self parameters: jobName: Windows_Build jobDisplayName: "Build and test: Windows" From 301371ec90ebe98dca4ab2d763e6327bedd29b67 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 17:06:24 -0700 Subject: [PATCH 06/10] Print contents of dir --- .azure/pipelines/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 528a935c1acd..2ed66a1232a5 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -106,6 +106,9 @@ extends: inputs: artifactName: artifacts-Windows-Release downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - task: CmdLine@2 + inputs: + script: dir $(Build.StagingDirectory)/downloaded_artifacts/ - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: From 110a5a98234cc34d0ae6a009d8dba736317b7800 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 18:27:26 -0700 Subject: [PATCH 07/10] Pwsh --- .azure/pipelines/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 2ed66a1232a5..a5d5cd244335 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -106,9 +106,7 @@ extends: inputs: artifactName: artifacts-Windows-Release downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: CmdLine@2 - inputs: - script: dir $(Build.StagingDirectory)/downloaded_artifacts/ + - powershell: Dir -Recurse $(Build.StagingDirectory)\downloaded_artifacts\ | Get-Childitem - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: From 8075ac9d5437fbcaf2c7cff60a94824098fc5ba8 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 20:08:25 -0700 Subject: [PATCH 08/10] Different task --- .azure/pipelines/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index a5d5cd244335..c33cfbe5c904 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -101,12 +101,11 @@ extends: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@2 displayName: Download artifacts inputs: artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - powershell: Dir -Recurse $(Build.StagingDirectory)\downloaded_artifacts\ | Get-Childitem + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/ - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: From 013cb6a377ea3405d21de08626352ac7646d0157 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 19 Mar 2024 21:44:14 -0700 Subject: [PATCH 09/10] Pwsh again --- .azure/pipelines/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index c33cfbe5c904..f92f1e0d0d88 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -106,6 +106,7 @@ extends: inputs: artifactName: artifacts-Windows-Release targetPath: $(Build.StagingDirectory)/downloaded_artifacts/ + - powershell: Get-ChildItem -Path $(Build.StagingDirectory)/downloaded_artifacts/ - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: From dd6bc2c4fd00cf044e94c46fd036ebcc38f31cba Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 20 Mar 2024 08:20:00 -0700 Subject: [PATCH 10/10] Fix download --- .azure/pipelines/ci.yml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index f92f1e0d0d88..216294e8697d 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -105,8 +105,7 @@ extends: displayName: Download artifacts inputs: artifactName: artifacts-Windows-Release - targetPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - powershell: Get-ChildItem -Path $(Build.StagingDirectory)/downloaded_artifacts/ + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: @@ -207,16 +206,16 @@ extends: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@0 displayName: Download artifacts inputs: artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/ + - task: DownloadPipelineArtifact@0 displayName: Download dependencies.g.props inputs: artifactName: artifacts-dependencies-props - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-dependencies-props/ - task: CopyFiles@2 displayName: Copy SharedFx artifacts to .deps/ inputs: @@ -285,11 +284,11 @@ extends: inputs: command: custom arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@0 displayName: Download artifacts inputs: artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/ - task: CopyFiles@2 displayName: Copy artifacts to .deps/ inputs: @@ -343,11 +342,11 @@ extends: inputs: command: custom arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@0 displayName: Download Windows SharedFx artifacts inputs: artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/ - task: CopyFiles@2 displayName: Copy Windows SharedFx artifacts to .deps/ inputs: @@ -404,31 +403,31 @@ extends: inputs: command: custom arguments: 'locals all -clear' - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@0 displayName: Download Windows artifacts inputs: artifactName: artifacts-Windows-Release - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Release/ + - task: DownloadPipelineArtifact@0 displayName: Download Windows SharedFx artifacts inputs: artifactName: artifacts-Windows-SharedFx - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-SharedFx/ + - task: DownloadPipelineArtifact@0 displayName: Download Package Archive artifacts inputs: artifactName: artifacts-Package-Archive - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Package-Archive/ + - task: DownloadPipelineArtifact@0 displayName: Download SharedFx installer artifacts inputs: artifactName: artifacts-SharedFx-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ - - task: DownloadBuildArtifacts@0 + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-SharedFx-Installers/ + - task: DownloadPipelineArtifact@0 displayName: Download Windows installer artifacts inputs: artifactName: artifacts-Windows-Installers - downloadPath: $(Build.StagingDirectory)/downloaded_artifacts/ + targetPath: $(Build.StagingDirectory)/downloaded_artifacts/artifacts-Windows-Installers/ - task: CopyFiles@2 displayName: Copy Windows artifacts to .deps/assets inputs: