GitHub Actions that allow to install and use the GitVersion and GitReleaseManager tools
GitHub Actions that allow the setup and use of the [GitVersion](https://github.com/GitTools/GitVersion) and [GitReleaseManager](https://github.com/GitTools/GitReleaseManager) tools.
See [setup](gitversion/setup) and [usage](gitversion/execute/action.yml)
### GitVersion
## Dependency
Examples for usage of **GitVersion**:
There are two step dependencies that are required in your workflow before running this action. You must checkout your Git repository and then fetch the master branch and tags.
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
"LIB_MkdirFailed":"Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists":"Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot":"Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare":"Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_ResourceFileAlreadySet":"Resource file has already set to: %s",
"LIB_ResourceFileNotSet":"Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed":"The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win":"Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound":"Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired":"%s not supplied",
"LIB_InputRequired":"Input required: %s",
"LIB_InvalidPattern":"Invalid pattern: '%s'",
"LIB_EndpointNotExist":"Endpoint not present: %s",
"LIB_EndpointDataNotExist":"Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist":"Endpoint auth data not present: %s",
"LIB_UseFirstGlobMatch":"Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported":"Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported":"Platform not supported: %s",
"TOOL_LIB_CachingTool":"Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment":"This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading":"Downloading: %s",
"_TOOL_LIB_Downloading.comment":"This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"_TOOL_LIB_ExtractingArchive.comment":"This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache":"Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment":"This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath":"Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment":"This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
@@ -2,5 +2,10 @@ Versioning when using Git, solved. GitVersion looks at your Git history and work
It works with most branching strategies but has been designed mainly around GitFlow and GitHubFlow (pull request workflow). The calculated version numbers can then be accessed through variables such as `$(GitVersion.NuGetVersion)` and `$(GitVersion.SemVer)`. It is also very configurable to allow it to work with most release workflows!
Find out how to use the **gitversion/execute** task using the examples below.
> The examples use the latest _0.x_ version of the GitVersion Execute task. It is recommended to use the latest released version in your own pipelines.
## Inputs
The Execute GitVersion task accepts the following inputs:
```yaml
targetPath:
description:Optionally supply the path to the working directory.
required:false
default:''
useConfigFile:
description:Whether to use a custom configuration file.
required:false
default:false
configFilePath:
description:Optional path to config file (defaults to GitVersion.yml).
required:false
default:''
updateAssemblyInfo:
description:Whether to update versions in the AssemblyInfo files.
required:false
default:false
updateAssemblyInfoFilename:
description:Update versions in specified file.
required:false
default:''
additionalArguments:
description:Additional arguments to send to GitVersion.
required:false
default:''
```
## Outputs
The Execute GitVersion task creates the following job-scoped variables and multi-job output variables:
The job-scoped variables can be accessed using the macro syntax `$(GitVersion.<variableName>)` in subsequent steps in the same job. Azure Pipelines also creates environment variables of the form `GITVERSION_<VARIABLENAME>`. See examples [5](#example-5) and [6](#example-6).
The multi-job output variables can be accessed across jobs and stages, in both conditions and variables. See examples [7](#example-7) to [10](#example-10).
**GitVersion also automatically updates the pre-defined Build variable `Build.BuildNumber`.**
---
## Examples
### Example 1
Calculate the version for the build.
```yaml
steps:
# gitversion/setup@0 task omitted for brevity.
- task:gitversion/execute@0
displayName:Determine Version
```
### Example 2
Calculate the version for the build using a config file with the default name **GitVersion.yml**.
```yaml
steps:
# gitversion/setup@0 task omitted for brevity.
- task:gitversion/execute@0
displayName:Determine Version
inputs:
useConfigFile:true
```
Example contents of **GitVersion.yml**:
```yaml
mode:Mainline
branches:
master:
regex:^latest$
pull-request:
tag:pr
```
### Example 3
Calculate the version for the build using a config file named **VersionConfig.yml** in the root of the working folder.
```yaml
steps:
# gitversion/setup@0 task omitted for brevity.
- task:gitversion/execute@0
displayName:Determine Version
inputs:
useConfigFile:true
configFilePath:'VersionConfig.yml'
```
### Example 4
Show the effective configuration for GitVersion by running the **/showConfig** command (passed as an additional argument).
```yaml
steps:
# gitversion/setup@0 task omitted for brevity.
- task:gitversion/execute@0
displayName:Display GitVersion config
inputs:
additionalArguments:'/showConfig'
```
### Example 5
Calculate the version for the build and display all the calculated variables in the next step.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.