Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v7.3.7]Start using new packages.microsoft.com cli #20252

Merged
merged 1 commit into from
Sep 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions tools/releaseBuild/azureDevOps/releasePipeline.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
trigger: none

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

parameters:
- name: skipPackagesMsftComPublish
displayName: Skip actual publishing to Packages.microsoft.com, AFTER we upload it. Used to test the publishing script.
default: false
type: boolean
- name: skipNugetPublish
displayName: Skip nuget publishing. Used in testing publishing stage.
default: false
type: boolean

resources:
pipelines:
- pipeline: releasePipeline
Expand All @@ -17,7 +27,7 @@ resources:
type: git
trigger: none
name: Internal-PowerShellTeam-Tools
ref: master
ref: main-mirror

variables:
- name: runCodesignValidationInjection
Expand Down Expand Up @@ -340,6 +350,8 @@ stages:

steps:
- template: templates/release-ReleaseToNuGet.yml
parameters:
skipPublish: ${{ parameters.skipNugetPublish }}

- job: PublishPkgsMsftCom

Expand All @@ -353,6 +365,8 @@ stages:
- group: 'packages.microsoft.com'
steps:
- template: templates/release-PublishPackageMsftCom.yml
parameters:
skipPublish: ${{ parameters.skipPackagesMsftComPublish }}

- stage: PublishSymbols
displayName: Publish symbols
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
parameters:
- name: skipPublish
default: false
type: boolean

steps:
- template: release-SetReleaseTagAndContainerName.yml

Expand All @@ -9,19 +14,44 @@ steps:
displayName: Set Package version

- pwsh: |
git clone https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools '$(Pipeline.Workspace)/tools'
$branch = 'main-mirror'
$gitArgs = "clone",
"--verbose",
"--branch",
"$branch",
"https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools",
'$(Pipeline.Workspace)/tools'
$gitArgs | Write-Verbose -Verbose
git $gitArgs
displayName: Clone Internal-PowerShellTeam-Tools from MSCodeHub

- task: PipAuthenticate@1
inputs:
artifactFeeds: 'pmc'
pythonDownloadServiceConnections: pmcDownload

- pwsh: |
pip install pmc-cli

$newPath = (resolve-path '~/.local/bin').providerpath
$vstsCommandString = "vso[task.setvariable variable=PATH]${env:PATH}:$newPath"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Install pmc cli

- pwsh: |
$metadata = Get-Content -Path "$(Build.SourcesDirectory)/tools/metadata.json" -Raw | ConvertFrom-Json
Write-Verbose -Verbose "$(ReleaseTag) $(RepoClientCliClientID) $(RepoClientCliSecret) $(AzureVersion) $($metadata.LTSRelease.Latest)"
$params = @{
ReleaseTag = "$(ReleaseTag)"
AadClientId = "$(RepoClientCliClientID)"
AadClientSecret = "$(RepoClientCliSecret)"
AadClientId = "$(PmcCliClientID)"
BlobFolderName = "$(AzureVersion)"
LTS = $metadata.LTSRelease.Latest
ForProduction = $true
SkipPublish = $${{ parameters.skipPublish }}
MappingFilePath = '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json'
}
& '$(Pipeline.Workspace)/tools/packages.microsoft.com/releaseLinuxPackages.ps1' -MappingFilePath '$(System.DefaultWorkingDirectory)/tools/packages.microsoft.com/mapping.json' @params

$params | Out-String -width 9999 -Stream | write-Verbose -Verbose

& '$(Pipeline.Workspace)/tools/packages.microsoft.com-v4/releaseLinuxPackages.ps1' @params
displayName: Run release script
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
parameters:
- name: skipPublish
default: false
type: boolean

steps:
- task: DownloadPipelineArtifact@2
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
inputs:
source: specific
project: PowerShellCore
Expand All @@ -12,6 +18,7 @@ steps:
path: '$(Pipeline.Workspace)/releasePipeline/finalResults'

- task: DownloadPipelineArtifact@2
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
inputs:
source: specific
project: PowerShellCore
Expand All @@ -37,9 +44,11 @@ steps:

Get-ChildItem "$(Pipeline.Workspace)/release" -recurse
displayName: Download and capture nupkgs
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())

- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(eq('${{ parameters.skipPublish }}', 'false'), succeeded())
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/release/*.nupkg'
Expand Down