Skip to content

Commit f191da4

Browse files
authored
Merge branch 'release/v7.5' into release/v7.5_package_references-03de3e7d4
2 parents 03de3e7 + 0997007 commit f191da4

File tree

5 files changed

+83
-97
lines changed

5 files changed

+83
-97
lines changed

.github/workflows/linux-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
ci_build:
6666
name: Build PowerShell
67-
runs-on: ubuntu-20.04
67+
runs-on: ubuntu-latest
6868
needs: changes
6969
if: ${{ needs.changes.outputs.source == 'true' }}
7070
steps:
@@ -81,7 +81,7 @@ jobs:
8181
- ci_build
8282
- changes
8383
if: ${{ needs.changes.outputs.source == 'true' }}
84-
runs-on: ubuntu-20.04
84+
runs-on: ubuntu-latest
8585
steps:
8686
- name: checkout
8787
uses: actions/[email protected]
@@ -98,7 +98,7 @@ jobs:
9898
- ci_build
9999
- changes
100100
if: ${{ needs.changes.outputs.source == 'true' }}
101-
runs-on: ubuntu-20.04
101+
runs-on: ubuntu-latest
102102
steps:
103103
- name: checkout
104104
uses: actions/[email protected]
@@ -115,7 +115,7 @@ jobs:
115115
- ci_build
116116
- changes
117117
if: ${{ needs.changes.outputs.source == 'true' }}
118-
runs-on: ubuntu-20.04
118+
runs-on: ubuntu-latest
119119
steps:
120120
- name: checkout
121121
uses: actions/[email protected]
@@ -132,7 +132,7 @@ jobs:
132132
- ci_build
133133
- changes
134134
if: ${{ needs.changes.outputs.source == 'true' }}
135-
runs-on: ubuntu-20.04
135+
runs-on: ubuntu-latest
136136
steps:
137137
- name: checkout
138138
uses: actions/[email protected]

.pipelines/PowerShell-Release-Official.yml

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ parameters: # parameters are shown up in ADO UI in a build queue time
1717
displayName: Skip Signing
1818
type: string
1919
default: 'NO'
20-
- name: SkipPMCPublish
21-
displayName: Skip PMC Publish
20+
- name: SkipPublish
21+
displayName: Skip Publishing to GitHub and Nuget
2222
type: boolean
2323
default: false
2424
- name: SkipPSInfraInstallers
@@ -281,19 +281,21 @@ extends:
281281
Update and merge the changelog for the release.
282282
This step is required for creating GitHub draft release.
283283
284-
- stage: PublishGitHubRelease
285-
displayName: Publish GitHub Release
286-
dependsOn:
284+
- stage: PublishGitHubReleaseAndNuget
285+
displayName: Publish GitHub and Nuget Release
286+
dependsOn:
287287
- setReleaseTagAndUploadTools
288288
- UpdateChangeLog
289289
variables:
290290
ob_release_environment: Production
291291
jobs:
292-
- template: /.pipelines/templates/release-githubtasks.yml@self
292+
- template: /.pipelines/templates/release-githubNuget.yml@self
293+
parameters:
294+
skipPublish: ${{ parameters.SkipPublish }}
293295

294296
- stage: PushGitTagAndMakeDraftPublic
295297
displayName: Push Git Tag and Make Draft Public
296-
dependsOn: PublishGitHubRelease
298+
dependsOn: PublishGitHubReleaseAndNuget
297299
jobs:
298300
- template: /.pipelines/templates/approvalJob.yml@self
299301
parameters:
@@ -320,18 +322,6 @@ extends:
320322
parameters:
321323
SkipPSInfraInstallers: ${{ parameters.SkipPSInfraInstallers }}
322324

323-
- stage: PublishNuGet
324-
displayName: Publish NuGet
325-
dependsOn:
326-
- setReleaseTagAndUploadTools
327-
- PushGitTagAndMakeDraftPublic
328-
variables:
329-
ob_release_environment: Production
330-
jobs:
331-
- template: /.pipelines/templates/release-publish-nuget.yml@self
332-
parameters:
333-
skipPublish: true
334-
335325
- stage: PublishPMC
336326
displayName: Publish PMC
337327
dependsOn: PushGitTagAndMakeDraftPublic
@@ -423,8 +413,7 @@ extends:
423413

