-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Create release pipeline as a yaml pipeline #13394
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
Merged
adityapatwardhan
merged 45 commits into
PowerShell:master
from
adityapatwardhan:releaseYml
Aug 13, 2020
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
9ce1a06
parent ed4cd20d800cbab789b6b516f324498e022a1d02
adityapatwardhan a62335c
Create directory if it does not exist
840c4d1
Fix SDK tests
d247fff
Make trigger manual for testing
9e45b04
Fix typo in stage bame
af96a5b
Remove version from pipeline resource
d180688
Add branch in pipeline resource
2dc48c8
Change build name in pipeline resource
cf32324
Add quotes
2c74b49
Remove branch
f7d10cf
Fix build name
ac1494c
Fix build name
674bcc5
Fix sdk download
5b34550
Use pipeline resource
d3de2ae
Fixes for consuming pipeline resource
12de68f
Path fixes to use pipeline resource
743796b
Fix global tools and package validation
b4c08a0
Add logging to install global tool
e86a2f8
Fix exe name for global tool
5f9ded3
Test end to end
cdf55b2
Keep using preview5 for test
cff3f84
Fix global tool tests
e72b210
Add scripts for release tasks
e6702c5
Fix template paths
f7d97e8
Fix tabbing
ae7574e
Fix paths after download
7a274b0
Fix yaml template name
757fbee
Enable trigger
7c6ddf3
Disable deploy tasks for testing
a53070f
Fix yaml
32e7454
Fix local clone of internal repo
bcde4f1
Fix issues in package release
46dee0d
Fix issues in buildjson
6be6386
Fix typo
37cdb2b
Fix typo
ceabead
Add approval for VPack and remove commented publish code
5df77ce
Fix build name
1cc6599
Undo change for disabling compliance
fd5c9ac
Add update deps step
05d02e4
Empty commit
adityapatwardhan d020e60
Add release deps json to pipeline
adityapatwardhan 2b126d3
Address feedback
adityapatwardhan edbb4e2
Add variable groups to jobs when using variables
adityapatwardhan 2f2812c
Fix yaml and add display names to stages
adityapatwardhan 5f22800
Fix stage dependencies
adityapatwardhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,274 @@ | ||
| 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. | ||
| # all environment used are for manual tasks and approvals. | ||
|
|
||
| resources: | ||
| pipelines: | ||
| - pipeline: releasePipeline | ||
| source: 'Coordinated Packages' | ||
| trigger: | ||
| branches: | ||
| - release/* | ||
|
|
||
| variables: | ||
| runCodesignValidationInjection: false | ||
|
|
||
| stages: | ||
| - stage: ValidateSDK | ||
| displayName: Validate SDK | ||
| dependsOn: [] | ||
| jobs: | ||
| - template: templates/release-SDKTests.yml | ||
| parameters: | ||
| jobName: WinSDK | ||
| displayName: Windows SDK Test | ||
| imageName: windows-latest | ||
|
|
||
| - template: templates/release-SDKTests.yml | ||
| parameters: | ||
| jobName: LinuxSDK | ||
| displayName: Linux SDK Test | ||
| imageName: ubuntu-latest | ||
|
|
||
| - template: templates/release-SDKTests.yml | ||
| parameters: | ||
| jobName: macOSSDK | ||
| displayName: macOS SDK Test | ||
| imageName: macOS-latest | ||
|
|
||
| - stage: PRCreation | ||
| displayName: Create PR in GH Master | ||
| dependsOn: [] | ||
| jobs: | ||
| - deployment: CreatePRInMaster | ||
| displayName: Update README.md and metadata.json | ||
| pool: server | ||
| environment: PSReleaseCreatePR | ||
|
|
||
| - stage: ValidateGlobalTool | ||
| displayName: Validate Global Tool | ||
| dependsOn: [] | ||
| jobs: | ||
| - template: templates/release-GlobalToolTest.yml | ||
| parameters: | ||
| jobName: WinGblTool | ||
| displayName: Global Tool Test Windows | ||
| imageName: windows-latest | ||
| globalToolExeName: 'pwsh.exe' | ||
| globalToolPackageName: 'PowerShell.Windows.x64' | ||
|
|
||
| - template: templates/release-GlobalToolTest.yml | ||
| parameters: | ||
| jobName: LinuxWinGblTool | ||
| displayName: Global Tool Test Linux | ||
| imageName: ubuntu-latest | ||
| globalToolExeName: 'pwsh' | ||
| globalToolPackageName: 'PowerShell.Linux.x64' | ||
|
|
||
| - stage: ValidatePkgNames | ||
| dependsOn: [] | ||
| displayName: Package Names validation | ||
| jobs: | ||
| - job: ValidatePkgNames | ||
| pool: | ||
| vmImage: windows-latest | ||
| variables: | ||
| - group: 'Azure Blob variable group' | ||
| steps: | ||
| - template: templates/release-ValidatePackageNames.yml | ||
|
|
||
| - stage: StartDocker | ||
| dependsOn: [] | ||
| displayName: Kick Off Docker Staging build | ||
| jobs: | ||
| - deployment: PSDockerKickOff | ||
| displayName: Start Docker build | ||
| pool: server | ||
| environment: PSReleaseDockerKickOff | ||
|
|
||
| - stage: ManualValidation | ||
| dependsOn: [] | ||
| displayName: Manual Validation | ||
| jobs: | ||
| - deployment: ValidateWinPkg | ||
| displayName: Validate Windows Packages | ||
| pool: server | ||
| environment: PSReleaseWinPkgValidate | ||
|
|
||
| - deployment: ValidateLinuxPkg | ||
| displayName: Validate Linux Packages | ||
| pool: server | ||
| environment: PSReleaseLinuxPkgValidate | ||
|
|
||
| - stage: ReleaseAutomation | ||
| displayName: Release Automation | ||
| dependsOn: [] | ||
| jobs: | ||
| - deployment: ReleaseAutomationKickOff | ||
| displayName: Kick off release ReleaseAutomation | ||
| pool: server | ||
| environment: PSReleaseAutomationKickOff | ||
|
|
||
| - stage: GitHubDraftRelease | ||
| displayName: Create GitHub draft release | ||
| # do not include stages that are likely to fail in dependency as there is no way to force deploy. | ||
| dependsOn: | ||
| - ValidateSDK | ||
| - PRCreation | ||
| - ValidatePkgNames | ||
| - StartDocker | ||
| - ManualValidation | ||
| - ReleaseAutomation | ||
|
|
||
| # The environment here is used for approval. | ||
| jobs: | ||
| - deployment: AzureBlobPublic | ||
| displayName: Make Azure Blob Public | ||
| pool: | ||
| vmImage: windows-latest | ||
| variables: | ||
| - group: 'ACR' | ||
| environment: PSReleaseAzureBlobPublic | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - template: templates/release-MakeContainerPublic.yml | ||
|
|
||
| - job: GitHubDraft | ||
| displayName: Create GitHub Draft release | ||
| pool: | ||
| vmImage: windows-latest | ||
| variables: | ||
| - group: 'Azure Blob variable group' | ||
| - group: 'AzDevOpsArtifacts' | ||
| dependsOn: AzureBlobPublic | ||
| steps: | ||
| - template: templates/release-CreateGitHubDraft.yml | ||
|
|
||
| - stage: GitHubManualTasks | ||
| displayName: GitHub manual tasks | ||
| dependsOn: GitHubDraftRelease | ||
| jobs: | ||
| - deployment: UpdateChangeLog | ||
| displayName: Update Change Log | ||
| pool : server | ||
| environment: PSReleaseUpdateChangeLog | ||
|
|
||
| - deployment: PushTag | ||
| displayName: Push Git Tag | ||
| pool : server | ||
| environment: PSReleasePushTag | ||
|
|
||
| - deployment: MakeDraftPublic | ||
| displayName: Make GitHub Draft public | ||
| pool : server | ||
| environment: PSReleaseDraftPublic | ||
|
|
||
| - stage: PublishPackages | ||
| displayName: Publish packages | ||
| dependsOn: GitHubManualTasks | ||
| jobs: | ||
| - job: PublishNuget | ||
| pool: | ||
| vmImage: windows-latest | ||
| steps: | ||
| - template: templates/release-ReleaseToNuGet.yml | ||
|
|
||
| - job: PublishPkgsMsftCom | ||
| pool: | ||
| vmImage: ubuntu-latest | ||
| variables: | ||
| - group: 'AzDevOpsArtifacts' | ||
| - group: 'packages.microsoft.com' | ||
| steps: | ||
| - template: templates/release-PublishPackageMsftCom.yml | ||
|
|
||
| - stage: ChangesToMaster | ||
| displayName: Ensure changes are in GH master | ||
| dependsOn: PublishPackages | ||
| jobs: | ||
| - deployment: MergeToMaster | ||
| displayName: Make sure changes are in master | ||
| pool: server | ||
| environment: PSReleaseChangesToMaster | ||
|
|
||
| - stage: ReleaseDocker | ||
| displayName: Release Docker | ||
| dependsOn: | ||
| - StartDocker | ||
| jobs: | ||
| - deployment: ReleaseDocker | ||
| displayName: Release Docker | ||
| pool: server | ||
| environment: PSReleaseDockerRelease | ||
|
|
||
| - stage: ReleaseSnap | ||
| displayName: Release Snap | ||
| dependsOn: | ||
| - PublishPackages | ||
| - ChangesToMaster | ||
| jobs: | ||
| - deployment: ReleaseSnap | ||
| displayName: Release Snap | ||
| pool: server | ||
| environment: PSReleaseSnapRelease | ||
|
|
||
| - stage: UpdateDotnetDocker | ||
| dependsOn: GitHubManualTasks | ||
| displayName: Update DotNet SDK Docker images | ||
| jobs: | ||
| - deployment: DotnetSDkDocker | ||
| displayName: Update .NET SDK docker images | ||
| pool: server | ||
| environment: PSReleaseUpdateDotnetDocker | ||
|
|
||
| - stage: BuildInfoJson | ||
| dependsOn: GitHubManualTasks | ||
| displayName: Upload BuildInfoJson | ||
| jobs: | ||
| - job: UploadJson | ||
| pool: | ||
| vmImage: windows-latest | ||
| variables: | ||
| - group: 'Azure Blob variable group' | ||
| steps: | ||
| - template: templates/release-BuildJson.yml | ||
|
|
||
| - stage: ReleaseVPack | ||
| dependsOn: GitHubManualTasks | ||
| displayName: Release VPack | ||
| jobs: | ||
| - deployment: ReleaseVPackManual | ||
| displayName: Release VPack | ||
| pool: server | ||
| environment: PSReleaseVpack | ||
|
|
||
| - stage: ReleaseDeps | ||
| dependsOn: GitHubManualTasks | ||
| displayName: Update pwsh.deps.json links | ||
| jobs: | ||
| - template: templates/release-UpdateDepsJson.yml | ||
|
|
||
| - stage: ReleaseClose | ||
| displayName: Finish Release | ||
| dependsOn: | ||
| - ReleaseVPack | ||
| - BuildInfoJson | ||
| - UpdateDotnetDocker | ||
| - ReleaseDocker | ||
| - ReleaseSnap | ||
| - ChangesToMaster | ||
| - ReleaseDeps | ||
| jobs: | ||
| - deployment: RetainBuild | ||
| displayName: Retain Build | ||
| pool: server | ||
| environment: PSReleaseRetainBuild | ||
|
|
||
| - deployment: DeleteBranch | ||
| displayName: Delete release branch | ||
| pool: server | ||
| environment: PSReleaseDeleteBranch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
tools/releaseBuild/azureDevOps/templates/release-BuildJson.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| steps: | ||
| - download: releasePipeline | ||
| artifact: BuildInfoJson | ||
|
|
||
| - pwsh: | | ||
| $jsonFile = Get-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/BuildInfoJson/*.json" | ||
| $fileName = Split-Path $jsonFile -Leaf | ||
|
|
||
| $dateTime = [datetime]::UtcNow | ||
| $dateTime = [datetime]::new($dateTime.Ticks - ($dateTime.Ticks % [timespan]::TicksPerSecond), $dateTime.Kind) | ||
|
|
||
| $buildInfo = Get-Content $jsonFile | ConvertFrom-Json | ||
| $buildInfo.ReleaseDate = $dateTime | ||
|
|
||
| $targetFile = "$ENV:PIPELINE_WORKSPACE/$fileName" | ||
| ConvertTo-Json -InputObject $buildInfo | Out-File $targetFile -Encoding ascii | ||
|
|
||
| $vstsCommandString = "vso[task.setvariable variable=BuildInfoJsonFile]$targetFile" | ||
| Write-Host "sending " + $vstsCommandString | ||
| Write-Host "##$vstsCommandString" | ||
|
|
||
|
|
||
| ## Create 'lts.json' if it's the latest stable and also a LTS release. | ||
|
|
||
| $vstsCommandCopyLTSBuildInfo = "vso[task.setvariable variable=CopyLTSBuildInfo]NO" | ||
|
|
||
| if ($fileName -eq "stable.json") | ||
| { | ||
| $releaseTag = $buildInfo.ReleaseTag | ||
| $version = $releaseTag -replace '^v' | ||
| $semVersion = [System.Management.Automation.SemanticVersion] $version | ||
|
|
||
| if ($semVersion.PreReleaseLabel -eq $null -and $semVersion.Minor % 2 -eq 0 -and $semVersion.Major -ge 7) | ||
| { | ||
| $ltsFile = "$ENV:PIPELINE_WORKSPACE/lts.json" | ||
| Copy-Item -Path $targetFile -Destination $ltsFile -Force | ||
| $vstsCommandLtsJsonFile = "vso[task.setvariable variable=LtsBuildInfoJsonFile]$ltsFile" | ||
| $vstsCommandCopyLTSBuildInfo = "vso[task.setvariable variable=CopyLTSBuildInfo]YES" | ||
| } | ||
| } | ||
|
|
||
| Write-Host "sending " + $vstsCommandCopyLTSBuildInfo | ||
| Write-Host "##$vstsCommandCopyLTSBuildInfo" | ||
|
|
||
| if ($vstsCommandLtsJsonFile) | ||
| { | ||
| Write-Host "sending " + $vstsCommandLtsJsonFile | ||
| Write-Host "##$vstsCommandLtsJsonFile" | ||
| } | ||
| displayName: Download and Capture NuPkgs | ||
|
|
||
| - task: AzureFileCopy@2 | ||
| displayName: 'AzureBlob build info JSON file Copy' | ||
| inputs: | ||
| SourcePath: '$(BuildInfoJsonFile)' | ||
| azureSubscription: '$(AzureFileCopySubscription)' | ||
| Destination: AzureBlob | ||
| storage: '$(StorageAccount)' | ||
| ContainerName: BuildInfo | ||
|
|
||
| - task: AzureFileCopy@2 | ||
| displayName: 'AzureBlob build info ''lts.json'' Copy when needed' | ||
| inputs: | ||
| SourcePath: '$(LtsBuildInfoJsonFile)' | ||
| azureSubscription: '$(AzureFileCopySubscription)' | ||
| Destination: AzureBlob | ||
| storage: '$(StorageAccount)' | ||
| ContainerName: BuildInfo | ||
| condition: and(succeeded(), eq(variables['CopyLTSBuildInfo'], 'YES')) |
22 changes: 22 additions & 0 deletions
22
tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| steps: | ||
| - download: none | ||
|
|
||
| - template: release-SetReleaseTagAndContainerName.yml | ||
|
|
||
| - pwsh: | | ||
| $azcopy = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe" | ||
| & $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:$(StorageAccountKey) | ||
| displayName: Download Azure Artifacts | ||
|
|
||
| - pwsh: | | ||
| Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name | ||
| displayName: Capture downloaded artifacts | ||
|
|
||
| - pwsh: | | ||
| git clone https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools '$(Pipeline.Workspace)/tools' | ||
| displayName: Clone Internal-Tools repository | ||
|
|
||
| - pwsh: | | ||
| Import-module '$(Pipeline.Workspace)/tools/Scripts/GitHubRelease.psm1' | ||
| Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description '<-- Update Me -->' -User PowerShell -Repository PowerShell -PackageFolder $(System.ArtifactsDirectory) -Token $(GitHubReleasePat) | ||
| displayName: Publish Release Draft | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.