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
50 changes: 27 additions & 23 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ parameters: # parameters are shown up in ADO UI in a build queue time
type: boolean
default: false


variables:
- name: CDP_DEFINITION_BUILD_COUNT
value: $[counter('', 0)]
Expand All @@ -51,7 +50,7 @@ variables:
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: WindowsContainerImage
value: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest'
value: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
- name: LinuxContainerImage
value: mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
- name: ReleaseTagVar
Expand Down Expand Up @@ -84,9 +83,9 @@ resources:
extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates
parameters:
release:
category: NonAzure
featureFlags:
LinuxHostVersion:
Network: Monitor
WindowsHostVersion:
Version: 2022
Network: KS3
Expand Down Expand Up @@ -128,6 +127,7 @@ extends:

- stage: validateSdk
displayName: 'Validate SDK'
dependsOn: []
jobs:
- template: /.pipelines/templates/release-validate-sdk.yml@self
parameters:
Expand All @@ -152,6 +152,7 @@ extends:

- stage: gbltool
displayName: 'Validate Global tools'
dependsOn: []
jobs:
- template: /.pipelines/templates/release-validate-globaltools.yml@self
parameters:
Expand All @@ -169,6 +170,7 @@ extends:

- stage: fxdpackages
displayName: 'Validate FXD Packages'
dependsOn: []
jobs:
- template: /.pipelines/templates/release-validate-fxdpackages.yml@self
parameters:
Expand Down Expand Up @@ -205,6 +207,7 @@ extends:

- stage: validatePackages
displayName: 'Validate Packages'
dependsOn: []
jobs:
- template: /.pipelines/templates/release-validate-packagenames.yml@self

Expand Down Expand Up @@ -304,18 +307,14 @@ extends:

- stage: BlobPublic
displayName: Make Blob Public
dependsOn: UpdateChangeLog
dependsOn:
- UpdateChangeLog
- PushGitTagAndMakeDraftPublic
jobs:
- template: /.pipelines/templates/release-MakeBlobPublic.yml@self
parameters:
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}

- stage: PublishGitHubRelease
displayName: Publish GitHub Release
dependsOn: BlobPublic
jobs:
- template: /.pipelines/templates/release-githubtasks.yml@self

- stage: PublishNuGet
displayName: Publish NuGet
dependsOn:
Expand All @@ -330,14 +329,14 @@ extends:

- stage: PublishPMC
displayName: Publish PMC
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
jobs:
- template: /.pipelines/templates/release-publish-pmc.yml@self
parameters:
skipPublish: ${{ parameters.SkipPMCPublish }}

- stage: ReleaseDocker
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: 'Docker Release'
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -356,7 +355,7 @@ extends:
Kickoff docker release

- stage: UpdateDotnetDocker
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Update DotNet SDK Docker images
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -371,7 +370,7 @@ extends:
4. create PR targeting nightly branch

- stage: UpdateWinGet
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Add manifest entry to winget
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -382,7 +381,7 @@ extends:
This is typically done by the community 1-2 days after the release.

- stage: PublishMsix
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Publish MSIX to store
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -393,7 +392,7 @@ extends:
Ask Steve to release MSIX bundle package to Store

- stage: PublishVPack
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Release vPack
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -411,20 +410,22 @@ extends:
# - template: templates/release-UpdateDepsJson.yml

- stage: UploadBuildInfoJson
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Upload BuildInfo.json
jobs:
- template: /.pipelines/templates/release-upload-buildinfo.yml@self

- stage: ReleaseSymbols
dependsOn: PublishGitHubRelease
dependsOn: PushGitTagAndMakeDraftPublic
displayName: Release Symbols
jobs:
- template: /.pipelines/templates/release-symbols.yml@self

- stage: ChangesToMaster
displayName: Ensure changes are in GH master
dependsOn: ['PublishNuGet', 'PublishPMC']
dependsOn:
- PublishNuGet
- PublishPMC
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand All @@ -435,7 +436,7 @@ extends:

