Giter Club home page Giter Club logo

versionize's Introduction

Versionize

Travis build status AppVeyor build status Coverage Status Conventional Commits

stop using weird build scripts to increment your nuget's version, use versionize!

Automatic versioning and CHANGELOG generation, using conventional commit messages.

how it works:

  1. when you land commits on your master branch, select the Squash and Merge option (not required).
  2. add a title and body that follows the Conventional Commits Specification.
  3. when you're ready to release a nuget package:
    1. git checkout master; git pull origin master
    2. run versionize
    3. git push --follow-tags origin master
    4. dotnet pack
    5. dotnet nuget push

versionize does the following:

  1. bumps the version in your .csproj file (based on your commit history)
  2. uses conventional-changelog to update CHANGELOG.md
  3. commits .csproj file and CHANGELOG.md
  4. tags a new release

Installation

dotnet tool install --global Versionize

Usage

Usage: versionize [options]

Options:
  -?|-h|--help                         Show help information
  -v|--version                         Show version information
  -w|--workingDir <WORKING_DIRECTORY>  Directory containing projects to version
  -d|--dry-run                         Skip changing versions in projects, changelog generation and git commit
  --skip-dirty                         Skip git dirty check
  -r|--release-as <VERSION>            Specify the release version manually
  --silent                             Supress output to console

Supported commit types

Every commit should be in the form <type>[optional scope]: <description> for example fix(parser): remove colon from type and scope

  • fix - will trigger a patch version increment in the next release
  • feat - will trigger a minor version increment in the next release
  • all other types - you can use any commit type but that commit type will not trigger a version increment in the next release

Breaking changes must contain a line prefixed with BREAKING CHANGE: to allow versionize recognizing a breaking change. Breaking changes can use any commit type.

Example

git commit -m "chore: update dependencies" -m "BREAKING CHANGE: this will likely break the interface"

The happy versioning walkthrough

Preparation

Create a new project with the dotnet cli

mkdir SomeProject
dotnet new classlib

Ensure that a <Version> element is contained in file SomeProject.csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <Version>1.0.0</Version>
  </PropertyGroup>
</Project>

Using versionize

Now let's start committing and releasing

git init
...make some changes to "Class1.cs"
git add *
git commit -a -m "chore: initial commit"

versionize

Will add a CHANGELOG.md, add git tags and commit everything. Note that the version in SomeProject.csproj will not change since this is your first release with versionize.

...make some changes to "Class1.cs"
git commit -a -m "fix: something went wrong we need a bugfix release"

versionize

Will update CHANGELOG.md, add git tags and commit everything. Note that the version in SomeProject.csproj is now 1.0.1.

...make some changes to "Class1.cs"
git commit -a -m "feat: something really awesome coming in the next release"

versionize

Will update CHANGELOG.md, add git tags and commit everything. Note that the version in SomeProject.csproj is now 1.1.0.

...make some changes to "Class1.cs"
git commit -a -m "feat: a really cool new feature" -m "BREAKING CHANGE: the API will break. sorry"

versionize

Will update CHANGELOG.md, add git tags and commit everything. Note that the version in SomeProject.csproj is now 2.0.0 since versionize detected a breaking change since the commit note BREAKING CHANGE was used above.

Roadmap

  • Pre Releases to allow creating beta.1, beta.2 versions
  • --silent command line switch to supress commandline output
  • --should-version command line switch to test if a new version should be created based on commits and return a non zero exit code if no new version should be released

versionize's People

Contributors

saintedlama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.