Skip to content

Commit 5022a62

Browse files
authored
migrate to 1ES - first draft (#325)
1 parent a8657fc commit 5022a62

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

eng/ci/official-build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
parameters:
2+
- name: binlog
3+
displayName: MSBuild binary log
4+
type: boolean
5+
default: false
6+
7+
variables:
8+
- template: ci/variables/cfs.yml@eng
9+
10+
trigger:
11+
batch: true
12+
branches:
13+
include:
14+
- main
15+
16+
# CI only, does not trigger on PRs.
17+
pr: none
18+
19+
resources:
20+
repositories:
21+
- repository: 1es
22+
type: git
23+
name: 1ESPipelineTemplates/1ESPipelineTemplates
24+
ref: refs/tags/release
25+
- repository: eng
26+
type: git
27+
name: engineering
28+
ref: refs/tags/release
29+
30+
extends:
31+
template: v1/1ES.Official.PipelineTemplate.yml@1es
32+
parameters:
33+
pool:
34+
name: 1es-pool-azfunc
35+
image: 1es-windows-2022
36+
os: windows
37+
38+
stages:
39+
- stage: BuildAndSign
40+
dependsOn: []
41+
jobs:
42+
- template: /eng/templates/build.yml@self

eng/templates/build.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
jobs:
2+
- job: Build
3+
4+
templateContext:
5+
outputs:
6+
- output: pipelineArtifact
7+
path: $(pkg_dir)
8+
artifact: drop
9+
sbomBuildDropPath: $(System.DefaultWorkingDirectory)
10+
sbomPackageName: 'DurableTask-Dotnet SBOM'
11+
12+
variables:
13+
project: 'src/dirs.proj'
14+
bin_dir: 'out/bin'
15+
log_dir: 'out/log'
16+
pkg_dir: 'out/pkg'
17+
build_args: -c release -p:FileVersionRevision=$(Build.BuildId) -p:ContinuousIntegrationBuild=true
18+
${{ if parameters.binlog }}:
19+
build_binlog: -bl:$(log_dir)/build.binlog
20+
pack_binlog: -bl:$(log_dir)/pack.binlog
21+
${{ else }}:
22+
build_binlog: ''
23+
pack_binlog: ''
24+
25+
steps:
26+
- checkout: self
27+
submodules: true
28+
29+
- task: UseDotNet@2
30+
displayName: 'Install .NET 6 SDK (ESRP)' # This is needed for ESRP.
31+
inputs:
32+
packageType: 'sdk'
33+
version: '6.x'
34+
35+
- task: UseDotNet@2
36+
displayName: 'Install .NET SDK (Build)' # This is needed for the build.
37+
inputs:
38+
packageType: 'sdk'
39+
useGlobalJson: true
40+
41+
# Start by restoring all the dependencies. This needs to be its own task.
42+
- task: DotNetCoreCLI@2
43+
displayName: Restore
44+
inputs:
45+
command: restore
46+
verbosityRestore: Minimal
47+
projects: $(project)
48+
feedsToUse: config
49+
nugetConfigPath: nuget.config
50+
51+
# Build source directory
52+
- task: DotNetCoreCLI@2
53+
displayName: Build
54+
inputs:
55+
command: build
56+
arguments: --no-restore $(build_args) $(build_binlog)
57+
projects: $(project)
58+
59+
- template: ci/sign-files.yml@eng
60+
parameters:
61+
displayName: Sign assemblies
62+
folderPath: $(bin_dir)
63+
pattern: Microsoft.DurableTask.*.dll
64+
signType: dll
65+
66+
# Packaging needs to be a separate step from build.
67+
# This will automatically pick up the signed DLLs.
68+
- task: DotNetCoreCLI@2
69+
displayName: Pack
70+
inputs:
71+
command: custom
72+
custom: pack
73+
arguments: --no-build $(build_args) $(pack_binlog)
74+
projects: $(project)
75+
76+
- template: ci/sign-files.yml@eng
77+
parameters:
78+
displayName: Sign NugetPackages
79+
folderPath: $(build.artifactStagingDirectory)
80+
pattern: '*.nupkg'
81+
signType: nuget

0 commit comments

Comments
 (0)