- stage: ReleaseSnap
displayName: Release Snap
dependsOn: 'ChangesToMaster'
dependsOn: ChangesToMaster
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand All @@ -446,7 +447,7 @@ extends:

- stage: ReleaseToMU
displayName: Release to MU
dependsOn: ['PublishNuGet', 'PublishPMC', 'ChangesToMaster']
dependsOn: PushGitTagAndMakeDraftPublic
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand All @@ -456,7 +457,10 @@ extends:

- stage: ReleaseClose
displayName: Finish Release
dependsOn: ['ReleaseToMU', 'ReleaseSymbols', 'ReleaseSnap']
dependsOn:
- ReleaseToMU
- ReleaseSymbols
- ReleaseSnap
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand Down
59 changes: 31 additions & 28 deletions .pipelines/templates/release-create-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,39 @@ jobs:
displayName: Download x86 msix
patterns: '**/*.msix'

- task: AzurePowerShell@5
# This needs to run before any AzurePowerShell@ task
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}

Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules and install Az.Storage

- pwsh: |
$cmd = Get-Command makeappx.exe -ErrorAction Ignore
if ($cmd) {
Write-Verbose -Verbose 'makeappx available in PATH'
$exePath = $cmd.Source
} else {
$toolsDir = '$(Pipeline.Workspace)\releasePipeline\tools'
New-Item $toolsDir -Type Directory -Force > $null
Invoke-RestMethod -Uri '$(makeappUrl)' -OutFile "$toolsDir\makeappx.zip"
Expand-Archive "$toolsDir\makeappx.zip" -DestinationPath "$toolsDir\makeappx" -Force
$exePath = "$toolsDir\makeappx\makeappx.exe"

Write-Verbose -Verbose 'makeappx was installed:'
Get-ChildItem -Path $toolsDir -Recurse
}

$vstsCommandString = "vso[task.setvariable variable=MakeAppxPath]$exePath"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Install makeappx tool
retryCountOnTaskFailure: 1
inputs:
azureSubscription: az-blob-cicd-infra
scriptType: inlineScript
azurePowerShellVersion: LatestVersion
pwsh: true
inline: |
$toolsDir = '$(Pipeline.Workspace)\releasePipeline\tools'
New-Item $toolsDir -Type Directory -Force > $null
Invoke-RestMethod -Uri '$(makeappUrlDirect)' -OutFile "$toolsDir\makeappx.zip"
Expand-Archive "$toolsDir\makeappx.zip" -DestinationPath "$toolsDir\makeappx" -Force
$exePath = "$toolsDir\makeappx\makeappx.exe"

$vstsCommandString = "vso[task.setvariable variable=MakeAppxPath]$exePath"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"

- pwsh: |
$sourceDir = '$(Pipeline.Workspace)\releasePipeline\msix'
Expand Down Expand Up @@ -73,18 +88,6 @@ jobs:
displayName: Create MsixBundle
retryCountOnTaskFailure: 1

- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}

Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose

displayName: Remove AzRM modules and install Az.Storage

- task: AzurePowerShell@5
displayName: Upload msix to blob
inputs:
Expand Down
16 changes: 0 additions & 16 deletions .pipelines/templates/release-githubtasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,3 @@ jobs:

Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description $clContent -User PowerShell -Repository PowerShell -PackageFolder "$(Pipeline.Workspace)/GitHubPackages" -Token $(GitHubReleasePat)
displayName: Publish Release Draft

- template: /.pipelines/templates/approvalJob.yml@self
parameters:
displayName: Push Git Tag
jobName: PushGitTag
dependsOnJob: GithubReleaseDraft
instructions: |
Push the git tag to upstream

