8000 [release/v7.2.14] Start using new packages.microsoft.com cli (#20141)… · PowerShell/PowerShell@d6c0dba · GitHub
[go: up one dir, main page]

Skip to content

Commit d6c0dba

Browse files
authored
[release/v7.2.14] Start using new packages.microsoft.com cli (#20141) (#20241)
1 parent ef4fd9a commit d6c0dba

File tree

3 files changed

+60
-7
lines changed

3 files changed

+60
-7
lines changed

tools/releaseBuild/azureDevOps/releasePipeline.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
trigger: none
22

33
# needed to disable CI trigger and allow manual trigger
4-
# when the branch is same as pipline source, the latest build from the source is used.
4+
# when the branch is same as pipeline source, the latest build from the source is used.
55
# all environment used are for manual tasks and approvals.
66

7+
parameters:
8+
- name: skipPackagesMsftComPublish
9+
displayName: Skip actual publishing to Packages.microsoft.com, AFTER we upload it. Used to test the publishing script.
10+
default: false
11+
type: boolean
12+
- name: skipNugetPublish
13+
displayName: Skip nuget publishing. Used in testing publishing stage.
14+
default: false
15+
type: boolean
16+
717
resources:
818
pipelines:
919
- pipeline: releasePipeline
@@ -17,7 +27,7 @@ resources:
1727
type: git
1828
trigger: none
1929
name: Internal-PowerShellTeam-Tools
20-
ref: master
30+
ref: main-mirror
2131

2232
variables:
2333
- name: runCodesignValidationInjection
@@ -340,6 +350,8 @@ stages:
340350

341351
steps:
342352
- template: templates/release-ReleaseToNuGet.yml
353+
parameters:
354+
skipPublish: ${{ parameters.skipNugetPublish }}
343355

344356
- job: PublishPkgsMsftCom
345357

@@ -353,6 +365,8 @@ stages:
353365
- group: 'packages.microsoft.com'
354366
steps:
355367
- template: templates/release-PublishPackageMsftCom.yml
368+
parameters:
369+
skipPublish: ${{ parameters.skipPackagesMsftComPublish }}
356370

357371
- stage: PublishSymbols
358372
displayName: Publish symbols
Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
parameters:
2+
- name: skipPublish
3+
default: false
4+
type: boolean
5+
16
steps:
27
- template: release-SetReleaseTagAndContainerName.yml
38

@@ -9,19 +14,44 @@ steps:
914
displayName: Set Package version
1015

1116
- pwsh: |
12-
git clone https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools '$(Pipeline.Workspace)/tools'
17+
$branch = 'main-mirror'
18+
$gitArgs = "clone",
19+
"--verbose",
20+
"--branch",
21+
"$branch",
22+
"https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools",
23+
'$(Pipeline.Workspace)/tools'
24+
$gitArgs | Write-Verbose -Verbose
25+
git $gitArgs
1326
displayName: Clone Internal-PowerShellTeam-Tools from MSCodeHub
1427

28+
- task: PipAuthenticate@1
29+
inputs:
30+
artifactFeeds: 'pmc'
31+
pythonDownloadServiceConnections: pmcDownload
32+
33+
- pwsh: |
34+
pip install pmc-cli
35+
36+
$newPath = (resolve-path '~/.local/bin').providerpath
37+
$vstsCommandString = "vso[task.setvariable variable=PATH]${env:PATH}:$newPath"
38+
Write-Host "sending " + $vstsCommandString
39+
Write-Host "##$vstsCommandString"
40+
displayName: Install pmc cli
41+
1542
- pwsh: |
1643
$metadata = Get-Content -Path "$(Build.SourcesDirectory)/tools/metadata.json" -Raw | ConvertFrom-Json
17-
Write-Verbose -Verbose "$(ReleaseTag) $(RepoClientCliClientID) $(RepoClientCliSecret) $(AzureVersion) $($metadata.LTSRelease.Latest)"
1844
$params = @{
1945
ReleaseTag = "$(ReleaseTag)"
20-
AadClientId = "$(RepoClientCliClientID)"
21-
AadClientSecret = "$(RepoClientCliSecret)"
46+
AadClientId = "$(PmcCliClientID)"
2247
BlobFolderName = "$(AzureVersion)"
2348
LTS = $metadata.LTSRelease.Latest
2449
ForProduction = $true
50+
SkipPublish = $${{ parameters.skipPublish }}
51+
MappingFilePath = '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json'
2552
}
26-
& '$(Pipeline.Workspace)/tools/packages.microsoft.com/releaseLinuxPackages.ps1' -MappingFilePath '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json' @params
53+
54+
$params | Out-String -width 9999 -Stream | write-Verbose -Verbose
55+
56+
& '$(Pipeline.Workspace)/tools/packages.microsoft.com-v4/releaseLinuxPackages.ps1' @params
2757
displayName: Run release script

tools/releaseBuild/azureDevOps/templates/release-ReleaseToNuGet.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
parameters:
2+
- name: skipPublish
3+
default: false
4+
type: boolean
5+
16
steps:
27
- task: DownloadPipelineArtifact@2
8+
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
39
inputs:
410
source: specific
511
project: PowerShellCore
@@ -12,6 +18,7 @@ steps:
1218
path: '$(Pipeline.Workspace)/releasePipeline/finalResults'
1319

1420
- task: DownloadPipelineArtifact@2
21+
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
1522
inputs:
1623
source: specific
1724
project: PowerShellCore
@@ -34,9 +41,11 @@ steps:
3441
3542
Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
3643
displayName: Download and capture nupkgs
44+
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
3745

3846
- task: NuGetCommand@2
3947
displayName: 'NuGet push'
48+
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
4049
inputs:
4150
command: push
4251
packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'

0 commit comments

Comments
 (0)
0