Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ parameters:
displayName: URL to the blob having internal .NET SDK
type: string
default: ' '
- name: EarlyAccessFeed
displayName: Early Access Feed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: ReleaseTagVar
displayName: Release Tag
type: string
Expand All @@ -29,6 +37,17 @@ parameters:
displayName: Debugging - Enable CodeQL and set cadence to 1 hour
type: boolean
default: false
- name: IsEarlyAccess
type: boolean
default: false
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: bins-$(BUILD.SOURCEBRANCHNAME)-nonofficial-$(Build.BuildId)

Expand All @@ -52,6 +71,8 @@ variables:
SKIP_SIGNING: ${{ parameters.SKIP_SIGNING }}
ENABLE_MSBUILD_BINLOGS: ${{ parameters.ENABLE_MSBUILD_BINLOGS }}
FORCE_CODEQL: ${{ parameters.FORCE_CODEQL }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}

extends:
template: v2/OneBranch.NonOfficial.CrossPlat.yml@onebranchTemplates
Expand Down Expand Up @@ -96,3 +117,7 @@ extends:
RUN_WINDOWS: ${{ parameters.RUN_WINDOWS }}
RUN_TEST_AND_RELEASE: ${{ parameters.RUN_TEST_AND_RELEASE }}
OfficialBuild: false
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}
25 changes: 25 additions & 0 deletions .pipelines/NonOfficial/PowerShell-Packages-NonOfficial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- name: disableNetworkIsolation
type: boolean
default: false
- name: IsEarlyAccess
type: boolean
default: false
- name: EarlyAccessFeed
displayName: Early Access Feed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: pkgs-$(BUILD.SOURCEBRANCHNAME)-nonofficial-$(Build.BuildId)

Expand All @@ -37,6 +56,8 @@ variables:
ForceAzureBlobDelete: ${{ parameters.ForceAzureBlobDelete }}
ReleaseTagVar: ${{ parameters.ReleaseTagVar }}
disableNetworkIsolation: ${{ parameters.disableNetworkIsolation }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}

resources:
pipelines:
Expand Down Expand Up @@ -95,3 +116,7 @@ extends:
- template: /.pipelines/templates/stages/PowerShell-Packages-Stages.yml@self
parameters:
OfficialBuild: false
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
22 changes: 22 additions & 0 deletions .pipelines/NonOfficial/PowerShell-Release-NonOfficial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: Skip MSIX Publish
type: boolean
default: false
- name: EarlyAccessFeed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: IsEarlyAccess
type: boolean
default: false
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: release-$(BUILD.SOURCEBRANCHNAME)-nonofficial-$(Build.BuildId)

Expand Down Expand Up @@ -104,3 +122,7 @@ extends:
SkipPublish: ${{ parameters.SkipPublish }}
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}
skipMSIXPublish: ${{ parameters.skipMSIXPublish }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
26 changes: 26 additions & 0 deletions .pipelines/PowerShell-Coordinated_Packages-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ parameters:
displayName: Debugging - Enable CodeQL and set cadence to 1 hour
type: boolean
default: false
- name: IsEarlyAccess
type: boolean
default: false
- name: EarlyAccessFeed
displayName: Early Access Feed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: bins-$(BUILD.SOURCEBRANCHNAME)-prod-$(Build.BuildId)

Expand All @@ -52,6 +71,8 @@ variables:
SKIP_SIGNING: ${{ parameters.SKIP_SIGNING }}
ENABLE_MSBUILD_BINLOGS: ${{ parameters.ENABLE_MSBUILD_BINLOGS }}
FORCE_CODEQL: ${{ parameters.FORCE_CODEQL }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}

extends:
template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
Expand Down Expand Up @@ -96,3 +117,8 @@ extends:
RUN_WINDOWS: ${{ parameters.RUN_WINDOWS }}
RUN_TEST_AND_RELEASE: ${{ parameters.RUN_TEST_AND_RELEASE }}
OfficialBuild: true
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}

