mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Update the universal build with framework dependent package for dotnet sdk (#8773)
Update the universal build to also build the framework package needed for the dotnet sdk container image. ## PR Context We build the package in individual builds. This change brings over the steps in the universal build.
This commit is contained in:
committed by
Travis Plunk
parent
5581c0a0ed
commit
53c76d1658
@@ -3090,7 +3090,12 @@ function New-DotnetSdkContainerFxdPackage {
|
||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||
param(
|
||||
[Parameter(Mandatory)] $FxdPackagePath,
|
||||
[Parameter(Mandatory)] $ReleaseTag
|
||||
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory)] $ReleaseTag,
|
||||
|
||||
[Parameter(Mandatory)] $DestinationPath
|
||||
)
|
||||
|
||||
$Version = $ReleaseTag -Replace '^v'
|
||||
@@ -3109,9 +3114,10 @@ function New-DotnetSdkContainerFxdPackage {
|
||||
Write-Log "fxdPackagePath: $FxdPackagePath"
|
||||
|
||||
$packageName = "powershell-$Version-$packageNamePlatform-fxd-dotnetsdk$packageNameExtension"
|
||||
$destinationPackageFullName = Join-Path $DestinationPath $packageName
|
||||
|
||||
## Get fxdependent package path
|
||||
$fxdPackage = (Get-ChildItem $FxdPackagePath -Recurse -Filter $basePackagePattern).FullName
|
||||
$fxdPackage = Get-ChildItem $FxdPackagePath -Recurse -Filter $basePackagePattern.FullName | Select-Object -First 1 -ExpandProperty FullName
|
||||
|
||||
Write-Log "Fxd Package Path: $fxdPackage"
|
||||
|
||||
@@ -3152,10 +3158,14 @@ function New-DotnetSdkContainerFxdPackage {
|
||||
|
||||
Write-Verbose -Verbose "Compressing"
|
||||
|
||||
if (-not (Test-Path $DestinationPath)) {
|
||||
$null = New-Item -ItemType Directory -Path $DestinationPath
|
||||
}
|
||||
|
||||
if ($Environment.IsWindows) {
|
||||
Compress-Archive -Path "$FxdPackagePath/fxdreduced/*" -Destination $FxdPackagePath/$packageName
|
||||
Compress-Archive -Path "$FxdPackagePath/fxdreduced/*" -Destination $destinationPackageFullName -Force
|
||||
} else {
|
||||
Start-NativeExecution { tar -czf "$FxdPackagePath/$packageName" . }
|
||||
Start-NativeExecution { tar -czf "$destinationPackageFullName" . }
|
||||
}
|
||||
|
||||
Write-Log "Compressing complete"
|
||||
@@ -3166,19 +3176,9 @@ function New-DotnetSdkContainerFxdPackage {
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path "$FxdPackagePath/$packageName") {
|
||||
$containerName = if ($Environment.IsWindows)
|
||||
{
|
||||
"signedResults"
|
||||
}
|
||||
else
|
||||
{
|
||||
"release"
|
||||
}
|
||||
|
||||
Write-Host "##vso[artifact.upload containerfolder=$containerName;artifactname=$containerName]$FxdPackagePath/$packageName"
|
||||
|
||||
if (Test-Path $destinationPackageFullName) {
|
||||
Write-Host "##vso[artifact.upload containerfolder=release;artifactname=release]$destinationPackageFullName"
|
||||
} else {
|
||||
Write-Log "Package not found: $FxdPackagePath/$packageName"
|
||||
Write-Log "Package not found: $destinationPackageFullName"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,13 @@ jobs:
|
||||
parameters:
|
||||
buildName: alpine
|
||||
|
||||
- template: templates/dotnetsdk-fxdependent.yml
|
||||
parameters:
|
||||
parentJobs:
|
||||
- build_fxdependent
|
||||
poolName: Hosted Ubuntu 1604
|
||||
buildName: Linux
|
||||
|
||||
- template: templates/mac.yml
|
||||
|
||||
- template: templates/windows-build.yml
|
||||
@@ -58,6 +65,13 @@ jobs:
|
||||
parameters:
|
||||
Architecture: fxdependent
|
||||
|
||||
- template: templates/dotnetsdk-fxdependent.yml
|
||||
parameters:
|
||||
parentJobs:
|
||||
- WinPackageSigningJob
|
||||
poolName: Package ES CodeHub Lab E
|
||||
buildName: Windows
|
||||
|
||||
- template: templates/windows-component-governance.yml
|
||||
|
||||
- template: templates/windows-package-signing.yml
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
parameters:
|
||||
parentJobs: []
|
||||
poolName: Hosted Ubuntu 1604
|
||||
buildName: Linux-x64
|
||||
|
||||
jobs:
|
||||
- job: dotnetfxd_${{ parameters.buildName }}
|
||||
displayName: Create fxdependent package dotnet sdk - ${{ parameters.buildName }}
|
||||
dependsOn:
|
||||
${{ parameters.parentJobs }}
|
||||
condition: succeeded()
|
||||
pool: ${{ parameters.poolName }}
|
||||
steps:
|
||||
|
||||
- powershell: |
|
||||
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
|
||||
displayName: 'Run setReleaseTag.ps1'
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: 'Download Artifacts'
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: |
|
||||
**/*.tar.gz
|
||||
**/*.zip
|
||||
downloadPath: '$(System.ArtifactsDirectory)/finished'
|
||||
|
||||
- powershell: |
|
||||
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
|
||||
Import-Module $(Build.SourcesDirectory)/tools/packaging -Force
|
||||
New-DotnetSdkContainerFxdPackage -FxdPackagePath "$(System.ArtifactsDirectory)/finished" -ReleaseTag $(ReleaseTagVar) -DestinationPath "$(System.ArtifactsDirectory)/finished/release"
|
||||
displayName: 'Create fxdependent package for dotnet sdk docker image'
|
||||
|
||||
- powershell: |
|
||||
$azureVersion = '$(ReleaseTagVar)'.ToLowerInvariant() -replace '\.', '-'
|
||||
$vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion-internal"
|
||||
Write-Host "sending " + $vstsCommandString
|
||||
Write-Host "##$vstsCommandString"
|
||||
displayName: 'Set Version for Blob Storage'
|
||||
|
||||
- job:
|
||||
displayName: Upload fxdependent package dotnet sdk - ${{ parameters.buildName }}
|
||||
dependsOn: dotnetfxd_${{ parameters.buildName }}
|
||||
condition: succeeded()
|
||||
pool: Package ES CodeHub Lab E
|
||||
steps:
|
||||
|
||||
- powershell: |
|
||||
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
|
||||
displayName: 'Run setReleaseTag.ps1'
|
||||
|
||||
- powershell: |
|
||||
$azureVersion = '$(ReleaseTagVar)'.ToLowerInvariant() -replace '\.', '-'
|
||||
$vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion-internal"
|
||||
Write-Host "sending " + $vstsCommandString
|
||||
Write-Host "##$vstsCommandString"
|
||||
displayName: 'Set Version for Blob Storage'
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: 'Download FxDependent dotnet sdx artifacts'
|
||||
inputs:
|
||||
downloadType: specific
|
||||
itemPattern: |
|
||||
**/*fxd-dotnetsdk.zip
|
||||
**/*fxd-dotnetsdk.tar.gz
|
||||
downloadPath: '$(System.ArtifactsDirectory)'
|
||||
condition: succeeded()
|
||||
|
||||
- powershell: |
|
||||
Get-ChildItem '$(System.ArtifactsDirectory)\release'
|
||||
displayName: Capture list of downloaded artifacts
|
||||
|
||||
- task: AzureFileCopy@1
|
||||
displayName: 'Upload to azure'
|
||||
inputs:
|
||||
SourcePath: '$(System.ArtifactsDirectory)\release'
|
||||
azureSubscription: '$(AzureFileCopySubscription)'
|
||||
Destination: AzureBlob
|
||||
storage: '$(StorageAccount)'
|
||||
ContainerName: '$(AzureVersion)'
|
||||
Reference in New Issue
Block a user