-
Notifications
You must be signed in to change notification settings - Fork 1
Versioning
Pask adopts Semantic Versioning (SemVer). The property $Version
defines an object which breaks down different formats of the version number. There are essentially three functions which can define it:
-
Get-Version
(default) gets the version based on last git committer date (or current date if not in a git repository) in UTC -
Get-SemanticVersion
gets the semantic version from the input parameter -
Get-ProjectSemanticVersion
exactly asGet-SemanticVersion
, it gets the semantic version from the input parameter which is defined in a fileversion.txt
within the given project
Example: the default version is based on the last git committer date which is 2016-08-05 07:44:15
.
Major : 2016
Minor : 8
Patch : 5074415
PreReleaseLabel :
Build : 5
Revision : 74415
SemVer : 2016.8.5.74415
AssemblySemVer : 2016.8.5.744
InformationalVersion : 2016.8.5.74415
Example: the default version is based on the last git committer date which is 2016-08-05 07:44:15
within a branch new-feature
.
Major : 2016
Minor : 8
Patch : 5074415
PreReleaseLabel : new-feature
Build : 5
Revision : 74415
SemVer : 2016.8.5.74415-new-feature
AssemblySemVer : 2016.8.5.744
InformationalVersion : 2016.8.5.74415-new-feature
Example: explicitly set 1.4.2
semantic version.
Set-Property Version -Value (Get-SemanticVersion "1.4.2")
Major : 1
Minor : 4
Patch : 2
PreReleaseLabel :
Build : 2
Revision : 0
SemVer : 1.4.2
AssemblySemVer : 1.4.2.0
InformationalVersion : 1.4.2
Example: explicitly set 1.4.2-beta01
pre-release semantic version.
Set-Property Version -Value (Get-SemanticVersion "1.4.2-beta01")
Major : 1
Minor : 4
Patch : 2
PreReleaseLabel : beta01
Build : 2
Revision : 0
SemVer : 1.4.2-beta01
AssemblySemVer : 1.4.2.0
InformationalVersion : 1.4.2-beta01
Example: explicitly set 1.4.2
semantic version in a branch new-feature
with last git committer date 2016-11-12 11:35:20
.
Set-Property Version -Value (Get-SemanticVersion "1.4.2")
Major : 1
Minor : 4
Patch : 2
PreReleaseLabel : pre20161112113520
Build : 2
Revision : 0
SemVer : 1.4.2-pre20161112113520
AssemblySemVer : 1.4.2.0
InformationalVersion : 1.4.2-pre20161112113520
Example: explicitly set a semantic version from a file version.txt
in the default project.
Set-Property Version -Value (Get-ProjectSemanticVersion)
Example: explicitly set a semantic version from a file version.txt
in the project WebApplication
.
Set-Property Version -Value (Get-ProjectSemanticVersion -Name "WebApplication")