|
| 1 | +--- |
| 2 | +name: prepare-release |
| 3 | +description: Prepare a release for the JavaScript Feature Management packages. 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 [JavaScript Feature Management](https://github.com/microsoft/FeatureManagement-JavaScript) 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-JavaScript |
| 21 | +- **Packages**: |
| 22 | + - `@microsoft/feature-management` |
| 23 | + - `@microsoft/feature-management-applicationinsights-browser` |
| 24 | + - `@microsoft/feature-management-applicationinsights-node` |
| 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/v2`) |
| 30 | + |
| 31 | +### Version Files |
| 32 | +The version must be updated in **all 7 files** simultaneously. Some files have multiple locations that need updating: |
| 33 | + |
| 34 | +1. `src/feature-management/src/version.ts` – line 4: `export const VERSION = "<version>";` |
| 35 | +2. `src/feature-management/package.json` – line 3: `"version": "<version>",` |
| 36 | +3. `src/feature-management/package-lock.json` – line 3: `"version": "<version>",` |
| 37 | +4. `src/feature-management/package-lock.json` – line 9: `"version": "<version>",` |
| 38 | +5. `src/feature-management-applicationinsights-browser/src/version.ts` – line 4: `export const VERSION = "<version>";` |
| 39 | +6. `src/feature-management-applicationinsights-browser/package.json` – line 3: `"version": "<version>",` AND the `@microsoft/feature-management` dependency version |
| 40 | +7. `src/feature-management-applicationinsights-node/src/version.ts` – line 4: `export const VERSION = "<version>";` |
| 41 | +8. `src/feature-management-applicationinsights-node/package.json` – line 3: `"version": "<version>",` AND the `@microsoft/feature-management` dependency version |
| 42 | + |
| 43 | +### Version Format |
| 44 | +- **Stable**: `{major}.{minor}.{patch}` (e.g., `2.4.0`) |
| 45 | +- **Preview**: `{major}.{minor}.{patch}-preview.{prerelease}` (e.g., `2.4.0-preview.1`) |
| 46 | + |
| 47 | +## Quick Start |
| 48 | + |
| 49 | +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. |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +### Workflow A: Stable Release |
| 54 | + |
| 55 | +#### Step 1: Version Bump PR |
| 56 | + |
| 57 | +Create a version bump PR targeting `main`: |
| 58 | + |
| 59 | +1. Fetch the latest `main` branch. |
| 60 | +2. Create a new branch from `main` named `<username>/version-<new_version>` |
| 61 | +3. Read the current version from `src/feature-management/src/version.ts`. |
| 62 | +4. Update the version in all 7 files (see [Version Files](#version-files) section above) by directly editing each file |
| 63 | +5. Commit all changes with message: `Version bump <new_version>`. |
| 64 | +6. Push the branch and create a PR targeting `main` with title: `Version bump <new_version>`. |
| 65 | + |
| 66 | +**Sample PR**: https://github.com/microsoft/FeatureManagement-JavaScript/pull/120 |
| 67 | + |
| 68 | +#### Step 2: Merge Main to Release Branch |
| 69 | + |
| 70 | +After the version bump PR is merged, create a PR to merge `main` into the release branch: |
| 71 | + |
| 72 | +1. Fetch the latest `main` branch. |
| 73 | +2. Create a new branch from `main` named `<username>/merge-main-to-release`. |
| 74 | +3. Push the branch and create a PR targeting `release/v{major}` (e.g., `release/v2`) with title: `Merge main to release/v{major}`. |
| 75 | + |
| 76 | +> **Important**: Use "Merge commit" (not squash) when merging this PR to preserve commit history. |
| 77 | +
|
| 78 | +--- |
| 79 | + |
| 80 | +### Workflow B: Preview Release |
| 81 | + |
| 82 | +#### Step 1: Version Bump PR |
| 83 | + |
| 84 | +Create a version bump PR targeting `preview`: |
| 85 | + |
| 86 | +1. Fetch the latest `preview` branch. |
| 87 | +2. Create a new branch from `preview` named `<username>/version-<new_version>` |
| 88 | +3. Read the current version from `src/feature-management/src/version.ts`. |
| 89 | +4. Update the version in all 7 files (see [Version Files](#version-files) section above) by directly editing each file |
| 90 | +5. Commit all changes with message: `Version bump <new_version>`. |
| 91 | +6. Push the branch and create a PR targeting `preview` with title: `Version bump <new_version>`. |
| 92 | + |
| 93 | +#### Step 2: Merge Preview to Release Branch |
| 94 | + |
| 95 | +After the version bump PR is merged, create a PR to merge `preview` into the release branch: |
| 96 | + |
| 97 | +1. Fetch the latest `preview` branch. |
| 98 | +2. Create a new branch from `preview` named `<username>/merge-preview-to-release`. |
| 99 | +3. Push the branch and create a PR targeting `release/v{major}` (e.g., `release/v2`) with title: `Merge preview to release/v{major}`. |
| 100 | + |
| 101 | +> **Important**: Use "Merge commit" (not squash) when merging this PR to preserve commit history. |
| 102 | +
|
| 103 | +--- |
| 104 | + |
| 105 | +## Review Checklist |
| 106 | + |
| 107 | +Each PR should be reviewed with the following checks: |
| 108 | +- [ ] Version is updated consistently across all 7 files |
| 109 | +- [ ] The `@microsoft/feature-management` dependency version in both applicationinsights packages matches the new version |
| 110 | +- [ ] No unintended file changes are included |
| 111 | +- [ ] Merge PRs use **merge commit** strategy (not squash) |
| 112 | +- [ ] Branch names follow the naming conventions |
| 113 | +- [ ] All CI checks pass |
0 commit comments