26 changes: 26 additions & 0 deletions .pipelines/PowerShell-Packages-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- name: disableNetworkIsolation
type: boolean
default: false
- name: IsEarlyAccess
type: boolean
default: false
- name: EarlyAccessFeed
displayName: Early Access Feed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: pkgs-$(BUILD.SOURCEBRANCHNAME)-prod-$(Build.BuildId)

Expand All @@ -37,6 +56,8 @@ variables:
ForceAzureBlobDelete: ${{ parameters.ForceAzureBlobDelete }}
ReleaseTagVar: ${{ parameters.ReleaseTagVar }}
disableNetworkIsolation: ${{ parameters.disableNetworkIsolation }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}

resources:
pipelines:
Expand Down Expand Up @@ -95,3 +116,8 @@ extends:
- template: templates/stages/PowerShell-Packages-Stages.yml
parameters:
OfficialBuild: true
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}

22 changes: 22 additions & 0 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: Skip MSIX Publish
type: boolean
default: false
- name: EarlyAccessFeed
type: string
default: 'net10'
values:
- 'net8'
- 'net9'
- 'net10'
- name: IsEarlyAccess
type: boolean
default: false
- name: DOTNET_RUNTIME_VERSION
displayName: Runtime version of early access build
type: string
default: ' '
- name: DOTNET_SDK_VERSION
displayName: SDK version of early access build
type: string
default: ' '

name: release-$(BUILD.SOURCEBRANCHNAME)-prod-$(Build.BuildId)

Expand Down Expand Up @@ -100,3 +118,7 @@ extends:
SkipPublish: ${{ parameters.SkipPublish }}
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}
skipMSIXPublish: ${{ parameters.skipMSIXPublish }}
IsEarlyAccess: ${{ parameters.IsEarlyAccess }}
DOTNET_RUNTIME_VERSION: ${{ parameters.DOTNET_RUNTIME_VERSION }}
DOTNET_SDK_VERSION: ${{ parameters.DOTNET_SDK_VERSION }}
EarlyAccessFeed: ${{ parameters.EarlyAccessFeed }}
59 changes: 59 additions & 0 deletions .pipelines/templates/downloadDotnetEarlyAccess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
parameters:
- name: DotnetRuntimeVersion
type: string
- name: DotnetSdkVersion
type: string

jobs:
- job: download_dotnet_early_access
displayName: Download DotNet Early Access
variables:
- group: dotnet-early-access
- name: DOTNET_RUNTIME_VERSION
value: ${{ parameters.DotnetRuntimeVersion }}
- name: DOTNET_SDK_VERSION
value: ${{ parameters.DotnetSdkVersion }}
- name: destinationPath
value: '$(Build.ArtifactStagingDirectory)/pkgs'

pool:
name: PowerShell1ES
type: windows
isCustom: true
demands:
- ImageOverride -equals PSMMS2019-Secure

steps:
- checkout: self
clean: true

- pwsh: |
Get-ChildItem Env: | Out-String -Width 9999 -Stream | Write-Verbose -Verbose
displayName: Capture environment

Comment on lines +30 to +33
- task: AzurePowerShell@5
inputs:
azureSubscription: powershell-net-early-access
azurePowerShellVersion: LatestVersion
ScriptType: InlineScript
pwsh: true
inline: |
$DOTNET_PRIVATE_SAS = Get-AzKeyVaultSecret -VaultName $env:DOTNET_AZ_KV_NAME -Name $env:DOTNET_AZ_SECRET_NAME -AsPlainText

Write-Verbose -Message "DOTNET_PRIVATE_SAS acquired" -Verbose

Import-Module "$env:BUILD_SOURCESDIRECTORY/build.psm1" -Force

if (-not (Test-Path '$(destinationPath)'))
{
New-Item -ItemType Directory -Path '$(destinationPath)' -Force -Verbose | Out-Null
}

Get-DotnetEarlyAccess -DestinationPath '$(destinationPath)' -Architecture all -DOTNET_PRIVATE_SAS $DOTNET_PRIVATE_SAS

