Skip to content

Commit b1b695e

Browse files
authored
Add a YAML release pipeline (#2832)
* Add the new pipeline * Update branching docs * Update Release.md * Add Ben to notification list
1 parent a6ce135 commit b1b695e

File tree

3 files changed

+104
-22
lines changed

3 files changed

+104
-22
lines changed

docs/operations/Branching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Update branding in `main`:
1818

1919
Update the runtimes and SDKs in `global.json` in `main`:
2020

21-
Check that the global.json includes the latest 3.1 runtime versions from [here](https://dotnet.microsoft.com/download/dotnet-core/3.1), and 5.0 from [here](https://dotnet.microsoft.com/download/dotnet/5.0), and 6.0 SDK from [here](https://dotnet.microsoft.com/download/dotnet/6.0).
21+
Check that the global.json includes the latest 8.0 runtime versions from [here](https://dotnet.microsoft.com/download/dotnet/8.0), and 9.0 from [here](https://dotnet.microsoft.com/download/dotnet/9.0).
2222

2323
[`eng/Versions.props`]: ../../eng/Versions.props

docs/operations/Release.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document provides a guide on how to release a preview of YARP.
44

5-
To keep track of the process, open a [release checklist issue](https://github.com/dotnet/yarp/issues/new?title=Preview%20X%20release%20checklist&body=See%20%5BRelease.md%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fblob%2Fmain%2Fdocs%2Foperations%2FRelease.md%29%20for%20detailed%20instructions.%0A%0A-%20%5B%20%5D%20Ensure%20there%27s%20a%20release%20branch%20created%20%28see%20%5BBranching%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fblob%2Fmain%2Fdocs%2Foperations%2FBranching.md%29%29%0A-%20%5B%20%5D%20Ensure%20the%20%60Version.props%60%20has%20the%20%60PreReleaseVersionLabel%60%20updated%20to%20the%20next%20preview%0A-%20%5B%20%5D%20Identify%20and%20validate%20the%20build%20on%20the%20%60microsoft-reverse-proxy-official%60%20pipeline%0A-%20%5B%20%5D%20Release%20the%20build%0A-%20%5B%20%5D%20Tag%20the%20commit%0A-%20%5B%20%5D%20Draft%20release%20notes%0A-%20%5B%20%5D%20Publish%20release%20notes%0A-%20%5B%20%5D%20Close%20the%20%5Bold%20milestone%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fmilestones%29%0A-%20%5B%20%5D%20Announce%20on%20social%20media%0A-%20%5B%20%5D%20Set%20the%20preview%20branch%20to%20protected%0A-%20%5B%20%5D%20Delete%20the%20%5Bprevious%20preview%20branch%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fbranches%29%0A-%20%5B%20%5D%20Request%20source%20code%20archival).
5+
To keep track of the process, open a [release checklist issue](https://github.com/dotnet/yarp/issues/new?title=Preview%20X%20release%20checklist&body=See%20%5BRelease.md%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fblob%2Fmain%2Fdocs%2Foperations%2FRelease.md%29%20for%20detailed%20instructions.%0A%0A-%20%5B%20%5D%20Ensure%20there%27s%20a%20release%20branch%20created%20%28see%20%5BBranching%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fblob%2Fmain%2Fdocs%2Foperations%2FBranching.md%29%29%0A-%20%5B%20%5D%20Ensure%20the%20%60Version.props%60%20has%20the%20%60PreReleaseVersionLabel%60%20updated%20to%20the%20next%20preview%0A-%20%5B%20%5D%20Identify%20and%20validate%20the%20build%20on%20the%20%60dotnet-yarp-official%60%20pipeline%0A-%20%5B%20%5D%20Release%20the%20build%0A-%20%5B%20%5D%20Tag%20the%20commit%0A-%20%5B%20%5D%20Draft%20release%20notes%0A-%20%5B%20%5D%20Publish%20release%20notes%0A-%20%5B%20%5D%20Close%20the%20%5Bold%20milestone%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fmilestones%29%0A-%20%5B%20%5D%20Announce%20on%20social%20media%0A-%20%5B%20%5D%20Set%20the%20preview%20branch%20to%20protected%0A-%20%5B%20%5D%20Delete%20the%20%5Bprevious%20preview%20branch%5D%28https%3A%2F%2Fgithub.com%2Fdotnet%2Fyarp%2Fbranches%29%0A-%20%5B%20%5D%20Request%20source%20code%20archival).
66

77
## Versioning
88

@@ -17,19 +17,19 @@ See [Branching](Branching.md):
1717

1818
## Identify the Final Build
1919

20-
First, identify the final build of the [`microsoft-reverse-proxy-official` Azure Pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=809&_a=summary) (on dnceng/internal). The final build will be the latest successful build **in the relevant `release/x` branch**. Use the "Branches" tab on Azure DevOps to help identify it. If the branch hasn't been mirrored yet (see [code-mirror pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=16&keywordFilter=microsoft%20reverse-proxy)) and there are no outstanding changesets in the branch, the build of the corresponding commit from the main branch can be used.
20+
First, identify the final build of the [`dotnet-yarp-official` Azure Pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=809&_a=summary) (on dnceng/internal). The final build will be the latest successful build **in the relevant `release/x` branch**. Use the "Branches" tab on Azure DevOps to help identify it. If the branch hasn't been mirrored yet (see [`dotnet-mirror-dnceng` pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=1387)) and there are no outstanding changesets in the branch, the build of the corresponding commit from the main branch can be used.
2121

2222
Once you've identified that build, click in to the build details.
2323

2424
## Validate the Final Build
2525

2626
At this point, you can perform any validation that makes sense. At a minimum, we should validate that the sample can run with the candidate packages. You can download the final build using the "Artifacts" which can be accessed under "Related" in the header:
2727

28-
![image](https://user-images.githubusercontent.com/7574/81447119-e4204800-9130-11ea-8952-9a0f9831f678.png)
28+
![image](https://github.com/user-attachments/assets/27ddf12d-f4b7-4faa-862e-d2d1d6eafea9)
2929

3030
The packages can be accessed from the `PackageArtifacts` artifact:
3131

32-
![image](https://user-images.githubusercontent.com/7574/81447168-fef2bc80-9130-11ea-8aa0-5a83d90efa0d.png)
32+
![image](https://github.com/user-attachments/assets/264b8c6d-8108-4536-a61b-421aa652df73)
3333

3434
### Consume .nupkg
3535

@@ -42,33 +42,32 @@ Also validate any major new scenarios this release and their associated docs.
4242

4343
## Release the build
4444

45-
Once validation has been completed, it's time to release. Go back to the Final Build in Azure DevOps. It's probably good to triple-check the version numbers of the packages in the artifacts against whatever validation was done at this point.
45+
Once validation has been completed, it's time to release.
4646

47-
Select "Release" from the triple-dot menu in the top-right of the build details page:
47+
Go to the [`dotnet-yarp-release` pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=1448) and select "Run Pipeline".
4848

49-
![image](https://user-images.githubusercontent.com/7574/81447354-55f89180-9131-11ea-84bc-0138d7b211e4.png)
49+
Under "Resources", select the pipeline run that you've validated artifacts for.
5050

51-
Verify the Release Pipeline selected is `microsoft-reverse-proxy-release`, that the `NuGet.org` stage has a blue border (meaning it will automatically deploy) and that the build number under Artifacts matches the build number of the final build (it will not match the package version). The defaults selected by Azure Pipelines should configure everything correctly but it's a good idea to double check.
51+
![image](https://github.com/user-attachments/assets/efa38319-2620-4deb-aca3-d2bf23c991cc)
52+
![image](https://github.com/user-attachments/assets/e25419e6-498d-4cc2-bf98-b5b2bc77c251)
53+
![image](https://github.com/user-attachments/assets/e2f7f965-b4f7-40dc-ba2f-6a91062271d5)
5254

53-
![image](https://user-images.githubusercontent.com/7574/81447433-76c0e700-9131-11ea-9e8b-e4984ab7c31a.png)
55+
Triple-check the version numbers of the packages in the artifacts against whatever validation was done at this point.
5456

55-
Click "Create" to start the release! Unless you're a release approver, you're done here!
57+
![image](https://github.com/user-attachments/assets/187d65d9-3c0f-4418-ab13-a77e0ad1b8e9)
5658

57-
## Approve the release
58-
59-
The Azure Pipeline will send an email to all the release approvers asking one of them to approve the release:
59+
Select "Run". Unless you're a release approver, you're done here!
6060

61-
![image](https://user-images.githubusercontent.com/7574/81447680-f3ec5c00-9131-11ea-821c-37dbe467faee.png)
62-
63-
Click "View Approval", or navigate to the release directly in Azure DevOps. You'll see that the stage is "Pending Approval"
61+
## Approve the release
6462

65-
![image](https://user-images.githubusercontent.com/7574/81447753-10889400-9132-11ea-9dd2-26b2f6bc8970.png)
63+
The Azure Pipeline will send an email to all the release approvers asking one of them to approve the release.
6664

67-
Click "Approve" to bring up the Approval dialog. Enter a comment such as "release for preview X" and click "Approve" to finalize the release. **After pressing "Approve", packages will be published automatically**. It *is* possible to cancel the pipeline, but it might be too late. See "Troubleshooting" below.
65+
![image](https://github.com/user-attachments/assets/e772e31c-8aea-4bca-a21f-8bd62f61365f)
6866

69-
![image](https://user-images.githubusercontent.com/7574/81447898-4d548b00-9132-11ea-89df-b4624a5e037d.png)
67+
Click "Review Manual Validation", or navigate to the release pipeline directly in Azure DevOps. You'll see that the stage is "Pending Approval"
7068

71-
Click "Reject" to cancel the release.
69+
Enter a comment such as "release for preview X" approve finalize the release.
70+
**After approving, packages will be published automatically**. It *is* possible to cancel the pipeline, but it might be too late. See "Troubleshooting" below.
7271

7372
The packages will be pushed and when the "NuGet.org" stage turns green, the packages are published!
7473

@@ -82,7 +81,7 @@ Create and push a git tag for the commit associated with the final build (not ne
8281

8382
Push the tag change to the upstream repo (**not your fork**)
8483

85-
`git push upstream --tags`
84+
`git push upstream v1.0.0-previewX`
8685

8786
## Draft release notes
8887

dotnet-yarp-release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
trigger: none
2+
name: $(Date:yyyyMMdd).$(Rev:r)
3+
4+
variables:
5+
- name: NuGetApiKey
6+
value:
7+
- name: NuGetFeed
8+
value: https://api.nuget.org/v3/index.json
9+
10+
resources:
11+
repositories:
12+
- repository: 1ESPipelineTemplates
13+
type: git
14+
name: 1ESPipelineTemplates/1ESPipelineTemplates
15+
ref: refs/tags/release
16+
pipelines:
17+
- pipeline: yarp-build
18+
source: dotnet\yarp\dotnet-yarp-official
19+
20+
extends:
21+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
22+
parameters:
23+
pool:
24+
name: NetCore1ESPool-Internal
25+
image: 1es-windows-2022
26+
os: windows
27+
28+
stages:
29+
- stage: release
30+
displayName: Release to NuGet
31+
jobs:
32+
- job: PreDeploymentApprovalJob
33+
displayName: Pre-Deployment Approval
34+
condition: succeeded()
35+
timeoutInMinutes: 2880
36+
pool: server
37+
steps:
38+
- task: ManualValidation@1
39+
inputs:
40+
notifyUsers: |-
41+
karelz@microsoft.com,
42+
samsp@microsoft.com,
43+
adityam@microsoft.com,
44+
mizupan@microsoft.com,
45+
bpetit@microsoft.com
46+
approvers: |-
47+
karelz@microsoft.com,
48+
samsp@microsoft.com,
49+
adityam@microsoft.com
50+
51+
- job: NuGetPush
52+
dependsOn: PreDeploymentApprovalJob
53+
condition: succeeded()
54+
timeoutInMinutes: 30
55+
templateContext:
56+
type: releaseJob
57+
isProduction: true
58+
inputs:
59+
- input: pipelineArtifact
60+
pipeline: yarp-build
61+
artifactName: artifacts
62+
steps:
63+
- task: NuGetToolInstaller@1
64+
displayName: Prepare NuGet tool
65+
- task: PowerShell@2
66+
displayName: NuGet push
67+
inputs:
68+
targetType: inline
69+
script: |
70+
tree $(Pipeline.Workspace)\Release\Shipping /f
71+
72+
Get-ChildItem "$(Pipeline.Workspace)\Release\Shipping\*" -Filter *.nupkg -Exclude *.symbols.nupkg | ForEach-Object {
73+
$name = $_.Name
74+
Write-Host "Processing $name ..."
75+
if ($name.StartsWith("Yarp.ReverseProxy.") -or $name.StartsWith("Yarp.Telemetry.Consumption.")) {
76+
Write-Host " Publishing $name"
77+
nuget push -Source $env:NuGetFeed -ApiKey $env:NuGetApiKey $_.FullName
78+
} else {
79+
Write-Host " Skipping $name (update the script to change this)"
80+
}
81+
}
82+
env:
83+
NuGetApiKey: $(NuGetApiKey)

0 commit comments

Comments
 (0)