mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Merged PR 5716: Port changes to allow AzDevOps NuGet feeds for Mac build
This commit is contained in:
@@ -762,6 +762,7 @@ function New-UnixPackage {
|
||||
$ManGzipInfo = New-ManGzip -IsPreview:$IsPreview
|
||||
|
||||
# Change permissions for packaging
|
||||
Write-Log "Setting permissions..."
|
||||
Start-NativeExecution {
|
||||
find $Staging -type d | xargs chmod 755
|
||||
find $Staging -type f | xargs chmod 644
|
||||
@@ -774,6 +775,7 @@ function New-UnixPackage {
|
||||
# Add macOS powershell launcher
|
||||
if ($Type -eq "osxpkg")
|
||||
{
|
||||
Write-Log "Adding macOS launch opplication..."
|
||||
if ($pscmdlet.ShouldProcess("Add macOS launch application"))
|
||||
{
|
||||
# Generate launcher app folder
|
||||
@@ -811,10 +813,12 @@ function New-UnixPackage {
|
||||
# Build package
|
||||
try {
|
||||
if ($pscmdlet.ShouldProcess("Create $type package")) {
|
||||
Write-Log "Creating package with fpm..."
|
||||
$Output = Start-NativeExecution { fpm $Arguments }
|
||||
}
|
||||
} finally {
|
||||
if ($Environment.IsMacOS) {
|
||||
Write-Log "Starting Cleanup for mac packaging..."
|
||||
if ($pscmdlet.ShouldProcess("Cleanup macOS launcher"))
|
||||
{
|
||||
Clear-MacOSLauncher
|
||||
@@ -1193,6 +1197,7 @@ function New-ManGzip
|
||||
$IsPreview
|
||||
)
|
||||
|
||||
Write-Log "Creating man gz..."
|
||||
# run ronn to convert man page to roff
|
||||
$RonnFile = Join-Path $PSScriptRoot "/../../assets/pwsh.1.ronn"
|
||||
if ($IsPreview.IsPresent)
|
||||
@@ -1205,7 +1210,8 @@ function New-ManGzip
|
||||
$RoffFile = $RonnFile -replace "\.ronn$"
|
||||
|
||||
# Run ronn on assets file
|
||||
Start-NativeExecution { ronn --roff $RonnFile } -VerboseOutputOnError
|
||||
Write-Log "Creating man gz - running ronn..."
|
||||
Start-NativeExecution { ronn --roff $RonnFile }
|
||||
|
||||
if ($IsPreview.IsPresent)
|
||||
{
|
||||
@@ -1214,6 +1220,7 @@ function New-ManGzip
|
||||
|
||||
# gzip in assets directory
|
||||
$GzipFile = "$RoffFile.gz"
|
||||
Write-Log "Creating man gz - running gzip..."
|
||||
Start-NativeExecution { gzip -f $RoffFile } -VerboseOutputOnError
|
||||
|
||||
$ManFile = Join-Path "/usr/local/share/man/man1" (Split-Path -Leaf $GzipFile)
|
||||
|
||||
@@ -29,27 +29,15 @@ param (
|
||||
[switch] $Build
|
||||
)
|
||||
|
||||
# We must build in /PowerShell
|
||||
$repoRoot = '/PowerShell'
|
||||
if ($BootStrap.IsPresent) {
|
||||
$repoRoot = $location
|
||||
}
|
||||
$repoRoot = $location
|
||||
|
||||
if ($Build.IsPresent) {
|
||||
# cleanup the folder but don't delete it or the build agent will loose ownership of the folder
|
||||
Write-Verbose -Message "cleaning /PowerShell" -Verbose
|
||||
Get-ChildItem -Path /PowerShell/* -Attributes Hidden, Normal, Directory | Remove-Item -Recurse -Force
|
||||
|
||||
# clone the repository to the location we must build from
|
||||
Write-Verbose -Message "cloning to /PowerShell" -Verbose
|
||||
git clone $location /PowerShell
|
||||
$releaseTagParam = @{}
|
||||
if ($ReleaseTag) {
|
||||
$releaseTagParam = @{ 'ReleaseTag' = $ReleaseTag }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Push-Location
|
||||
try {
|
||||
Write-Verbose -Message "Init..." -Verbose
|
||||
|
||||
@@ -14,16 +14,6 @@ steps:
|
||||
scriptPath: 'tools/releaseBuild/setReleaseTag.sh'
|
||||
args: '-ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"'
|
||||
displayName: 'Calculate Release Tag'
|
||||
- powershell: |
|
||||
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
|
||||
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules
|
||||
|
||||
if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config"))
|
||||
{
|
||||
throw "nuget.config is not created"
|
||||
}
|
||||
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
|
||||
condition: ne(Variables['SkipFxDependent'], 'true')
|
||||
- task: ShellScript@2
|
||||
inputs:
|
||||
scriptPath: 'tools/installpsh-osx.sh'
|
||||
@@ -32,13 +22,26 @@ steps:
|
||||
inputs:
|
||||
scriptPath: 'tools/releaseBuild/macOS/createPowerShell.sh'
|
||||
displayName: 'Create /PowerShell'
|
||||
- powershell: |
|
||||
Write-Host "##vso[task.setvariable variable=PowerShellRoot]/PowerShell"
|
||||
git clone $env:BUILD_REPOSITORY_LOCALPATH /PowerShell
|
||||
displayName: Clone PowerShell Repo to /PowerShell
|
||||
- task: ShellScript@2
|
||||
inputs:
|
||||
scriptPath: 'tools/releaseBuild/macOS/PowerShellPackageVsts.sh'
|
||||
args: '-location $(Build.SourcesDirectory) -BootStrap'
|
||||
args: '-location $(PowerShellRoot) -BootStrap'
|
||||
displayName: 'Bootstrap VM'
|
||||
- powershell: |
|
||||
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
|
||||
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination "$(PowerShellRoot)/src/Modules"
|
||||
|
||||
if(-not (Test-Path "$(PowerShellRoot)/src/Modules/nuget.config"))
|
||||
{
|
||||
throw "nuget.config is not created"
|
||||
}
|
||||
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
|
||||
- powershell: |
|
||||
$env:AZDEVOPSFEEDPAT = '$(AzDevOpsFeedPAT)'
|
||||
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -ExtraPackage "tar" -location $(Build.SourcesDirectory) -Build
|
||||
$(Build.SourcesDirectory)/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 -ReleaseTag $(ReleaseTagVar) -Destination $(System.ArtifactsDirectory) -ExtraPackage "tar" -location $(PowerShellRoot) -Build
|
||||
$env:AZDEVOPSFEEDPAT = $null
|
||||
displayName: 'Build and Package'
|
||||
|
||||
Reference in New Issue
Block a user