repo-version
0.1.13.4
See the version list below for details.
dotnet tool install --global repo-version --version 0.1.13.4
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local repo-version --version 0.1.13.4
#tool dotnet:?package=repo-version&version=0.1.13.4
nuke :add-package repo-version --version 0.1.13.4
repo-version
Automatic versioning for git repositories based tags, and the number of commits since the last tag.
Install
dotnet tool install -g repo-version
Update
dotnet tool update -g repo-version
Usage
You need to be somewhere within a git repository to run repo-version
. Alternatively, you can provide a path as an argument.
Let's say you have branched off of master at tag 1.2.2.1 and created a branch named feature/fix-null-reference
.
During your development you currently have 3 commits on your feature branch.
$ repo-version
1.2.2.3-fix-null-reference
or for more verbose output
$ repo-version -o json
{
"SemVer": "1.2.3.3-fix-null-reference",
"Major": "1",
"Minor": "2",
"Patch": "3",
"Commits": "3",
"PreReleaseTag": "fix-null-reference"
}
Now, let's say that your branch is ready to be merged, and you use a merge commit strategy. This will add 1 more commit.
Now on the master branch we run repo-version
again.
$ repo-version
1.2.3.4
When you are ready to finish the 1.2.3.x release you should tag the final commit.
git tag $(repo-version)
git push --tags
The next commit will be be automatically bumped to 1.2.4.1
repo-version.json
This file should be created at the root of your repository. This will control the major and minor versions, as well as provide pre-release tags based on branch names.
repo-version.json
{
"major": 0,
"minor": 1,
"branches": [
{
"regex": "^master$",
"tag": "alpha"
},
{
"regex": "^support[/-].*$",
"tag": ""
},
{
"regex": ".+",
"tag": "pr-{BranchName}"
}
]
}
The branches
section is an ordered list of branch configs. When trying to calculate the pre-release tag repo-version
will do a Regex match against each branch config, and use the first one that it finds.
In the given case the master
branch is currently in an alpha state, but the support branches are full releases. Everything else will get a name based on the branch name.
Why not just use GitVersion?
For years now I have used GitVersion, but I have a few gripes with it. First, I almost always use GitHubFlow, or at least I tend to branch from master, and merge to master. I find myself almost always controlling the major/minor revision with the next-version property, and using tags and commits to control the rest of the versioning. I do not need, and do not want, all of the other features that GitVersion provides. The extra config options it provides have frequently led to the inablility to correctly calculate the version during a build on a ci server, or worse, a VERY long build time where most of it was trying to calcualate the build on a very large repo. This project aims to acheive the parts of GitVersion that I love, without all of the baggage. As such, this project should be extremely light weight and opinionated. It will only support the git workflow that I use. Below are my initial thoughts for the first version.
1.0.0 features and assumptions
- master is main branch
- all branches start from master, and are merged back to master.
- major and minor revisions controlled by config file
- patch and commits are controlled by commits since tag.
- only need current branch to calculate version (no more bad versions without master)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.2.11.2 | 5,814 | 9/28/2019 |
0.2.10.2 | 576 | 9/28/2019 |
0.2.9.3 | 638 | 9/24/2019 |
0.2.8.2 | 627 | 8/25/2019 |
0.2.7.6 | 532 | 8/25/2019 |
0.2.7.3-alpha | 453 | 8/24/2019 |
0.2.6.15 | 577 | 8/22/2019 |
0.2.5.4 | 593 | 8/14/2019 |
0.2.2.2 | 574 | 8/12/2019 |
0.2.1.4 | 583 | 8/11/2019 |
0.2.0.6 | 611 | 8/11/2019 |
0.1.22.4 | 620 | 8/10/2019 |
0.1.21.2 | 563 | 8/9/2019 |
0.1.20.9 | 599 | 8/9/2019 |
0.1.20.7-alpha | 475 | 8/9/2019 |
0.1.19.7 | 568 | 8/8/2019 |
0.1.19.5 | 560 | 8/8/2019 |
0.1.19.2 | 567 | 8/8/2019 |
0.1.18.4 | 545 | 8/7/2019 |
0.1.18.2 | 560 | 8/7/2019 |
0.1.17.2 | 556 | 8/7/2019 |
0.1.16.2 | 580 | 8/7/2019 |
0.1.15.4 | 583 | 8/7/2019 |
0.1.14.4 | 609 | 8/7/2019 |
0.1.14.2 | 553 | 8/6/2019 |
0.1.13.12 | 576 | 8/6/2019 |
0.1.13.4 | 563 | 8/4/2019 |
0.1.13.2 | 595 | 8/4/2019 |
0.1.12.2 | 564 | 8/4/2019 |
0.1.11.2 | 557 | 8/4/2019 |
0.1.10.4 | 549 | 8/3/2019 |
0.1.10.2 | 566 | 8/3/2019 |
0.1.9.6 | 590 | 8/3/2019 |
0.1.9.4 | 571 | 8/3/2019 |
0.1.9.2 | 554 | 8/2/2019 |
0.1.8.7 | 516 | 8/2/2019 |
0.1.8.5 | 535 | 8/2/2019 |
0.1.8.3 | 583 | 8/2/2019 |
0.1.7.2 | 589 | 8/2/2019 |
0.1.6.11 | 586 | 8/2/2019 |
0.1.6.9-alpha | 484 | 8/2/2019 |
0.1.5.13 | 561 | 8/2/2019 |
0.1.4.15 | 574 | 7/31/2019 |
0.1.3.3 | 587 | 7/31/2019 |
0.1.1 | 620 | 7/29/2019 |
0.1.0 | 568 | 7/29/2019 |