Get-ChildItem -Path '$(destinationPath)' -Recurse | ForEach-Object {
Write-Verbose -verbose "Uploading $($_.FullName) to 'dotnet-packages'"
Write-Host "##vso[artifact.upload containerfolder=dotnet-packages;artifactname=dotnet-packages]$($_.FullName)"
}

displayName: 'Download DotNet Early Access'
65 changes: 63 additions & 2 deletions .pipelines/templates/insert-nuget-config-azfeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ steps:
$configPath = "${env:NugetConfigDir}/nuget.config"
Import-Module ${{ parameters.repoRoot }}/build.psm1 -Force

Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)'"
Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)'
$earlyAccess = $env:ISEARLYACCESS -eq 'true'

Write-Verbose -Verbose "Is Early access: $earlyAccess"

if (-not $earlyAccess)
{
Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)'"
Switch-PSNugetConfig -Source Private -UserName '$(AzDevopsFeedUserNameKVPAT)' -ClearTextPAT '$(powershellPackageReadPat)'
}
else
{
Write-Verbose -Verbose "Running: Switch-PSNugetConfig -Source EarlyAccess"
Switch-PSNugetConfig -Source EarlyAccess
}

if(-not (Test-Path $configPath))
{
Expand All @@ -34,6 +46,55 @@ steps:
NugetConfigDir: ${{ parameters.repoRoot }}/src/Modules
ob_restore_phase: ${{ parameters.ob_restore_phase }}

- task: AzurePowerShell@5
inputs:
azureSubscription: powershell-net-early-access
azurePowerShellVersion: LatestVersion
ScriptType: InlineScript
pwsh: true
inline: |
Write-Verbose -Verbose "Getting an Azure DevOps access token"
# Microsoft's well-known Entra resource ID for the Azure DevOps token audience.
$azureDevOpsResourceUrl = '499b84ac-1321-427f-aa17-267ca6975798'
$azt = (Get-AzAccessToken -ResourceUrl $azureDevOpsResourceUrl).Token | ConvertFrom-SecureString -AsPlainText

Write-Host "##vso[task.setsecret]$azt"
Write-Verbose -Verbose "Setting up Azure Artifacts Credential Provider token"

$earlyAccessFeed = '$(EARLY_ACCESS_FEED)'
$ADORepoUri = switch ($earlyAccessFeed) {
'net8' { 'https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-net-8-early-access/nuget/v3/index.json' }
'net9' { 'https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-net-9-early-access/nuget/v3/index.json' }
'net10' { 'https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-net-10-early-access/nuget/v3/index.json' }
default { throw "Unknown early access feed URL: $earlyAccessFeed" }
}
$galleryRepoUri = 'https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-psgallery/nuget/v2'

Write-Verbose -Verbose "ADORepoUri == $ADORepoUri"

if ([string]::IsNullOrEmpty($ADORepoUri) -eq $false)
{
$endpointCredsObj = @{ endpointCredentials = @(
@{ endpoint = $ADORepoUri; password = $azt }
@{ endpoint = $galleryRepoUri; password = $azt }
)}
$VSS_NUGET_EXTERNAL_FEED_ENDPOINTS = $endpointCredsObj | ConvertTo-Json -Compress

Write-Verbose -Verbose "Setting VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable"

$vstsCommandString = "vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$VSS_NUGET_EXTERNAL_FEED_ENDPOINTS"
Write-Host "##$vstsCommandString"
Comment on lines +85 to +86
}
else
{
Write-Verbose -Verbose "EARLY_ACCESS_FEED_URL is not set"
}
displayName: 'Setup Azure Artifacts Credential Provider secret'
condition: eq(variables['ISEARLYACCESS'], 'true')
env:
ob_restore_phase: ${{ parameters.ob_restore_phase }}


- pwsh: |
Get-ChildItem ${{ parameters.repoRoot }}/nuget.config -Recurse | Foreach-Object {
Write-Verbose -Verbose "--- START $($_.fullname) ---"
Expand Down
Loading
Loading