Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/test/linux-packaging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
- name: Bootstrap
run: |-
Import-Module ./build.psm1
Start-PSBootstrap -Package
Start-PSBootstrap -Scenario Package
shell: pwsh
- name: Capture Artifacts Directory
continue-on-error: true
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/test/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ runs:
run: Get-ChildItem "${{ github.workspace }}\build\*" -Recurse
shell: pwsh

- uses: actions/setup-dotnet@v4
with:
global-json-file: .\global.json

- name: Bootstrap
shell: powershell
run: |-
Expand All @@ -50,7 +54,6 @@ runs:
if: success()
run: |-
Import-Module .\build.psm1 -force
Start-PSBootstrap
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '${{ github.workspace }}\build\psoptions.json'
$options = (Get-PSOptions)
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 1000

- name: Build
uses: "./.github/actions/build/ci"
linux_test_unelevated_ci:
Expand Down Expand Up @@ -187,6 +188,10 @@ jobs:
with:
fetch-depth: '0'

- uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
if: success() || failure()
run: |-
import-module ./build.psm1
start-psbootstrap -package
start-psbootstrap -Scenario package
shell: pwsh
ready_to_merge:
name: macos ready to merge
Expand Down
14 changes: 6 additions & 8 deletions .pipelines/templates/compliance/apiscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ jobs:
parameters:
repoRoot: '$(repoRoot)'

- pwsh: |
Import-Module .\build.psm1 -force
Start-PSBootstrap
workingDirectory: '$(repoRoot)'
retryCountOnTaskFailure: 2
displayName: 'Bootstrap'
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(Build.SourcesDirectory)"

- pwsh: |
Import-Module .\build.psm1 -force
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/linux-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
Import-Module "$repoRoot/build.psm1"
Import-Module "$repoRoot/tools/packaging"
Start-PSBootstrap -Package
Start-PSBootstrap -Scenario Package
$psOptionsPath = "$(Pipeline.Workspace)/CoOrdinatedBuildPipeline/${unsignedDrop}/psoptions/psoptions.json"
Expand Down
8 changes: 7 additions & 1 deletion .pipelines/templates/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ jobs:
AnalyzeInPipeline: true
Language: csharp

- task: UseDotNet@2
inputs:
useGlobalJson: true
workingDirectory: $(PowerShellRoot)
env:
ob_restore_phase: true

- pwsh: |
$runtime = $env:RUNTIME
Expand All @@ -75,7 +82,6 @@ jobs:
Import-Module -Name $(PowerShellRoot)/build.psm1 -Force
$buildWithSymbolsPath = New-Item -ItemType Directory -Path $(Pipeline.Workspace)/Symbols_$(Runtime) -Force
Start-PSBootstrap
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
$ReleaseTagParam = @{}
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/mac-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
Write-Verbose -Message "LTS Release: $LTS"
}

Start-PSBootstrap -Package
Start-PSBootstrap -Scenario Package

$macosRuntime = "osx-$buildArch"

Expand Down
9 changes: 8 additions & 1 deletion .pipelines/templates/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ jobs:
sudo chown $env:USER "$(Agent.TempDirectory)/PowerShell"
displayName: 'Create $(Agent.TempDirectory)/PowerShell'
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(PowerShellRoot)

- pwsh: |
Import-Module $(PowerShellRoot)/build.psm1 -Force
Start-PSBootstrap -Package
Start-PSBootstrap -Scenario Package
displayName: 'Bootstrap VM'
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
Expand Down
9 changes: 7 additions & 2 deletions .pipelines/templates/nupkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ jobs:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'

- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: '$(PowerShellRoot)'

