Skip to content

Commit b25a7ae

Browse files
authored
dnup CI Pipeline (#51437)
2 parents 6c89278 + 91d8ac8 commit b25a7ae

File tree

3 files changed

+138
-1
lines changed

3 files changed

+138
-1
lines changed

.vsts-dnup-ci.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Pipeline: https://dev.azure.com/dnceng/internal/_build?definitionId=
2+
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
- dnup
8+
- release/dnup
9+
10+
pr:
11+
branches:
12+
include:
13+
- dnup
14+
- release/dnup
15+
16+
parameters:
17+
# When true, runs the pipeline in the same way as the PR pipeline.
18+
- name: runTestBuild
19+
displayName: Run A Test Build
20+
type: boolean
21+
default: false
22+
- name: enableArm64Job
23+
displayName: Enables the ARM64 job
24+
type: boolean
25+
default: false
26+
27+
variables:
28+
- template: /eng/pipelines/templates/variables/sdk-defaults.yml
29+
# Variables used: DncEngInternalBuildPool
30+
- template: /eng/common/templates-official/variables/pool-providers.yml
31+
# Helix testing requires a token when internally run.
32+
# Variables used: HelixApiAccessToken
33+
- group: DotNet-HelixApi-Access
34+
- group: AzureDevOps-Artifact-Feeds-Pats
35+
# Allows Arcade to run a signed build by disabling post-build signing for release-branch builds or manual builds that are not running tests.
36+
- ${{ if and(eq(parameters.runTestBuild, false), or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual'))) }}:
37+
- name: PostBuildSign
38+
value: false
39+
# Provides TSA variables for automatic bug reporting.
40+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
41+
- group: DotNet-CLI-SDLValidation-Params
42+
### LOCAL ONLY ###
43+
- name: _publishArgument
44+
value: -publish
45+
- name: _signArgument
46+
value: -sign /p:SignCoreSdk=true
47+
- name: _officialBuildProperties
48+
# The OfficialBuilder property is set to Microsoft for the official build only.
49+
# This property is checked in Directory.Build.props and adds the MICROSOFT_ENABLE_TELEMETRY constant.
50+
# This constant is used in CompileOptions.cs to set both TelemetryOptOutDefault and TelemetryOptOutDefaultString.
51+
value: /p:DotNetPublishUsingPipelines=true /p:OfficialBuilder=Microsoft /p:OfficialBuildId=$(Build.BuildNumber)
52+
53+
resources:
54+
repositories:
55+
- repository: 1esPipelines
56+
type: git
57+
name: 1ESPipelineTemplates/1ESPipelineTemplates
58+
ref: refs/tags/release
59+
60+
extends:
61+
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
62+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
63+
${{ else }}:
64+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
65+
parameters:
66+
containers:
67+
azureLinux30Amd64:
68+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-build-amd64
69+
70+
sdl:
71+
sourceAnalysisPool:
72+
name: $(DncEngInternalBuildPool)
73+
image: 1es-windows-2022
74+
os: windows
75+
policheck:
76+
enabled: true
77+
tsa:
78+
enabled: true
79+
binskim:
80+
enabled: true
81+
${{ if or(eq(parameters.runTestBuild, true), eq(variables['Build.Reason'], 'PullRequest')) }}:
82+
componentgovernance:
83+
# Refdoc: https://docs.opensource.microsoft.com/tools/cg/component-detection/variables/
84+
ignoreDirectories: artifacts, .packages
85+
86+
stages:
87+
############### BUILD STAGE ###############
88+
############### WINDOWS ###############
89+
- template: /eng/pipelines/templates/jobs/dnup-tests.yml@self
90+
parameters:
91+
pool:
92+
name: $($(DncEngInternalBuildPool))
93+
image: windows.vs2022.amd64
94+
os: windows
95+
emoji: 🪟
96+
helixTargetQueue: windows.amd64.vs2022.pre
97+
oneESCompat:
98+
templateFolderName: templates-official
99+
publishTaskPrefix: 1ES.
100+
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
101+
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
102+
preSteps:
103+
- powershell: New-Item -ItemType Directory -Path $(Build.SourcesDirectory)/artifacts/bin -Force
104+
displayName: Create artifacts/bin directory
105+
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
106+
timeoutInMinutes: 180
107+
windowsJobParameterSets:
108+
### OFFICIAL ###
109+
- categoryName: Official
110+
publishArgument: $(_publishArgument)
111+
signArgument: $(_signArgument)
112+
officialBuildProperties: $(_officialBuildProperties) /p:BuildWorkloads=true
113+
enableDefaultArtifacts: true
114+
runTests: false
115+
publishRetryConfig: true
116+
variables:
117+
_SignType: real
118+
119+
############### PACKAGE STAGE ###############
120+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
121+
- stage: publish
122+
displayName: Publish
123+
dependsOn: []
124+
jobs:
125+
- template: /eng/pipelines/templates/jobs/dnup-library-package.yml@self
126+
parameters:
127+
pool:
128+
name: $(DncEngInternalBuildPool)
129+
image: 1es-windows-2022
130+
os: windows

eng/pipelines/templates/jobs/dnup-library-package.yml

Whitespace-only changes.

src/Installer/Microsoft.Dotnet.Installation/Microsoft.Dotnet.Installation.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88

99
<!-- Strong naming not needed on .NET Core -->
1010
<NoWarn>$(NoWarn);CS8002</NoWarn>
11+
<IsPackable>true</IsPackable>
12+
<IncludeSymbols>true</IncludeSymbols>
13+
<PackageId>Microsoft.Dotnet.Installation</PackageId>
14+
<IsShipping>false</IsShipping>
15+
<Title>.NET Installation Library</Title>
16+
<Version>1.0.0-alpha</Version>
17+
<PackageVersion Condition="'$(PackageVersion)'==''">$(Version)</PackageVersion>
1118
</PropertyGroup>
1219

1320
<ItemGroup>
1421
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" />
15-
<!-- TODO: Create logging / progress abstraction and remove this dipendency from the library -->
22+
<!-- TODO: Create logging / progress abstraction and remove this dependency from the library -->
1623
<PackageReference Include="Spectre.Console" />
1724
</ItemGroup>
1825

0 commit comments

Comments
 (0)