Skip to content

Commit

Permalink
Core tools release updates (trigger custom host after code mirror, si…
Browse files Browse the repository at this point in the history
…gn 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
  • Loading branch information
aishwaryabh authored Oct 18, 2024
1 parent c44e837 commit a4bf0e4
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 74 deletions.
97 changes: 24 additions & 73 deletions eng/ci/build-core-tools-host-artifacts-windows.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,40 @@
trigger:
branches:
include:
- feature/oop-host
paths:
include:
- ./host/src/**
pr: none

pr:
trigger:
branches:
include:
- feature/oop-host
paths:
include:
- ./host/src/**
- /host/src/**

resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: eng
type: git
name: engineering
ref: refs/tags/release

jobs:
- job: BuildCoreToolsHostWindows
displayName: '[Windows] Build CoreToolsHost'
pool:
vmImage: 'windows-latest'

variables:
variables:
- template: /ci/variables/cfs.yml@eng

templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
displayName: Publish CoreToolsHost packages
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
artifact: _coreToolsHostPackagesWindows

steps:
- pwsh: |
Import-Module "./pipelineUtilities.psm1" -Force
Install-Dotnet
displayName: 'Install .NET 9'
- task: DotnetCoreCLI@2
displayName: Dotnet Publish (win-x64)
inputs:
command: publish
publishWebProjects: false
zipAfterPublish: false
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost

- task: DotnetCoreCLI@2
displayName: Dotnet Publish (win-arm64)
inputs:
command: publish
publishWebProjects: false
zipAfterPublish: false
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost

- task: CopyFiles@2
displayName: Copy files (win-x64)
inputs:
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
# Publish output will include many other files. We only need func.exe & nethost.dll
Contents: |
func.exe
nethost.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64

- task: CopyFiles@2
displayName: Copy files (win-arm64)
inputs:
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
# Publish output will include many other files. We only need func.exe & nethost.dll
Contents: |
func.exe
nethost.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64

- task: PublishPipelineArtifact@1
displayName: 'Publish CoreToolsHost packages artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows'
artifact: 'drop-coretools-host-windows'
publishLocation: 'pipeline'
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows
sdl:
codeql:
compiled:
enabled: true
runSourceLanguagesInSourceAnalysis: true
stages:
- stage: BuildCoreToolsHost
jobs:
- template: /eng/ci/templates/official/jobs/build-core-tools-host.yml@self
123 changes: 123 additions & 0 deletions eng/ci/templates/official/jobs/build-core-tools-host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
jobs:
- job: BuildCoreToolsHostWindows
displayName: '[Windows] Build CoreToolsHost'
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows

steps:
- task: UseDotNet@2
inputs:
version: 9.x
includePreviewVersions: true
displayName: Install .NET 9
- task: UseDotNet@2
inputs:
version: 6.x
displayName: Install .NET 6

- task: DotnetCoreCLI@2
displayName: Dotnet Publish (win-x64)
inputs:
command: publish
publishWebProjects: false
zipAfterPublish: false
arguments: -c Release -r win-x64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-x64 --self-contained
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost

- task: DotnetCoreCLI@2
displayName: Dotnet Publish (win-arm64)
inputs:
command: publish
publishWebProjects: false
zipAfterPublish: false
arguments: -c Release -r win-arm64 -o $(Build.SourcesDirectory)/pkg_output/windows/win-arm64 --self-contained
workingDirectory: $(Build.SourcesDirectory)/host/src/CoreToolsHost

- template: ci/sign-files.yml@eng
parameters:
displayName: 'Authenticode signing (dll) (win-arm64)'
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-arm64'
pattern: '*.dll, *.exe'
signType: inline
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- template: ci/sign-files.yml@eng
parameters:
displayName: 'Authenticode signing (dll) (win-x64)'
folderPath: '$(Build.SourcesDirectory)/pkg_output/windows/win-x64'
pattern: '*.dll, *.exe'
signType: inline
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- task: CopyFiles@2
displayName: Copy files (win-x64)
inputs:
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-x64
# Publish output will include many other files. We only need func.exe & nethost.dll
Contents: |
func.exe
nethost.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-x64

- task: CopyFiles@2
displayName: Copy files (win-arm64)
inputs:
SourceFolder: $(Build.SourcesDirectory)/pkg_output/windows/win-arm64
# Publish output will include many other files. We only need func.exe & nethost.dll
Contents: |
func.exe
nethost.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows/win-arm64

templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
path: $(Build.ArtifactStagingDirectory)/_coreToolsHostPackagesWindows
artifact: drop-coretools-host-windows
7 changes: 6 additions & 1 deletion src/Azure.Functions.ArtifactAssembler/ArtifactAssembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ internal sealed class ArtifactAssembler

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

// If we are currently on the minified version of the artifacts, we do not want the inproc6/inproc8 subfolders
if (artifactName.Contains("min.win"))
{
continue;
}

// If we are running this for the first time, extract the directory path and out of proc version
if (String.IsNullOrEmpty(inProc8ArtifactDirPath))
{
Expand Down

0 comments on commit a4bf0e4

Please sign in to comment.