|
| 1 | +--- |
| 2 | +name: prepare-release |
| 3 | +description: "Prepare a release for the Feature Management .NET SDK. Use when user mentions release preparation, version bump, creating merge PRs, preview release, or stable release for this project." |
| 4 | +--- |
| 5 | + |
| 6 | +# Prepare Release |
| 7 | + |
| 8 | +This skill automates the release preparation workflow for the [Feature Management .NET SDK](https://github.com/microsoft/FeatureManagement-Dotnet) project. |
| 9 | + |
| 10 | +## When to Use This Skill |
| 11 | + |
| 12 | +Use this skill when you need to: |
| 13 | +- Bump the package version for a new stable or preview release |
| 14 | +- Create merge PRs to sync branches (main → release, preview → release) |
| 15 | +- Prepare all the PRs needed before publishing a new release |
| 16 | + |
| 17 | +## Background |
| 18 | + |
| 19 | +### Repository Information |
| 20 | +- **GitHub Repo**: https://github.com/microsoft/FeatureManagement-Dotnet |
| 21 | +- **Packages** (all 3 are released together with the same version): |
| 22 | + 1. `Microsoft.FeatureManagement` — Base package |
| 23 | + 2. `Microsoft.FeatureManagement.AspNetCore` — ASP.NET Core package |
| 24 | + 3. `Microsoft.FeatureManagement.Telemetry.ApplicationInsights` — Application Insights telemetry package |
| 25 | + |
| 26 | +### Branch Structure |
| 27 | +- `main` – primary development branch for stable releases |
| 28 | +- `preview` – development branch for preview releases |
| 29 | +- `release/v{major}` – release branch (e.g., `release/v4`) |
| 30 | + |
| 31 | +### Version Files |
| 32 | +The version is defined by `<MajorVersion>`, `<MinorVersion>`, `<PatchVersion>`, and optionally `<PreviewVersion>` properties in **all three** `.csproj` files simultaneously: |
| 33 | +1. `src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj` |
| 34 | +2. `src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj` |
| 35 | +3. `src/Microsoft.FeatureManagement.Telemetry.ApplicationInsights/Microsoft.FeatureManagement.Telemetry.ApplicationInsights.csproj` |
| 36 | + |
| 37 | +Each file contains a version block like: |
| 38 | +```xml |
| 39 | +<!-- Official Version --> |
| 40 | +<PropertyGroup> |
| 41 | + <MajorVersion>4</MajorVersion> |
| 42 | + <MinorVersion>1</MinorVersion> |
| 43 | + <PatchVersion>0</PatchVersion> |
| 44 | +</PropertyGroup> |
| 45 | +``` |
| 46 | + |
| 47 | +For preview versions, a `<PreviewVersion>` line is also present: |
| 48 | +```xml |
| 49 | +<!-- Official Version --> |
| 50 | +<PropertyGroup> |
| 51 | + <MajorVersion>4</MajorVersion> |
| 52 | + <MinorVersion>0</MinorVersion> |
| 53 | + <PatchVersion>0</PatchVersion> |
| 54 | + <PreviewVersion>-preview5</PreviewVersion> |
| 55 | +</PropertyGroup> |
| 56 | +``` |
| 57 | + |
| 58 | +### Version Format |
| 59 | +- **Stable**: `{major}.{minor}.{patch}` (e.g., `4.1.0`) |
| 60 | +- **Preview**: `{major}.{minor}.{patch}-preview{N}` (e.g., `4.0.0-preview5`) |
| 61 | + |
| 62 | +## Quick Start |
| 63 | + |
| 64 | +Ask the user whether this is a **stable** or **preview** release, and what the **new version number** should be. Then follow the appropriate workflow below. |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### Workflow A: Stable Release |
| 69 | + |
| 70 | +#### Step 1: Version Bump PR |
| 71 | + |
| 72 | +Create a version bump PR targeting `main` by running the version bump script: |
| 73 | + |
| 74 | +```powershell |
| 75 | +.\scripts\version-bump.ps1 <new_version> |
| 76 | +``` |
| 77 | + |
| 78 | +For example: `.\scripts\version-bump.ps1 4.2.0` |
| 79 | + |
| 80 | +The script will automatically: |
| 81 | +1. Read the current version from the first `.csproj` file. |
| 82 | +2. Create a new branch from `main` named `<username>/version-bump-<new_version>` (e.g., `linglingye/version-bump-4.2.0`). |
| 83 | +3. Update `<MajorVersion>`, `<MinorVersion>`, `<PatchVersion>` in all three `.csproj` files, and remove `<PreviewVersion>` if present. |
| 84 | +4. Commit, push, and create a PR to `main` with title: `Version bump <new_version>`. |
| 85 | + |
| 86 | +When the script prompts `Proceed? [y/N]`, confirm by entering `y`. |
| 87 | + |
| 88 | +**Sample PR**: https://github.com/microsoft/FeatureManagement-Dotnet/pull/540 |
| 89 | + |
| 90 | +#### Step 2: Merge Main to Release Branch |
| 91 | + |
| 92 | +After the version bump PR is merged, create a PR to merge `main` into the release branch by running: |
| 93 | + |
| 94 | +```powershell |
| 95 | +.\scripts\merge-to-release.ps1 <new_version> |
| 96 | +``` |
| 97 | + |
| 98 | +For example: `.\scripts\merge-to-release.ps1 4.2.0` |
| 99 | + |
| 100 | +When the script prompts `Proceed? [y/N]`, confirm by entering `y`. |
| 101 | + |
| 102 | +> **Important**: Use "Create a merge commit" (not "Squash and merge") when merging this PR to preserve commit history. |
| 103 | +
|
| 104 | +**Sample PR**: https://github.com/microsoft/FeatureManagement-Dotnet/pull/541 |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### Workflow B: Preview Release |
| 109 | + |
| 110 | +#### Step 1: Version Bump PR |
| 111 | + |
| 112 | +Create a version bump PR targeting `preview` by running the version bump script with the `-Preview` flag: |
| 113 | + |
| 114 | +```powershell |
| 115 | +.\scripts\version-bump.ps1 <new_version> -Preview |
| 116 | +``` |
| 117 | + |
| 118 | +For example: `.\scripts\version-bump.ps1 4.0.0-preview4 -Preview` |
| 119 | + |
| 120 | +When the script prompts `Proceed? [y/N]`, confirm by entering `y`. |
| 121 | + |
| 122 | +**Sample PR**: https://github.com/microsoft/FeatureManagement-Dotnet/pull/476 |
| 123 | + |
| 124 | +#### Step 2: Merge Preview to Release Branch |
| 125 | + |
| 126 | +After the version bump PR is merged, create a PR to merge `preview` into the release branch by running: |
| 127 | + |
| 128 | +```powershell |
| 129 | +.\scripts\merge-to-release.ps1 <new_version> -Preview |
| 130 | +``` |
| 131 | + |
| 132 | +For example: `.\scripts\merge-to-release.ps1 4.0.0-preview4 -Preview` |
| 133 | + |
| 134 | +When the script prompts `Proceed? [y/N]`, confirm by entering `y`. |
| 135 | + |
| 136 | +> **Important**: Use "Create a merge commit" (not "Squash and merge") when merging this PR to preserve commit history. |
| 137 | +
|
| 138 | +**Sample PR**: https://github.com/microsoft/FeatureManagement-Dotnet/pull/477 |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## Review Checklist |
| 143 | + |
| 144 | +Each PR should be reviewed with the following checks: |
| 145 | +- [ ] Version is updated consistently across all 3 `.csproj` files |
| 146 | +- [ ] No unintended file changes are included |
| 147 | +- [ ] Merge PRs use **merge commit** strategy (not squash) |
| 148 | +- [ ] Branch names follow the naming conventions |
| 149 | +- [ ] All CI checks pass |
0 commit comments