Skip to content

Commit

Permalink
Create metadata.json file in conslidated artifacts intermediate pipel…
Browse files Browse the repository at this point in the history
…ine (#3884)

* adding generate metadata file

* remove code mirror

* get correct inproc version

* print out metadata file

* fixing zip issue

* fixing release number

* fixing release number again

* removing zip artifact script and fixing code mirror
  • Loading branch information
aishwaryabh authored and fabiocav committed Nov 6, 2024
1 parent 2821f48 commit bc790c6
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 147 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
2 changes: 1 addition & 1 deletion publish-scripts/chocolatey/buildNUPKG.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def preparePackage():

for arch in archList:
fileName = f"Azure.Functions.Cli.win-{arch.lower()}.{constants.VERSION}.zip"
url = f'https://functionscdn.azureedge.net/public/{constants.VERSION}/{fileName}'
url = f'https://functionscdn.azureedge.net/public/4.0.{constants.CONSOLIDATED_BUILD_ID}/{fileName}'
substitutionMapping[f"ZIPURL_{arch}"] = url

# download the zip
Expand Down
6 changes: 5 additions & 1 deletion publish-scripts/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ def main(*args):
packageNamePostfix = ""

print(f"args: {args} {len(args)}")
if (len(args) >= 3):
if (len(args) >= 4):
packageNamePostfix = "-" + args[2]

constants.PACKAGENAME = constants.PACKAGENAME + packageNamePostfix
print(f"constants.PACKAGENAME: {constants.PACKAGENAME}")

constants.CONSOLIDATED_BUILD_ID = args[2] # New argument for consolidatedBuildId
print(f"Consolidated Build ID: {constants.CONSOLIDATED_BUILD_ID}") # Print the new argument

constants.VERSION = args[1]
constants.DRIVERROOTDIR = os.path.dirname(os.path.abspath(__file__))
platformSystem = platform.system()
Expand Down
Loading

0 comments on commit bc790c6

Please sign in to comment.