diff --git a/.pipelines/templates/linux.yml b/.pipelines/templates/linux.yml index 0ab4f54e4f..9d2c47a20a 100644 --- a/.pipelines/templates/linux.yml +++ b/.pipelines/templates/linux.yml @@ -136,6 +136,7 @@ jobs: - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: 1 - group: DotNetPrivateBuildAccess + - group: certificate_logical_to_actual - name: ob_outputDirectory value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT' - name: ob_sdl_codeSignValidation_enabled diff --git a/.pipelines/templates/mac.yml b/.pipelines/templates/mac.yml index 4b46cfff46..dfb986f45a 100644 --- a/.pipelines/templates/mac.yml +++ b/.pipelines/templates/mac.yml @@ -81,6 +81,7 @@ jobs: - name: NugetSecurityAnalysisWarningLevel value: none - group: DotNetPrivateBuildAccess + - group: certificate_logical_to_actual - name: ob_outputDirectory value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT' - name: ob_sdl_codeSignValidation_enabled diff --git a/.pipelines/templates/obp-file-signing.yml b/.pipelines/templates/obp-file-signing.yml index ab750c2700..ba761633b2 100644 --- a/.pipelines/templates/obp-file-signing.yml +++ b/.pipelines/templates/obp-file-signing.yml @@ -128,7 +128,7 @@ steps: displayName: Sign 3rd Party files inputs: command: 'sign' - signing_profile: 135020002 + signing_profile: $(msft_3rd_party_cert_id) files_to_sign: '**\*.dll;**\*.exe' search_root: $(Pipeline.Workspace)/thirdPartyToBeSigned diff --git a/.pipelines/templates/windows-hosted-build.yml b/.pipelines/templates/windows-hosted-build.yml index d6be94368b..26aa00f5c5 100644 --- a/.pipelines/templates/windows-hosted-build.yml +++ b/.pipelines/templates/windows-hosted-build.yml @@ -17,6 +17,7 @@ jobs: - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: 1 - group: DotNetPrivateBuildAccess + - group: certificate_logical_to_actual - name: ob_outputDirectory value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT' - name: ob_sdl_codeSignValidation_enabled diff --git a/.pipelines/templates/windows-package-build.yml b/.pipelines/templates/windows-package-build.yml index ea724a2e28..102c9e47df 100644 --- a/.pipelines/templates/windows-package-build.yml +++ b/.pipelines/templates/windows-package-build.yml @@ -18,6 +18,7 @@ jobs: - name: skipNugetSecurityAnalysis value: true - group: DotNetPrivateBuildAccess + - group: certificate_logical_to_actual - name: ob_outputDirectory value: '$(Build.ArtifactStagingDirectory)\ONEBRANCH_ARTIFACT' - name: ob_sdl_binskim_enabled @@ -199,11 +200,35 @@ jobs: Set-Location $repoRoot $exePath = New-ExePackage -ProductVersion $version -ProductTargetArchitecture $runtime -MsiLocationPath $msiLocation + Write-Verbose -Verbose "setting vso[task.setvariable variable=exePath]$exePath" + Write-Host "##vso[task.setvariable variable=exePath]$exePath" Write-Verbose -Verbose "exePath: $exePath" - displayName: 'Make exe package' + + $enginePath = Join-Path -Path '$(System.ArtifactsDirectory)\unsignedEngine' -ChildPath engine.exe + Expand-ExePackageEngine -ExePath $exePath -EnginePath $enginePath + displayName: 'Make exe and expand package' - task: onebranch.pipeline.signing@1 - displayName: Sign MSI packages + displayName: Sign exe engine + inputs: + command: 'sign' + signing_profile: $(msft_3rd_party_cert_id) + files_to_sign: '$(System.ArtifactsDirectory)\unsignedEngine\*.exe' + search_root: '$(Pipeline.Workspace)' + + - pwsh: | + $repoRoot = "$env:REPOROOT" + Import-Module "$repoRoot\build.psm1" + Import-Module "$repoRoot\tools\packaging" + + $exePath = '$(exePath)' + $enginePath = Join-Path -Path '$(System.ArtifactsDirectory)\unsignedEngine' -ChildPath engine.exe + $enginePath | Get-AuthenticodeSignature | out-string | Write-Verbose -verbose + Compress-ExePackageEngine -ExePath $exePath -EnginePath $enginePath + displayName: Compress signed exe package + + - task: onebranch.pipeline.signing@1 + displayName: Sign exe packages inputs: command: 'sign' signing_profile: external_distribution