Last active
April 1, 2018 06:27
-
-
Save Kimserey/676f32bcfba5b48549b0c841fd57ee60 to your computer and use it in GitHub Desktop.
Use Gitversion to find version of current branch, commit and tag to prepare for release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the version from master branch by running gitversion. | |
# Make sure Gitversion is registered in PATH! | |
$version = gitversion /showvariable semver | |
# Update Directory.build.props version <version></version>. | |
# It dictates all *.dll versions. | |
$propsPath = "$pwd\Directory.build.props" | |
[xml]$props = Get-Content $propsPath | |
$props.Project.PropertyGroup.Version = "$version" | |
$props.Save("$propsPath") | |
# Commit bump version and tag commit. | |
# Then push the newly tagged commit to origin. | |
git add $propsPath | |
git commit -m "Bump version for release" | |
git tag $version | |
git push --porcelain | |
git push --tags --porcelain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment