Skip to content

Commit a4bf0e4

Browse files
authored
Core tools release updates (trigger custom host after code mirror, sign func.exe and nethost.dll, and remove inproc subfolders for minified default version) (#3879)
* trying to trigger pr build * removing pr trigger and custom path * testing out changes * testing out chagnes * adding comment * reverting changes for branch * removing double * * testing 1es template changes * forgot to add 1es as a repository * fixing publish step * removing code mirror custom step * adding sign step and add useDotnetTask * minified version should not have inproc6/inproc8 subdirectories * installing net9 and changing path * pipeline utilities to see if that works for install netsdk * install net9 * installing net6 as well * move sign step before copy * adding self-contained
1 parent c44e837 commit a4bf0e4

File tree

3 files changed

+153
-74
lines changed

3 files changed

+153
-74
lines changed
Lines changed: 24 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,40 @@
1-
trigger:
2-
branches:
3-
include:
4-
- feature/oop-host
5-
paths:
6-
include:
7-
- ./host/src/**
1+
pr: none
82

9-
pr:
3+
trigger:
104
branches:
115
include:
126
- feature/oop-host
137
paths:
148
include:
15-
- ./host/src/**
9+
- /host/src/**
1610

1711
resources:
1812
repositories:
13+
- repository: 1es
14+
type: git
15+
name: 1ESPipelineTemplates/1ESPipelineTemplates
16+
ref: refs/tags/release
1917
- repository: eng
2018
type: git
2119
name: engineering
2220
ref: refs/tags/release
2321

24-
jobs:
25-
- job: BuildCoreToolsHostWindows
26-
displayName: '[Windows] Build CoreToolsHost'
27-
pool:
28-
vmImage: 'windows-latest'
29-
30-
variables:
22+
variables:
3123
- template: /ci/variables/cfs.yml@eng
3224

33-
templateContext:
34-
outputParentDirectory: $(Build.ArtifactStagingDirectory)
35-
outputs:
36-
- output: pipelineArtifact
37-
displayName: Publish CoreToolsHost packages
38-
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
39-
artifact: _coreToolsHostPackagesWindows
40-
41-
steps:
42-
- pwsh: |
43-
Import-Module "./pipelineUtilities.psm1" -Force
44-
Install-Dotnet
45-
displayName: 'Install .NET 9'
46-
- task: DotnetCoreCLI@2
47-
displayName: Dotnet Publish (win-x64)
48-
inputs:
49-
command: publish
50-
publishWebProjects: false
51-
zipAfterPublish: false
52-
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64
53-
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
54-
55-
- task: DotnetCoreCLI@2
56-
displayName: Dotnet Publish (win-arm64)
57-
inputs:
58-
command: publish
59-
publishWebProjects: false
60-
zipAfterPublish: false
61-
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
62-
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
63-
64-
- task: CopyFiles@2
65-
displayName: Copy files (win-x64)
66-
inputs:
67-
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
68-
# Publish output will include many other files. We only need func.exe & nethost.dll
69-
Contents: |
70-
func.exe
71-
nethost.dll
72-
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64
73-
74-
- task: CopyFiles@2
75-
displayName: Copy files (win-arm64)
76-
inputs:
77-
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
78-
# Publish output will include many other files. We only need func.exe & nethost.dll
79-
Contents: |
80-
func.exe
81-
nethost.dll
82-
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64
83-
84-
- task: PublishPipelineArtifact@1
85-
displayName: 'Publish CoreToolsHost packages artifact'
86-
inputs:
87-
targetPath: '$(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows'
88-
artifact: 'drop-coretools-host-windows'
89-
publishLocation: 'pipeline'
25+
extends:
26+
template: v1/1ES.Official.PipelineTemplate.yml@1es
27+
parameters:
28+
pool:
29+
name: 1es-pool-azfunc
30+
image: 1es-windows-2022
31+
os: windows
32+
sdl:
33+
codeql:
34+
compiled:
35+
enabled: true
36+
runSourceLanguagesInSourceAnalysis: true
37+
stages:
38+
- stage: BuildCoreToolsHost
39+
jobs:
40+
- template: /eng/ci/templates/official/jobs/build-core-tools-host.yml@self
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
jobs:
2+
- job: BuildCoreToolsHostWindows
3+
displayName: '[Windows] Build CoreToolsHost'
4+
pool:
5+
name: 1es-pool-azfunc
6+
image: 1es-windows-2022
7+
os: windows
8+
9+
steps:
10+
- task: UseDotNet@2
11+
inputs:
12+
version: 9.x
13+
includePreviewVersions: true
14+
displayName: Install .NET 9
15+
- task: UseDotNet@2
16+
inputs:
17+
version: 6.x
18+
displayName: Install .NET 6
19+
20+
- task: DotnetCoreCLI@2
21+
displayName: Dotnet Publish (win-x64)
22+
inputs:
23+
command: publish
24+
publishWebProjects: false
25+
zipAfterPublish: false
26+
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64 --self-contained
27+
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
28+
29+
- task: DotnetCoreCLI@2
30+
displayName: Dotnet Publish (win-arm64)
31+
inputs:
32+
command: publish
33+
publishWebProjects: false
34+
zipAfterPublish: false
35+
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64 --self-contained
36+
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost
37+
38+
- template: ci/sign-files.yml@eng
39+
parameters:
40+
displayName: 'Authenticode signing (dll) (win-arm64)'
41+
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-arm64'
42+
pattern: '*.dll, *.exe'
43+
signType: inline
44+
inlineOperation: |
45+
[
46+
{
47+
"KeyCode": "CP-230012",
48+
"OperationCode": "SigntoolSign",
49+
"Parameters": {
50+
"OpusName": "Microsoft",
51+
"OpusInfo": "http://www.microsoft.com",
52+
"FileDigest": "/fd \"SHA256\"",
53+
"PageHash": "/NPH",
54+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
55+
},
56+
"ToolName": "sign",
57+
"ToolVersion": "1.0"
58+
},
59+
{
60+
"KeyCode": "CP-230012",
61+
"OperationCode": "SigntoolVerify",
62+
"Parameters": {},
63+
"ToolName": "sign",
64+
"ToolVersion": "1.0"
65+
}
66+
]
67+
68+
- template: ci/sign-files.yml@eng
69+
parameters:
70+
displayName: 'Authenticode signing (dll) (win-x64)'
71+
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-x64'
72+
pattern: '*.dll, *.exe'
73+
signType: inline
74+
inlineOperation: |
75+
[
76+
{
77+
"KeyCode": "CP-230012",
78+
"OperationCode": "SigntoolSign",
79+
"Parameters": {
80+
"OpusName": "Microsoft",
81+
"OpusInfo": "http://www.microsoft.com",
82+
"FileDigest": "/fd \"SHA256\"",
83+
"PageHash": "/NPH",
84+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
85+
},
86+
"ToolName": "sign",
87+
"ToolVersion": "1.0"
88+
},
89+
{
90+
"KeyCode": "CP-230012",
91+
"OperationCode": "SigntoolVerify",
92+
"Parameters": {},
93+
"ToolName": "sign",
94+
"ToolVersion": "1.0"
95+
}
96+
]
97+
98+
- task: CopyFiles@2
99+
displayName: Copy files (win-x64)
100+
inputs:
101+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
102+
# Publish output will include many other files. We only need func.exe & nethost.dll
103+
Contents: |
104+
func.exe
105+
nethost.dll
106+
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64
107+
108+
- task: CopyFiles@2
109+
displayName: Copy files (win-arm64)
110+
inputs:
111+
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
112+
# Publish output will include many other files. We only need func.exe & nethost.dll
113+
Contents: |
114+
func.exe
115+
nethost.dll
116+
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64
117+
118+
templateContext:
119+
outputParentDirectory: $(Build.ArtifactStagingDirectory)
120+
outputs:
121+
- output: pipelineArtifact
122+
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
123+
artifact: drop-coretools-host-windows

src/Azure.Functions.ArtifactAssembler/ArtifactAssembler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ internal sealed class ArtifactAssembler
3030

3131
/// <summary>
3232
/// The artifacts for which we want to pack out-of-proc core tools with it (along with inproc6 and inproc8 directories).
33-
/// This dictionary contains the artifact name and the corresponding runtime identifier value.
3433
/// </summary>
3534
private readonly string[] _cliArtifacts =
3635
{
@@ -248,6 +247,12 @@ private async Task CreateCliCoreToolsAsync()
248247
await Task.Run(() => FileUtilities.CopyDirectory(outOfProcArtifactDirPath, consolidatedArtifactDirPath));
249248
Directory.Delete(outOfProcArtifactDirPath, true);
250249

250+
// If we are currently on the minified version of the artifacts, we do not want the inproc6/inproc8 subfolders
251+
if (artifactName.Contains("min.win"))
252+
{
253+
continue;
254+
}
255+
251256
// If we are running this for the first time, extract the directory path and out of proc version
252257
if (String.IsNullOrEmpty(inProc8ArtifactDirPath))
253258
{

0 commit comments

Comments
 (0)