- template: /.pipelines/templates/approvalJob.yml@self
parameters:
displayName: Make Draft Public
jobName: DraftPublic
dependsOnJob: PushGitTag
instructions: |
Make the GitHub Release Draft Public
34 changes: 34 additions & 0 deletions .pipelines/templates/release-install-pwsh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
steps:
- task: PowerShell@2
inputs:
targetType: inline
script: |
$localInstallerPath = Get-ChildItem -Path "$(Pipeline.Workspace)/GitHubPackages" -Filter '*win-x64.msi' | Select-Object -First 1 -ExpandProperty FullName
if (Test-Path -Path $localInstallerPath) {
Write-Verbose -Verbose "Installer found at $localInstallerPath"
} else {
throw "Installer not found"
}
Write-Verbose -Verbose "Installing PowerShell via msiexec"
Start-Process -FilePath msiexec -ArgumentList "/package $localInstallerPath /quiet REGISTER_MANIFEST=1" -Wait -NoNewWindow
$pwshPath = Get-ChildItem -Directory -Path 'C:\Program Files\PowerShell\7*' | Select-Object -First 1 -ExpandProperty FullName
if (Test-Path -Path $pwshPath) {
Write-Verbose -Verbose "PowerShell installed at $pwshPath"
Write-Verbose -Verbose "Adding pwsh to env:PATH"
Write-Host "##vso[task.prependpath]$pwshPath"
} else {
throw "PowerShell not installed"
}
displayName: Install pwsh 7

- task: PowerShell@2
inputs:
targetType: inline
pwsh: true
script: |
Write-Verbose -Verbose "Pwsh 7 Installed"
Write-Verbose -Verbose "env:Path: "
$env:PATH -split ';' | ForEach-Object {
Write-Verbose -Verbose $_
}
displayName: Check pwsh 7 installation
7 changes: 2 additions & 5 deletions .pipelines/templates/release-publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ jobs:
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: 'Capture Environment Variables'

- download: PSPackagesOfficial
artifact: drop_nupkg_build_nupkg
displayName: Download nuget packages

- pwsh: |
#Exclude all global tool packages. Their names start with 'PowerShell.'
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
Copy-Item "$ENV:PIPELINE_WORKSPACE/PSPackagesOfficial/drop_nupkg_build_nupkg/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Exclude "PowerShell.*.nupkg" -Force -Verbose
Copy-Item "$(Pipeline.Workspace)/NuGetPackages/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Exclude "PowerShell.*.nupkg" -Force -Verbose

$releaseVersion = '$(Version)'
$globalToolPath = "$(Pipeline.Workspace)/NuGetPackages/PowerShell.$releaseVersion.nupkg"
Expand All @@ -47,6 +43,7 @@ jobs:
Copy-Item $globalToolPath -Destination "$(Pipeline.Workspace)/release"
}

Write-Verbose -Verbose "The .nupkgs below will be pushed:"
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
displayName: Download and capture nupkgs
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
Expand Down
15 changes: 2 additions & 13 deletions .pipelines/templates/release-validate-globaltools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,13 @@ jobs:
- pwsh: |
$repoRoot = "$(Build.SourcesDirectory)/PowerShell"
Import-Module "$repoRoot/build.psm1" -Force
Start-PSBootstrap
Start-PSBootstrap -Force

$exeName = if ($IsWindows) { "pwsh.exe" } else { "pwsh" }

$toolPath = "$(System.DefaultWorkingDirectory)/toolPath/${{ parameters.globalToolExeName }}"

$source = (get-command -Type Application -Name dotnet | Select-Object -First 1 -ExpandProperty source)
$target = (Get-ChildItem $source).target

# If we find a symbolic link for dotnet, then we need to split the filename off the target.
if ($target) {
Write-Verbose -Verbose "Splitting target: $target"
$target = Split-Path $target
}

Write-Verbose -Verbose "target is set as $target"

$env:DOTNET_ROOT = (resolve-path -Path (Join-Path (split-path $source) $target)).ProviderPath
Find-Dotnet -SetDotNetRoot

Write-Verbose -Verbose "DOTNET_ROOT: $env:DOTNET_ROOT"
Get-ChildItem $env:DOTNET_ROOT
Expand Down
Loading