424414
- stage: ChangesToMaster
425415
displayName: Ensure changes are in GH master
426-
dependsOn:
427-
- PublishNuGet
416+
dependsOn:
428417
- PublishPMC
429418
jobs:
430419
- template: /.pipelines/templates/approvalJob.yml@self
@@ -434,17 +423,6 @@ extends:
434423
instructions: |
435424
Make sure that changes README.md and metadata.json are merged into master on GitHub.
436425
437-
- stage: ReleaseSnap
438-
displayName: Release Snap
439-
dependsOn: ChangesToMaster
440-
jobs:
441-
- template: /.pipelines/templates/approvalJob.yml@self
442-
parameters:
443-
displayName: Publish Snap
444-
jobName: PublishSnapJob
445-
instructions: |
446-
Publish Snap
447-
448426
- stage: ReleaseToMU
449427
displayName: Release to MU
450428
dependsOn: PushGitTagAndMakeDraftPublic # This only needs the blob to be available
@@ -460,7 +438,6 @@ extends:
460438
dependsOn:
461439
- ReleaseToMU
462440
- ReleaseSymbols
463-
- ReleaseSnap
464441
jobs:
465442
- template: /.pipelines/templates/approvalJob.yml@self
466443
parameters:

.pipelines/templates/release-githubtasks.yml renamed to .pipelines/templates/release-githubNuget.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
parameters:
2+
- name: skipPublish
3+
type: boolean
4+
15
jobs:
26
- job: GithubReleaseDraft
37
displayName: Create GitHub Release Draft
@@ -58,6 +62,7 @@ jobs:
5862
displayName: List all files in the workspace
5963

6064
- task: PowerShell@2
65+
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
6166
inputs:
6267
targetType: inline
6368
pwsh: true
@@ -86,3 +91,56 @@ jobs:
8691
8792
Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description $clContent -User PowerShell -Repository PowerShell -PackageFolder "$(Pipeline.Workspace)/GitHubPackages" -Token $(GitHubReleasePat)
8893
displayName: Publish Release Draft
94+
95+
- job: NuGetPublish
96+
displayName: Publish to NuGet
97+
condition: succeeded()
98+
pool:
99+
type: release
100+
os: windows
101+
templateContext:
102+
inputs:
103+
- input: pipelineArtifact
104+
artifactName: drop_setReleaseTagAndUploadTools_SetTagAndTools
105+
- input: pipelineArtifact
106+
pipeline: PSPackagesOfficial
107+
artifactName: drop_upload_upload_packages
108+
variables:
109+
- template: ./variable/release-shared.yml@self
110+
parameters:
111+
VERSION: $[ stageDependencies.setReleaseTagAndUploadTools.SetTagAndTools.outputs['OutputVersion.Version'] ]
112+
113+
steps:
114+
- template: release-install-pwsh.yml
115+
116+
- pwsh: |
117+
Write-Verbose -Verbose "Version: $(Version)"
118+
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
119+
displayName: 'Capture Environment Variables'
120+
121+
- pwsh: |
122+
#Exclude all global tool packages. Their names start with 'PowerShell.'
123+
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
124+
Copy-Item "$(Pipeline.Workspace)/NuGetPackages/*.nupkg" -Destination "$(Pipeline.Workspace)/release" -Exclude "PowerShell.*.nupkg" -Force -Verbose
125+
126+
$releaseVersion = '$(Version)'
127+
$globalToolPath = "$(Pipeline.Workspace)/NuGetPackages/PowerShell.$releaseVersion.nupkg"
128+
129+
if ($releaseVersion -notlike '*-*') {
130+
# Copy the global tool package for stable releases
131+
Copy-Item $globalToolPath -Destination "$(Pipeline.Workspace)/release"
132+
}
133+
134+
Write-Verbose -Verbose "The .nupkgs below will be pushed:"
135+
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
136+
displayName: Download and capture nupkgs
137+
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
138+
139+
- task: NuGetCommand@2
140+
displayName: 'NuGet push'
141+
condition: and(ne('${{ parameters.skipPublish }}', 'false'), succeeded())
142+
inputs:
143+
command: push
144+
packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
145+
nuGetFeedType: external
146+
publishFeedCredentials: PowerShellNuGetOrgPush

.pipelines/templates/release-publish-nuget.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.pipelines/templates/release-validate-sdk.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ jobs:
8787
Get-Content $nugetPath
8888
8989
# Add workaround to unblock xUnit testing see issue: https://github.com/dotnet/sdk/issues/26462
90-
$dotnetPath = if ($IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" }
90+
91+
$possibleDotnetLocation = "$env:ProgramFiles\dotnet"
92+
93+
$dotnetPath = if ($IsWindows) {
94+
if (Test-Path $possibleDotnetLocation) { $possibleDotnetLocation } else { "$env:LocalAppData\Microsoft\dotnet" }
95+
}
96+
else {
97+
"$env:HOME/.dotnet"
98+
}
99+
91100
$env:DOTNET_ROOT = $dotnetPath
92101
93102
dotnet --info

0 commit comments

Comments
 (0)