Skip to content

Commit e847db3

Browse files
authored
Enable signing in the VMR official pipeline (#45517)
1 parent 4eecff7 commit e847db3

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

eng/pipelines/templates/jobs/vmr-build.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ jobs:
161161
- name: runTestsTimeout
162162
value: 30
163163

164+
- ${{ if or(eq(parameters.useDevVersions, 'True'), eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
165+
- name: _SignType
166+
value: ''
167+
- ${{ else }}:
168+
- name: _SignType
169+
value: real
170+
164171
- ${{ if parameters.isBuiltFromVmr }}:
165172
- name: vmrPath
166173
value: $(Build.SourcesDirectory)
@@ -295,6 +302,12 @@ jobs:
295302
fi
296303
displayName: Setup Previously Source-Built SDK
297304
305+
- ${{ if and(eq(parameters.sign, 'True'), ne(parameters.buildSourceOnly, 'True'), eq(variables['System.TeamProject'], 'internal')) }}:
306+
- template: ${{ variables['Build.SourcesDirectory'] }}/eng/common/core-templates/steps/install-microbuild.yml
307+
parameters:
308+
enableMicrobuild: true
309+
enableMicrobuildForMacAndLinux: true
310+
298311
- ${{ if eq(parameters.targetOS, 'windows') }}:
299312
# Node 20.x is a toolset dependency to build aspnetcore
300313
# Keep in sync with aspnetcore: https://github.com/dotnet/aspnetcore/blob/7d5309210d8f7bae8fa074da495e9d009d67f1b4/.azure/pipelines/ci.yml#L719-L722
@@ -305,7 +318,12 @@ jobs:
305318

306319
- script: |
307320
set extraBuildArguments=
308-
if /I '${{ parameters.sign }}'=='True' (if /I NOT '${{ parameters.buildSourceOnly }}'=='True' (set extraBuildArguments=%extraBuildArguments% -sign))
321+
322+
set signArgs=/p:ForceDryRunSigning=true
323+
if /I '$(_SignType)'=='real' set signArgs=/p:DotNetSignType=real /p:TeamName=$(_TeamName)
324+
if /I '$(_SignType)'=='test' set signArgs=/p:DotNetSignType=test /p:TeamName=$(_TeamName)
325+
if /I '${{ parameters.sign }}'=='True' if /I NOT '${{ parameters.buildSourceOnly }}'=='True' set extraBuildArguments=%extraBuildArguments% -sign %signArgs%
326+
309327
if /I '${{ parameters.useDevVersions }}'=='True' set extraBuildArguments=%extraBuildArguments% -dev
310328
set extraBuildProperties=
311329
if not [${{ parameters.buildPass }}]==[] set extraBuildProperties=%extraBuildProperties% /p:DotNetBuildPass=${{ parameters.buildPass }}
@@ -397,6 +415,12 @@ jobs:
397415
398416
if [[ '${{ parameters.sign }}' == 'True' ]] && [[ '${{ parameters.buildSourceOnly }}' != 'True' ]]; then
399417
customBuildArgs="$customBuildArgs --sign"
418+
if [[ '$(_SignType)' == 'real' ]] || [[ '$(_SignType)' == 'test' ]]; then
419+
# Force dry run signing until https://github.com/dotnet/source-build/issues/4793 is resolved - https://github.com/dotnet/source-build/issues/4678
420+
extraBuildProperties="$extraBuildProperties /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:ForceDryRunSigning=true"
421+
else
422+
extraBuildProperties="$extraBuildProperties /p:ForceDryRunSigning=true"
423+
fi
400424
fi
401425
402426
if [[ -n "${{ parameters.targetRid }}" ]]; then
@@ -511,6 +535,12 @@ jobs:
511535
displayName: Run Tests
512536
timeoutInMinutes: ${{ variables.runTestsTimeout }}
513537
538+
- ${{ if and(eq(parameters.sign, 'True'), ne(parameters.buildSourceOnly, 'True'), eq(variables['System.TeamProject'], 'internal')) }}:
539+
- template: ${{ variables['Build.SourcesDirectory'] }}/eng/common/core-templates/steps/cleanup-microbuild.yml
540+
parameters:
541+
enableMicrobuild: true
542+
enableMicrobuildForMacAndLinux: true
543+
514544
- task: CopyFiles@2
515545
displayName: Prepare BuildLogs staging directory
516546
inputs:

eng/pipelines/templates/variables/vmr-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ variables:
1212
- name: VmrBranch
1313
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
1414

15+
- name: _TeamName
16+
value: DotNetCore
17+
1518
- name: defaultContainerOptions
1619
value: --privileged
1720

src/SourceBuild/content/build.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ while [[ $# > 0 ]]; do
131131
;;
132132
-sign)
133133
properties+=( "/p:Sign=true" )
134-
# Force dry run signing for now. In typical VMR builds, the official build ID is set for each repo, which
135-
# tells the signing infra that it should expect to see signed bits. This won't be the case in CI builds,
136-
# and won't be the case for official builds until more of the real signing infra is functional.
137-
# https://github.com/dotnet/source-build/issues/4678
138-
properties+=( "/p:ForceDryRunSigning=true" )
139134
;;
140135

141136
# Source-only settings

src/SourceBuild/content/eng/build.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ if ($test) {
6868

6969
if ($sign) {
7070
$arguments += "/p:Sign=true"
71-
# Force dry run signing for now. In typical VMR builds, the official build ID is set for each repo, which
72-
# tells the signing infra that it should expect to see signed bits. This won't be the case in CI builds,
73-
# and won't be the case for official builds until more of the real signing infra is functional.
74-
# https://github.com/dotnet/source-build/issues/4678
75-
$arguments += "/p:ForceDryRunSigning=true"
7671
}
7772

7873
if ($buildRepoTests) {

0 commit comments

Comments
 (0)