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
43 changes: 10 additions & 33 deletions .pipelines/PowerShell-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: Skip Signing
type: string
default: 'NO'
- name: SkipPMCPublish
displayName: Skip PMC Publish
- name: SkipPublish
displayName: Skip Publishing to GitHub and Nuget
type: boolean
default: false
- name: SkipPSInfraInstallers
Expand Down Expand Up @@ -280,19 +280,21 @@ extends:
Update and merge the changelog for the release.
This step is required for creating GitHub draft release.

- stage: PublishGitHubRelease
displayName: Publish GitHub Release
dependsOn:
- stage: PublishGitHubReleaseAndNuget
displayName: Publish GitHub and Nuget Release
dependsOn:
- setReleaseTagAndUploadTools
- UpdateChangeLog
variables:
ob_release_environment: Production
jobs:
- template: /.pipelines/templates/release-githubtasks.yml@self
- template: /.pipelines/templates/release-githubNuget.yml@self
parameters:
skipPublish: ${{ parameters.SkipPublish }}

- stage: PushGitTagAndMakeDraftPublic
displayName: Push Git Tag and Make Draft Public
dependsOn: PublishGitHubRelease
dependsOn: PublishGitHubReleaseAndNuget
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand All @@ -319,18 +321,6 @@ extends:
parameters:
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}

- stage: PublishNuGet
displayName: Publish NuGet
dependsOn:
- setReleaseTagAndUploadTools
- PushGitTagAndMakeDraftPublic
variables:
ob_release_environment: Production
jobs:
- template: /.pipelines/templates/release-publish-nuget.yml@self
parameters:
skipPublish: true

- stage: PublishPMC
displayName: Publish PMC
dependsOn: PushGitTagAndMakeDraftPublic
Expand Down Expand Up @@ -422,8 +412,7 @@ extends:

- stage: ChangesToMaster
displayName: Ensure changes are in GH master
dependsOn:
- PublishNuGet
dependsOn:
- PublishPMC
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
Expand All @@ -433,17 +422,6 @@ extends:
instructions: |
Make sure that changes README.md and metadata.json are merged into master on GitHub.

- stage: ReleaseSnap
displayName: Release Snap
dependsOn: ChangesToMaster
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
displayName: Publish Snap
jobName: PublishSnapJob
instructions: |
Publish Snap

- stage: ReleaseToMU
displayName: Release to MU
dependsOn: PushGitTagAndMakeDraftPublic # This only needs the blob to be available
Expand All @@ -459,7 +437,6 @@ extends:
dependsOn:
- ReleaseToMU
- ReleaseSymbols
- ReleaseSnap
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
parameters:
- name: skipPublish
type: boolean

jobs:
- job: GithubReleaseDraft
displayName: Create GitHub Release Draft
Expand Down Expand Up @@ -58,6 +62,7 @@ jobs:
displayName: List all files in the workspace

- task: PowerShell@2
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
inputs:
targetType: inline
pwsh: true
Expand Down Expand Up @@ -86,3 +91,56 @@ 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

- job: NuGetPublish
displayName: Publish to NuGet
condition: succeeded()
pool:
type: release
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: drop_setReleaseTagAndUploadTools_SetTagAndTools
- input: pipelineArtifact
pipeline: PSPackagesOfficial
artifactName: drop_upload_upload_packages
variables:
- template: ./variable/release-shared.yml@self
parameters:
VERSION: $[ stageDependencies.setReleaseTagAndUploadTools.SetTagAndTools.outputs['OutputVersion.Version'] ]

steps:
- template: release-install-pwsh.yml

- pwsh: |
Write-Verbose -Verbose "Version: $(Version)"
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: 'Capture Environment Variables'

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

$releaseVersion = '$(Version)'
$globalToolPath = "$(Pipeline.Workspace)/NuGetPackages/PowerShell.$releaseVersion.nupkg"

if ($releaseVersion -notlike '*-*') {
# Copy the global tool package for stable releases
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())

- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: PowerShellNuGetOrgPush
58 changes: 0 additions & 58 deletions .pipelines/templates/release-publish-nuget.yml

This file was deleted.

Loading