Bridge-To-Kubernetes/azure-pipelines.yml

1521 строка
49 KiB
YAML

# 'Allow scripts to access the OAuth token' was selected in pipeline. Add the following YAML to any steps requiring access:
# env:
# MY_ACCESS_TOKEN: $(System.AccessToken)
# Variable 'ArtifactServices.Symbol.AccountName' was defined in the Variables tab
# Variable 'ArtifactServices.Symbol.PAT' was defined in the Variables tab
# Variable 'ArtifactServices.Symbol.UseAAD' was defined in the Variables tab
# Variable 'DropRoot' was defined in the Variables tab
# Variable 'ForceProductionBuild' was defined in the Variables tab
# Variable 'ForceStagingBuild' was defined in the Variables tab
# Variable 'MSI_BuildVersion' was defined in the Variables tab
# Variable 'RunTests' was defined in the Variables tab
# Variable 'skipComponentGovernanceDetection' was defined in the Variables tab
# Variable 'system.prefergit' was defined in the Variables tab
# Variable 'TeamName' was defined in the Variables tab
# Variable 'TelemetryType' was defined in the Variables tab
parameters:
- name: TelemetryType
displayName: Telemetry Type so that correct application insights key is selected
default: 'TELEMETRY_DEVELOPMENT'
values:
- TELEMETRY_DEVELOPMENT
- TELEMETRY_STAGING
- TELEMETRY_PRODUCTION
- name: BuildConfiguration
displayName: BuildConfiguration to be used
default: 'Release'
values:
- Release
- Debug
variables:
- name: BuildParameters.dotnetversion
value: 7.0.x
- name: BuildParameters.dotnetversionforbuild
value: net7.0
- name: BuildParameters.nugetversion
value: 5.9.x
- name: TeamName
value: Mindaro
- name: RunTests
value: True
# A pipeline with no CI trigger since this is a signed build needs to be triggered manually.
trigger: none
name: $(date:yyyyMMdd)$(rev:.r)
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
jobs:
- job: Phase_1
displayName: Run self-contained build (binaries V1, where the binaries are all bundled together)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
demands:
- msbuild
- visualstudio
- DotNetFramework
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: PowerShell@2
displayName: Set staging/prod build vars for signing and telemetry copy
enabled: True
inputs:
targetType: inline
script: >-
if ($env:ForceStagingBuild -eq "true" -And $env:ForceProductionBuild -eq "true") {
Write-Host "You can't do a Staging and Production build at the same time... Duh...."
exit 1
}
$branchName = $env:BUILD_SOURCEBRANCH
if ($branchName -eq "refs/heads/main") {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for main branch"
} else {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for other branch"
}
Write-Host "##vso[task.setvariable variable=MicroBuild_NuPkgSigningEnabled;]true"
- task: MicroBuildSigningPlugin@3
name: ''
displayName: Install Signing Plugin
enabled: True
inputs:
signType: real
zipSources: false
- task: MicroBuildLocalizationPlugin@3
displayName: 'Install Localization Plugin'
enabled: True
- task: UseDotNet@2
displayName: Use .NET Core SDK 7.0.x
enabled: True
inputs:
version: $(BuildParameters.dotnetversion)
installationPath: $(Agent.TempDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: restore EndpointManager (Windows) (to download runtime pack)
enabled: True
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-x64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: restore EndpointManager for arm64 (Windows) (to download runtime pack)
enabled: True
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-arm64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: NuGetToolInstaller@1
name: ''
displayName: Use NuGet 5.9.x
enabled: True
inputs:
versionSpec: $(BuildParameters.nugetversion)
- task: NuGetCommand@2
name: ''
displayName: NuGet restore client.sln
enabled: True
inputs:
solution: src/client.sln
selectOrConfig: config
feedRestore: fc5819b5-ed1c-4a51-9766-a55ddb558d72
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
verbosityRestore: Normal
searchPatternPush: $(Build.ArtifactStagingDirectory)/*.nupkg
- task: VSBuild@1
name: ''
displayName: Build client.sln for Loc and Tests
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
solution: src/client.sln
msbuildArgs: -p:Localize=true -p:ConsumeEndpointManager=false
configuration: ${{ parameters.BuildConfiguration }}
- task: VSTest@2
displayName: Run Unit Tests
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
testAssemblyVer2: '**\bin\${{ parameters.BuildConfiguration }}\*\*Tests.dll'
runSettingsFile: tests/unittests/dotnetcore.runsettings
runInParallel: true
codeCoverageEnabled: True
testRunTitle: Unit Tests
failOnMinTestsNotRun: true
rerunFailedTests: true
- task: CopyFiles@2
displayName: Collect Loc files
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
Contents: >-
src/*/bin/*/*/localize/**/*
src/*/bin/**/*.lce
src/dsc/bin/*/*/dsc.dll
src/endpointmanager/bin/*/*/endpointmanager.dll
src/common/bin/*/*/Microsoft.BridgeToKubernetes.Common.dll
src/library/bin/*/*/Microsoft.BridgeToKubernetes.Library.dll
TargetFolder: $(Build.ArtifactStagingDirectory)/Loc
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Loc'
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/Loc
ArtifactName: Loc
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: publish DSC (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm 64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher(Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher for arm64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/EndpointManagerLauncher
OverWrite: true
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder for arm 64
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/EndpointManagerLauncher
OverWrite: true
- task: DotNetCoreCLI@2
displayName: publish DSC (OSX)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (OSX)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC (Linux)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-x64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Linux)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-arm64 --no-restore --self-contained true --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: PowerShell@2
displayName: Download kubectl
continueOnError: True
enabled: True
inputs:
targetType: inline
script: >
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/amd64/kubectl.exe -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win/kubectl.exe
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/amd64/kubectl -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx/kubectl
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl' -ItemType Directory
New-Item -Path './src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -OutFile ./src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux/kubectl
- task: PowerShell@2
displayName: Download kubectl for arm64
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/arm64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx/kubectl
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux/kubectl
- task: VSBuild@1
name: ''
displayName: Sign Files
enabled: True
inputs:
solution: src/client.signproj
msbuildArgs: /t:SignFiles /p:SignType=real
configuration: '${{ parameters.BuildConfiguration }} '
- task: CopyFiles@2
displayName: Collect files for .zip (Windows)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/win
- task: CopyFiles@2
displayName: Collect files for .zip (Windows) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/winarm64
- task: CopyFiles@2
displayName: Collect files for .zip (OSX)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osx
- task: CopyFiles@2
displayName: Collect files for .zip (OSX) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osxarm64
- task: CopyFiles@2
displayName: Collect files for .zip (Linux)
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linux
- task: CopyFiles@2
displayName: Collect files for .zip (Linux) for arm64
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linuxarm64
- task: ArchiveFiles@2
displayName: Create .zip file (Windows)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/win
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Windows) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/winarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win-arm64.zip
- task: ArchiveFiles@2
displayName: Create .zip file (OSX)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osx
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx.zip
- task: ArchiveFiles@2
displayName: Create .zip file (OSX) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx-arm64.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Linux)
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linux
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Linux) for arm64
enabled: True
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linuxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux-arm64.zip
- task: PowerShell@2
displayName: Generate lks.json for .zip files
enabled: True
inputs:
targetType: inline
script: >-
$ZipHost = "mindaromaster.blob.core.windows.net"
$BlobUrl = "https://$ZipHost/zip/1.0.$env:BUILD_BUILDNUMBER"
$ZipDir = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/zip"
$Win = @{ url="$BlobUrl/lpk-win.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win.zip).Hash)" }
$OSX = @{ url="$BlobUrl/lpk-osx.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx.zip).Hash)" }
$Linux = @{ url="$BlobUrl/lpk-linux.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux.zip).Hash)" }
$Win_Arm64 = @{ url="$BlobUrl/lpk-win-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win-arm64.zip).Hash)" }
$OSX_Arm64 = @{ url="$BlobUrl/lpk-osx-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx-arm64.zip).Hash)" }
$Linux_Arm64 = @{ url="$BlobUrl/lpk-linux-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux-arm64.zip).Hash)" }
$Json = @{ version="1.0.$env:BUILD_BUILDNUMBER"; win = $Win; osx = $OSX; linux = $Linux; win_arm64 = $Win_Arm64; linux_arm64 = $Linux_Arm64; osx_arm64 = $OSX_Arm64 } | ConvertTo-Json
$Json | Out-File -FilePath $ZipDir/lks.json -Encoding ascii
New-Item -ItemType directory -Path $ZipDir/1.0.$env:BUILD_BUILDNUMBER
$Json | Out-File -FilePath $ZipDir/1.0.$env:BUILD_BUILDNUMBER/lks.json -Encoding ascii
Write-Host $Json
- task: ManifestGeneratorTask@0
displayName: Manifest Generator for zip
enabled: True
inputs:
BuildDropPath: $(Build.ArtifactStagingDirectory)/zip
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: zip'
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: zip
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack CLI NuGet (Windows)'
inputs:
command: pack
feedsToUse: config
packagesToPack: src/dsc/dsc.csproj
packDirectory: '$(Build.ArtifactStagingDirectory)/nuget'
nobuild: true
buildProperties: 'Configuration=${{ parameters.BuildConfiguration }};NuspecFile=bin\${{ parameters.BuildConfiguration }}\$(BuildParameters.dotnetversionforbuild)\win-x64\publish\dsc.nuspec'
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Manifest Generator for nuget'
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)/nuget'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: nuget'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
ArtifactName: nuget
- task: CodeSign@1
displayName: Validate Signatures nuget
inputs:
Path: '$(Build.ArtifactStagingDirectory)/nuget'
- task: CopyFiles@2
displayName: Collect Build Symbols - dsc
enabled: True
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)
Contents: >-
*/publish/dsc.?(pdb|exe|dll|)
*/publish/Microsoft.BridgeToKubernetes.*.@(pdb|exe|dll|)
*/publish/EndpointManager/EndpointManager.?(pdb|exe|dll|)
*/publish/EndpointManager/Microsoft.BridgeToKubernetes.*.@(pdb|exe|dll|)
TargetFolder: $(Build.ArtifactStagingDirectory)/symbols
OverWrite: true
- task: PublishSymbols@2
displayName: Enable Source Server
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
SymbolsFolder: $(Build.ArtifactStagingDirectory)/symbols
SearchPattern: '**/*.pdb'
SymbolServerType: TeamServices
- task: CopyFiles@2
displayName: Copy buildWindowsPDBs.ps1 to artifact directory
enabled: True
inputs:
SourceFolder: build
Contents: buildWindowsPDBs.ps1
TargetFolder: $(Build.ArtifactStagingDirectory)/symbols/
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: symbols'
condition: and(succeeded(), eq(variables.RunTests, 'true'))
enabled: True
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/symbols
ArtifactName: symbols
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
- task: tagBuildOrRelease@0
displayName: Tag BuildConfiguration
enabled: True
inputs:
tags: 'BuildConfiguration: ${{ parameters.BuildConfiguration }}'
- task: SdtReport@2
inputs:
GdnExportAllTools: true
GdnExportHtmlFile: true
- task: PublishSecurityAnalysisLogs@3
inputs:
ArtifactName: 'CodeAnalysisLogs'
ArtifactType: 'Container'
AllTools: true
ToolLogsNotFoundAction: 'Standard'
- task: PostAnalysis@2
inputs:
GdnBreakAllTools: true
GdnBreakFast: true
- job: Phase_2
displayName: Run NON self-contained build (binaries V2, where the binaries are downloaded in parallel)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
demands:
- msbuild
- visualstudio
- vstest
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: PowerShell@2
displayName: Set staging/prod build vars for signing and telemetry
inputs:
targetType: inline
script: >-
$branchName = $env:BUILD_SOURCEBRANCH
if ($branchName -eq "refs/heads/main") {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for main branch"
} else {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for other branch"
}
Write-Host "##vso[task.setvariable variable=MicroBuild_NuPkgSigningEnabled;]true"
- task: MicroBuildSigningPlugin@3
displayName: Install Signing Plugin
enabled: True
inputs:
signType: real
zipSources: false
- task: MicroBuildLocalizationPlugin@3
displayName: Install Localization Plugin
- task: UseDotNet@2
displayName: Use .NET Core SDK 7.0.X
inputs:
version: $(BuildParameters.dotnetversion)
installationPath: $(Agent.TempDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: restore EndpointManager (Windows) (to download runtime pack)
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-x64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: restore EndpointManager for ARM 64 (Windows) (to download runtime pack)
inputs:
command: restore
projects: src\endpointmanager\endpointmanager.csproj
restoreArguments: -r win-arm64
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: NuGetToolInstaller@1
displayName: Use NuGet 6.1.x
inputs:
versionSpec: 6.1.x
- task: NuGetCommand@2
displayName: NuGet restore client.sln
inputs:
solution: src/client.sln
selectOrConfig: config
nugetConfigPath: src/nuget.config
externalEndpoints: dba0ba50-2d4e-4f12-9f5a-42a638da803b
- task: DotNetCoreCLI@2
displayName: publish DSC (Windows)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --self-contained false --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Windows)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --self-contained false --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher(Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-x64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: DotNetCoreCLI@2
displayName: publish EndpointManagerLauncher for arm64 (Windows)
enabled: True
inputs:
command: publish
publishWebProjects: false
projects: src\EndpointManagerLauncher\endpointmanagerlauncher.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r win-arm64 --no-restore --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
selectOrConfig: config
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/EndpointManagerLauncher
OverWrite: true
- task: CopyFiles@2
displayName: Copy EndpointManager Launcher to dsc folder for arm64
enabled: True
inputs:
SourceFolder: src/EndpointManagerLauncher/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/
Contents: >-
**/*
!**/*.pdb
TargetFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/EndpointManagerLauncher
OverWrite: true
- task: DotNetCoreCLI@2
displayName: publish DSC (OSX)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-x64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC (Linux)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-x64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (Linux)
inputs:
command: publish
publishWebProjects: false
projects: src\dsc\dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r linux-arm64 --no-restore --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: PowerShell@2
displayName: Download kubectl
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/amd64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/darwin/amd64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish/kubectl/osx/kubectl
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish/kubectl/linux/kubectl
- task: PowerShell@2
displayName: Download kubectl for arm64
continueOnError: True
inputs:
targetType: inline
script: >
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/windows/arm64/kubectl.exe -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish/kubectl/win/kubectl.exe
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl' -ItemType Directory
New-Item -Path '$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux' -ItemType Directory
curl https://dl.k8s.io/release/v1.27.3/bin/linux/arm64/kubectl -OutFile $(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish/kubectl/linux/kubectl
- task: VSBuild@1
displayName: Sign Files
enabled: True
inputs:
solution: src/client.signproj
msbuildArgs: /t:SignFiles /p:SignType=real
configuration: '${{ parameters.BuildConfiguration }} '
- task: CopyFiles@2
displayName: Collect files for .zip (Windows)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-x64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/win
- task: CopyFiles@2
displayName: Collect files for .zip for arm64 (Windows)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/win-arm64/publish
Contents: >-
**/*
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/winarm64
- task: CodeSign@1
displayName: Validate Signatures
inputs:
Path: '$(Agent.TempDirectory)/zip/win'
- task: CodeSign@1
displayName: Validate Signatures for arm64
inputs:
Path: '$(Agent.TempDirectory)/zip/winarm64'
- task: CopyFiles@2
displayName: Collect files for .zip (OSX)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osx
- task: CodeSign@1
displayName: Validate Signatures OSX
inputs:
Path: '$(Agent.TempDirectory)/zip/osx'
- task: CopyFiles@2
displayName: Collect files for .zip (Linux)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-x64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linux
- task: CopyFiles@2
displayName: Collect files for .zip for arm64 (Linux)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/linux-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/linuxarm64
- task: CodeSign@1
displayName: Validate Signatures linux
inputs:
Path: '$(Agent.TempDirectory)/zip/linux'
- task: CodeSign@1
displayName: Validate Signatures linux for arm64
inputs:
Path: '$(Agent.TempDirectory)/zip/linuxarm64'
- task: ArchiveFiles@2
displayName: Create .zip file (Windows)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/win
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win.zip
- task: ArchiveFiles@2
displayName: Create .zip file for arm64 (Windows)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/winarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-win-arm64.zip
- task: ArchiveFiles@2
displayName: Create .zip file (OSX)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osx
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx.zip
- task: ArchiveFiles@2
displayName: Create .zip file (Linux)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linux
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux.zip
- task: ArchiveFiles@2
displayName: Create .zip file for arm64 (Linux)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/linuxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-linux-arm64.zip
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: zipv2'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: zipv2
- task: SdtReport@2
inputs:
GdnExportAllTools: true
GdnExportHtmlFile: true
- task: PublishSecurityAnalysisLogs@3
inputs:
ArtifactName: 'CodeAnalysisLogs'
ArtifactType: 'Container'
AllTools: true
ToolLogsNotFoundAction: 'Standard'
- task: PostAnalysis@2
inputs:
GdnBreakAllTools: true
GdnBreakFast: true
- job: Phase_3
displayName: Run NON self-contained build for macos arm64
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
pool:
vmImage: macos-13-arm64
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: PowerShell@2
displayName: Set staging/prod build vars for signing and telemetry
inputs:
targetType: inline
script: >-
$branchName = $env:BUILD_SOURCEBRANCH
if ($branchName -eq "refs/heads/main") {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for main branch"
} else {
Write-Host "##vso[task.setvariable variable=TelemetryType;]${{ parameters.TelemetryType }}"
Write-Host "Done setting telemetry key instance as ${{ parameters.TelemetryType }} for other branch"
}
Write-Host "##vso[task.setvariable variable=MicroBuild_NuPkgSigningEnabled;]true"
- task: UseDotNet@2
displayName: Use .NET Core SDK 7.0.X
inputs:
version: $(BuildParameters.dotnetversion)
installationPath: $(Agent.TempDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: publish DSC for arm64 (OSX)
inputs:
command: publish
publishWebProjects: false
projects: src/dsc/dsc.csproj
arguments: -c ${{ parameters.BuildConfiguration }} -r osx-arm64 --self-contained false --verbosity detailed
zipAfterPublish: false
modifyOutputPath: false
- task: Bash@3
displayName: Download kubectl for OSX arm64
inputs:
targetType: 'inline'
script: |
mkdir -p "$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx"
curl -L https://dl.k8s.io/release/v1.27.3/bin/darwin/arm64/kubectl -o "$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/kubectl/osx/kubectl"
- task: Bash@3
displayName: code sign for OSX arm64
inputs:
targetType: 'inline'
script: |
codesign --force --deep --sign - "$(Build.SourcesDirectory)/src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish/dsc"
- task: CopyFiles@2
displayName: Collect files for .zip for arm64 (OSX)
inputs:
SourceFolder: src/dsc/bin/${{ parameters.BuildConfiguration }}/$(BuildParameters.dotnetversionforbuild)/osx-arm64/publish
Contents: >-
**/*
src/resources/license.rtf
src/vscode/ThirdPartyNotices.txt
!**/*.pdb
!**/*.xml
!**/*.nuspec
!**/cs/*
!**/de/*
!**/es/*
!**/fr/*
!**/it/*
!**/ja/*
!**/ko/*
!**/pl/*
!**/pt-BR/*
!**/ru/*
!**/tr/*
!**/zh-Hans/*
!**/zh-Hant/*
TargetFolder: $(Agent.TempDirectory)/zip/osxarm64
- task: ArchiveFiles@2
displayName: Create .zip file for arm64 (OSX)
inputs:
rootFolderOrFile: $(Agent.TempDirectory)/zip/osxarm64
includeRootFolder: false
sevenZipCompression: 5
archiveFile: $(Build.ArtifactStagingDirectory)/zip/lpk-osx-arm64.zip
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: zipv2'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: zipv2
- job: Phase_4
displayName: "Generate Lks.json for zipv2"
dependsOn: ["Phase_3", "Phase_2"]
pool:
name: 'VSEngSS-MicroBuild2022-1ES'
demands:
- msbuild
- visualstudio
- vstest
steps:
- task: DownloadBuildArtifacts@1
displayName: Download artifacts
inputs:
downloadPath: $(Build.ArtifactStagingDirectory)/zip
artifactName: zipv2
- task: PowerShell@2
displayName: Generate lks.json for .zip files
inputs:
targetType: inline
script: >
$ZipHost = "mindaromaster.blob.core.windows.net"
$BlobUrl = "https://$ZipHost/zipv2/1.0.$env:BUILD_BUILDNUMBER"
$BlobLKSUrl = "https://$ZipHost/zipv2/LKS"
$ZipDir = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/zip/zipv2/"
# CLI binaries
$Cli_Win = @{ url="$BlobUrl/lpk-win.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win.zip).Hash)" }
$Cli_Osx = @{ url="$BlobUrl/lpk-osx.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx.zip).Hash)" }
$Cli_Linux = @{ url="$BlobUrl/lpk-linux.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux.zip).Hash)" }
# CLI binaries for arm64
$Cli_Win_Arm64 = @{ url="$BlobUrl/lpk-win-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-win-arm64.zip).Hash)" }
$Cli_Osx_Arm64 = @{ url="$BlobUrl/lpk-osx-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-osx-arm64.zip).Hash)" }
$Cli_Linux_Arm64 = @{ url="$BlobUrl/lpk-linux-arm64.zip"; sha256hash="$((Get-FileHash $ZipDir\lpk-linux-arm64.zip).Hash)" }
# Kubectl binaries
$Kubectl_Win = @{ url="$BlobLKSUrl/kubectl-win.zip"; sha256hash="5490F9B60E4C2C4229CA00FBFA946AE65655F0739BE9714C6A0A0FB7BE2A6F2C" }
$Kubectl_Osx = @{ url="$BlobLKSUrl/kubectl-osx.zip"; sha256hash="D24EAFEC39EB2393DBA0088B762953BEDCC04156AC9E324FA290476BD3C888B9" }
$Kubectl_Linux = @{ url="$BlobLKSUrl/kubectl-linux.zip"; sha256hash="01B76D4E4A9081452932F27C767C9D8F3507C8AD3CC9269CEB16729F4D0ED900" }
# Kubectl binaries for arm64
$Kubectl_Win_Arm64 = @{ url="$BlobLKSUrl/kubectl-win-arm64.zip"; sha256hash="5490F9B60E4C2C4229CA00FBFA946AE65655F0739BE9714C6A0A0FB7BE2A6F2C" }
$Kubectl_Osx_Arm64 = @{ url="$BlobLKSUrl/kubectl-osx-arm64.zip"; sha256hash="D24EAFEC39EB2393DBA0088B762953BEDCC04156AC9E324FA290476BD3C888B9" }
$Kubectl_Linux_Arm64 = @{ url="$BlobLKSUrl/kubectl-linux-arm64.zip"; sha256hash="01B76D4E4A9081452932F27C767C9D8F3507C8AD3CC9269CEB16729F4D0ED900" }
#dotnet runtime binaries
$Dotnet_Win = @{ url="$BlobLKSUrl/dotnetruntime-win.zip"; sha256hash="0FCA9F2AB829C85615007EA646CF436D2E90C9A4095C84C2F9EB3EC0754468A8" }
$Dotnet_Osx = @{ url="$BlobLKSUrl/dotnetruntime-osx.zip"; sha256hash="D25F8BB708C364678AAA0F3798F5EADD1BE46800376F15D2F12C785C74AF8443" }
$Dotnet_Linux = @{ url="$BlobLKSUrl/dotnetruntime-linux.zip"; sha256hash="801D9D251D07B9A88195450FCBFD70C7507CEEEF05D5F0E88CC14CEBFCC10F4B" }
#dotnet runtime binaries for arm64
$Dotnet_Win_Arm64 = @{ url="$BlobLKSUrl/dotnetruntime-win-arm64.zip"; sha512hash="902488cbfee81dd5e1009eb86ab82d479ed7d9c44e4e4b6bb3df90a68eea65c0140978b02f46f9f6d0847466e1de73e9551688a79082e0679350a46276f441f9" }
$Dotnet_Osx_Arm64 = @{ url="$BlobLKSUrl/dotnetruntime-osx-arm64.zip"; sha512hash="e6979ab34bea777f1f48bf9208a024b33b1685ec236f13c609975ebc7e1f641806b47daefb9ff1f74f675ee6242b628edd615982bc9c014d18e18cd2662171a8" }
$Dotnet_Linux_Arm64 = @{ url="$BlobLKSUrl/dotnetruntime-linux-arm64.zip"; sha512hash="814db12231db89d9935404ec6693b3fb50ad022c0affbc131d657878e194274f1af5e92dd32c2c4f2a78a7e38d0c18a46ba4ecc67630ca3adf5b7550367c2366" }
# Win Json
$Win = @{ dotnetruntime = $Dotnet_Win; kubectl = $Kubectl_Win; bridge = $Cli_Win }
# Win Json for arm64
$Win_Arm64 = @{ dotnetruntime = $Dotnet_Win_Arm64; kubectl = $Kubectl_Win_Arm64; bridge = $Cli_Win_Arm64 }
# OSX Json
$OSX = @{ dotnetruntime = $Dotnet_Osx; kubectl = $Kubectl_Osx; bridge = $Cli_Osx }
# OSX Json for arm64
$OSX_Arm64 = @{ dotnetruntime = $Dotnet_Osx_Arm64; kubectl = $Kubectl_Osx_Arm64; bridge = $Cli_Osx_Arm64 }
# Linux Json
$Linux = @{ dotnetruntime = $Dotnet_Linux; kubectl = $Kubectl_Linux; bridge = $Cli_Linux }
# Linux Json for arm64
$Linux_Arm64 = @{ dotnetruntime = $Dotnet_Linux_Arm64; kubectl = $Kubectl_Linux_Arm64; bridge = $Cli_Linux_Arm64 }
$Json = @{ version="1.0.$env:BUILD_BUILDNUMBER"; win = $Win; osx = $OSX; linux = $Linux; win_arm64 = $Win_Arm64; osx_arm64 = $OSX_Arm64; linux_arm64 = $Linux_Arm64} | ConvertTo-Json
$Json | Out-File -FilePath $ZipDir/lks.json -Encoding ascii
New-Item -ItemType directory -Path $ZipDir/1.0.$env:BUILD_BUILDNUMBER
$Json | Out-File -FilePath $ZipDir/1.0.$env:BUILD_BUILDNUMBER/lks.json -Encoding ascii
Write-Host $Json
- task: ManifestGeneratorTask@0
displayName: Manifest Generator for zip
inputs:
BuildDropPath: $(Build.ArtifactStagingDirectory)/zip/
- task: PublishBuildArtifacts@1
displayName: Publish lks.json for zipv2
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: zipv2
...