- pwsh: |
Set-Location -Path '$(PowerShellRoot)'
Import-Module "$(PowerShellRoot)/build.psm1" -Force
Start-PSBootstrap -Verbose
$sharedModules = @('Microsoft.PowerShell.Commands.Management',
'Microsoft.PowerShell.Commands.Utility',
'Microsoft.PowerShell.ConsoleHost',
Expand Down
38 changes: 6 additions & 32 deletions .pipelines/templates/release-validate-fxdpackages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,12 @@ jobs:
Get-ChildItem "$(Pipeline.Workspace)/PSPackagesOfficial/$artifactName" -Recurse
displayName: 'Capture Downloaded Artifacts'

- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"
$dotnetMetadataPath = "$repoRoot/DotnetRuntimeMetadata.json"
$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json

# Channel is like: $Channel = "5.0.1xx-preview2"
$Channel = $dotnetMetadataJson.sdk.channel

$sdkVersion = (Get-Content "$repoRoot/global.json" -Raw | ConvertFrom-Json).sdk.version
Import-Module "$repoRoot/build.psm1" -Force

Find-Dotnet

if(-not (Get-PackageSource -Name 'dotnet' -ErrorAction SilentlyContinue))
{
$nugetFeed = ([xml](Get-Content $repoRoot/nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet' } | Select-Object -ExpandProperty Value
if ($nugetFeed) {
Register-PackageSource -Name 'dotnet' -Location $nugetFeed -ProviderName NuGet
Write-Verbose -Message "Register new package source 'dotnet'" -verbose
}
}

## Install latest version from the channel

#Install-Dotnet -Channel "$Channel" -Version $sdkVersion
Start-PSBootstrap

Write-Verbose -Message "Installing .NET SDK completed." -Verbose

displayName: Install .NET
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(Build.SourcesDirectory)/PowerShell"

- pwsh: |
$artifactName = '$(artifactName)'
Expand Down
43 changes: 6 additions & 37 deletions .pipelines/templates/release-validate-globaltools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,15 @@ jobs:
Get-ChildItem "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg" -Recurse
displayName: 'Capture Downloaded Artifacts'
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"
$dotnetMetadataPath = "$repoRoot/DotnetRuntimeMetadata.json"
$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json
# Channel is like: $Channel = "5.0.1xx-preview2"
$Channel = $dotnetMetadataJson.sdk.channel
$sdkVersion = (Get-Content "$repoRoot/global.json" -Raw | ConvertFrom-Json).sdk.version
Import-Module "$repoRoot/build.psm1" -Force
Find-Dotnet
if(-not (Get-PackageSource -Name 'dotnet' -ErrorAction SilentlyContinue))
{
$nugetFeed = ([xml](Get-Content $repoRoot/nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet' } | Select-Object -ExpandProperty Value
if ($nugetFeed) {
Register-PackageSource -Name 'dotnet' -Location $nugetFeed -ProviderName NuGet
Write-Verbose -Message "Register new package source 'dotnet'" -verbose
}
}
## Install latest version from the channel
#Install-Dotnet -Channel "$Channel" -Version $sdkVersion
Start-PSBootstrap
Write-Verbose -Message "Installing .NET SDK completed." -Verbose
displayName: Install .NET
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(REPOROOT)

- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Import-Module "$repoRoot/build.psm1" -Force
Start-PSBootstrap
$toolPath = New-Item -ItemType Directory "$(System.DefaultWorkingDirectory)/toolPath" | Select-Object -ExpandProperty FullName
Expand Down Expand Up @@ -108,8 +79,6 @@ jobs:
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"
Import-Module "$repoRoot/build.psm1" -Force
Start-PSBootstrap
$exeName = if ($IsWindows) { "pwsh.exe" } else { "pwsh" }
Expand Down
42 changes: 6 additions & 36 deletions .pipelines/templates/release-validate-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,17 @@ jobs:
Get-ChildItem "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg" -Recurse
displayName: 'Capture Downloaded Artifacts'

- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)"

$dotnetMetadataPath = "$repoRoot/DotnetRuntimeMetadata.json"
$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json

# Channel is like: $Channel = "5.0.1xx-preview2"
$Channel = $dotnetMetadataJson.sdk.channel

$sdkVersion = (Get-Content "$repoRoot/global.json" -Raw | ConvertFrom-Json).sdk.version
Import-Module "$repoRoot/build.psm1" -Force

Find-Dotnet

if(-not (Get-PackageSource -Name 'dotnet' -ErrorAction SilentlyContinue))
{
$nugetFeed = ([xml](Get-Content $repoRoot/nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet' } | Select-Object -ExpandProperty Value

if ($nugetFeed) {
Register-PackageSource -Name 'dotnet' -Location $nugetFeed -ProviderName NuGet
Write-Verbose -Message "Register new package source 'dotnet'" -verbose
}
}

## Install latest version from the channel
#Install-Dotnet -Channel "$Channel" -Version $sdkVersion

Start-PSBootstrap

Write-Verbose -Message "Installing .NET SDK completed." -Verbose

displayName: Install .NET
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(REPOROOT)

- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Import-Module "$repoRoot/build.psm1" -Force
Start-PSBootstrap

$localLocation = "$(Pipeline.Workspace)/PSPackagesOfficial/drop_nupkg_build_nupkg"
$xmlElement = @"
Expand Down
22 changes: 12 additions & 10 deletions .pipelines/templates/testartifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ jobs:
repoRoot: $(Build.SourcesDirectory)/PowerShell
ob_restore_phase: true

- pwsh: |
Import-Module $(Build.SourcesDirectory)/PowerShell/build.psm1
Start-PSBootstrap
displayName: Bootstrap
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(Build.SourcesDirectory)/PowerShell"
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
ob_restore_phase: true

- pwsh: |
Expand Down Expand Up @@ -97,12 +98,13 @@ jobs:
repoRoot: $(Build.SourcesDirectory)/PowerShell
ob_restore_phase: true

- pwsh: |
Import-Module $(Build.SourcesDirectory)/PowerShell/build.psm1
Start-PSBootstrap
displayName: Bootstrap
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
packageType: 'sdk'
workingDirectory: $(Build.SourcesDirectory)/PowerShell"
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
ob_restore_phase: true

- pwsh: |
Expand Down
12 changes: 8 additions & 4 deletions .pipelines/templates/windows-hosted-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ jobs:
AnalyzeInPipeline: true
Language: csharp

- task: UseDotNet@2
inputs:
useGlobalJson: true
workingDirectory: $(PowerShellRoot)
env:
ob_restore_phase: true

- pwsh: |
$runtime = switch ($env:Architecture)
{
Expand All @@ -86,7 +93,7 @@ jobs:
Import-Module -Name $(PowerShellRoot)/build.psm1 -Force
$buildWithSymbolsPath = New-Item -ItemType Directory -Path $(Pipeline.Workspace)/Symbols_$(Architecture) -Force
Start-PSBootstrap -Package
Start-PSBootstrap -Scenario Package
$null = New-Item -ItemType Directory -Path $buildWithSymbolsPath -Force -Verbose
$ReleaseTagParam = @{}
Expand Down Expand Up @@ -135,7 +142,6 @@ jobs:
}
Import-Module -Name $(PowerShellRoot)/build.psm1 -Force
Start-PSBootstrap
## Build global tool
Write-Verbose -Message "Building PowerShell global tool for Windows.x64" -Verbose
Expand Down Expand Up @@ -229,8 +235,6 @@ jobs:
After that, we repack using Compress-Archive and rename it back to a nupkg.
#>
Import-Module -Name $(PowerShellRoot)/build.psm1 -Force
Start-PSBootstrap
$packagingStrings = Import-PowerShellDataFile "$(PowerShellRoot)\tools\packaging\packaging.strings.psd1"
$outputPath = Join-Path '$(ob_outputDirectory)' 'globaltool'
Expand Down
Loading
Loading