You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[nbgv tool](https://www.nuget.org/packages/nbgv/) (the version must match the one defined in [Directory.Packages.props](../Directory.Packages.props))
32
32
-[Java 8](https://adoptium.net/temurin/releases) or higher (either a JRE or JDK)
33
-
- Bash. If on Windows, this will automatically be installed by [Git for Windows](https://gitforwindows.org/).
33
+
- Bash (Installed automatically with [Git for Windows](https://gitforwindows.org/) on Windows).
34
34
35
35
### Installing the NBGV Tool
36
36
@@ -67,6 +67,10 @@ Repeat the first command to confirm that it is set.
67
67
68
68
This project uses Nerdbank.GitVersioning to assist with creating version numbers based on the current branch and commit. This tool handles making pre-release and production releases on release branches.
69
69
70
+
### Release Workflow Overview
71
+
72
+

73
+
70
74
### Prepare the Main Branch
71
75
72
76
1. Ensure all of the features that will be included have been merged to the `main` branch.
@@ -75,18 +79,59 @@ This project uses Nerdbank.GitVersioning to assist with creating version numbers
75
79
76
80
If any changes are required, it is recommended to use feature branch(es) and pull request(s) to update the `main` branch as appropriate before creating a release branch.
77
81
78
-
##Create a Release Branch
82
+
### Decide on a Release Version
79
83
80
-
### Release Workflow Overview
84
+
The version that will be released next is controlled by the `version.json` file. We must choose the release version and commit it to the `main` branch prior to creating a release branch.
81
85
82
-

86
+
> [!NOTE]
87
+
> If you are not familiar with these terms, these are covered in the [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html) document.
88
+
89
+
For the purposes of this project:
90
+
91
+
-**Major (Advanced)** - Released only when a new port of Lucene.NET is started (primarily to show a relationship between Lucene.NET and these analyzers)
92
+
-**Minor** - A typical release with one or more new features
93
+
-**Patch** - A release that only contains patches to existing features and/or updates to documentation
94
+
-**Prerelease** - A release that requires stabilization or is a one-off release for a specific purpose
95
+
96
+
> [!NOTE]
97
+
> This project doesn't have any public API that users consume, so the type of release is strictly informational in nature, not functional.
98
+
99
+
Now is the time to decide which of these strategies to use for the current version. For the next version (a future release version), we should always assume a patch. This is primarily so we never have to downgrade a version even if a patch is rarely done in practice.
100
+
101
+
With that in mind, open `version.json` and look at the "version" property, which will determine next version that will be released.
102
+
103
+
#### Example Version
104
+
105
+
```json
106
+
"version": "2.0.0-alpha.{height}"
107
+
```
108
+
109
+
The above example shows that the next version that will be released from a release branch is 2.0.0 or 2.0.0-beta.x (where x is an auto-incrementing number). The actual version in the file (alpha) will be used only if the `main` branch is released directly (something that is rare and not covered here).
110
+
111
+
If we are releasing new features and want the next Minor version (2.1.0), we need to update the `version.json` file to reflect that version.
112
+
113
+
```json
114
+
"version": "2.1.0-alpha.{height}"
115
+
```
116
+
117
+
Or, if the next version will be a patch, then leave the file unchanged. Commit any changes to the `main` branch and push them upstream before proceeding.
118
+
119
+
Prereleases should rarely need to change the `version.json` file and will later choose the [Requires Stabilization](#requires-stabilization) option when creating a release branch.
120
+
121
+
> [!IMPORTANT]
122
+
> Release version numbers must always use all 3 version components when specified in `version.json`.
123
+
124
+
## Create a Release Branch
83
125
84
126
There are 2 supported scenarios for the release workflow:
85
127
86
128
1.[Ready to Release](#ready-to-release) - No additional stabilization is required
87
129
2.[Requires Stabilization](#requires-stabilization) - A beta will be released, which will be marked as a pre-release to consumers
88
130
89
-
<!-- TODO: Add Versioning Primer link here -->
131
+
> [!NOTE]
132
+
> In both cases, `main` is advanced to the specified `--nextVersion`. This number should always be a **patch** bump and it should always use all 3 version components (major.minor.patch).
133
+
>
134
+
> The release branch name is always based on the version being released (e.g., `release/v2.0.0`).
90
135
91
136
### Ready to Release
92
137
@@ -122,7 +167,15 @@ release/v2.0.0 branch now tracks v2.0.0-beta.{height} stabilization and release.
122
167
main branch now tracks v2.0.1-alpha.{height} development.
123
168
```
124
169
125
-
The tool created a release branch named `release/v2.0.0`. Every build from this branch will be given a unique pre-release version starting with 2.0.0-beta and ending in a dot followed by one or more digits.
170
+
The tool created a release branch named `release/v2.0.0`. Every commit to this branch will be given a unique pre-release version starting with 2.0.0-beta and ending in a dot followed by one or more digits (i.e. `2.0.0-beta.123`).
171
+
172
+
### Checkout the Release Branch
173
+
174
+
After the release branch is created, the rest of the commits will be added to the release branch, so use the git checkout command to switch to that branch.
175
+
176
+
```console
177
+
git checkout <release-branch>
178
+
```
126
179
127
180
---------------------------------------------
128
181
@@ -157,7 +210,7 @@ Roslyn analyzers use two release tracking files to manage analyzer rule metadata
157
210
-**`AnalyzerReleases.Shipped.md`**
158
211
Tracks analyzer rules that have been released in one or more shipped packages. This is the authoritative record of rules shipped at specific versions.
159
212
160
-
Before tagging the release, you must ensure that these files are up to date. This guarantees that the release metadata reflects the rules included in the NuGet package.
213
+
Before tagging the release, you must ensure that these files are up to date. This ensures that the release metadata exactly matches the rules shipped in the NuGet package.
161
214
162
215
> [!NOTE]
163
216
> If the release doesn't contain new or changed analyzer rules, this step can be skipped. For example, if the release only contains new code fixes and/or backward compatible patches to existing analyzers.
@@ -245,20 +298,20 @@ Tagging the commit and pushing it to the GitHub repository will start the automa
245
298
246
299
#### Tag the HEAD Commit
247
300
248
-
Run the following command to tag the HEAD commit.
301
+
Run the following command to tag the HEAD commit of the release branch.
249
302
250
303
```console
251
304
nbgv tag
252
305
```
253
306
254
307
> [!NOTE]
255
-
> The release build workflow always uses the HEAD commit.
308
+
> The release build workflow always builds from the HEAD commit of the release branch.
256
309
257
310
#### Push the Release Branch to the Upstream Repository
258
311
259
312
The final step to begin the release build is to push the tag and any new commits to the upstream repository.
| notes:ignore| Removes the PR from the release notes |
@@ -353,12 +408,27 @@ Next, follow the same procedure starting at [Tag the HEAD Commit](#tag-the-head-
353
408
354
409
Finally, merge the release branch back into the main branch and push the changes to the upstream repository.
355
410
411
+
> [!IMPORTANT]
412
+
> Release branches start with `release\v`.
413
+
356
414
```console
357
415
git checkout main
358
416
git merge <release-branch>
359
417
git push <remote-name> main
360
418
```
361
419
420
+
### Delete the Release Branch
421
+
422
+
From this point, the release will be tracked historically using the Git tag, so there is no reason to keep the release branch once it has been merged. You may wish to delay the deletion for a few days in case it is needed for some reason, but when you are ready, the commands to delete the local and remote branches are:
423
+
424
+
> [!IMPORTANT]
425
+
> Release branches start with `release\v`. Take care not to delete the tag, which starts with a `v`.
426
+
427
+
```console
428
+
git branch -d <release-branch>
429
+
git push --delete <remote-name> <release-branch>
430
+
```
431
+
362
432
### Update Lucene.NET
363
433
364
434
The Lucene.NET project is the only consumer of this package. If the release was intended for general use (not just a one-off scan), update the version in `Dependencies.props` to reflect the new release and submit a pull request to [the Lucene.NET repository](https://github.com/apache/lucenenet).
0 commit comments