Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f943a7b7 | ||
|
|
0b2f796e4d | ||
|
|
e971e77318 | ||
|
|
b925f8e478 | ||
|
|
a33003e772 | ||
|
|
a448a9f0a2 | ||
|
|
2d2c6d300f | ||
|
|
f9651f49f0 | ||
|
|
4c753ece22 | ||
|
|
3de8a57a92 | ||
|
|
18efce22d9 | ||
|
|
4ace268ae2 | ||
|
|
6a7df9e3f1 | ||
|
|
a7fd499098 | ||
|
|
b55b3344de | ||
|
|
965ad03650 | ||
|
|
9a35a04f4c | ||
|
|
b7cd8c7635 | ||
|
|
936c2a5f80 | ||
|
|
f9e93cf489 | ||
|
|
246501445f | ||
|
|
5576f1f4f3 | ||
|
|
4b8e1b04eb | ||
|
|
f6df8a60a7 | ||
|
|
6eb9c9d972 | ||
|
|
e72a3b732f | ||
|
|
512189b67e | ||
|
|
04dabe3db9 | ||
|
|
a5bd3bccab | ||
|
|
ace779fa65 | ||
|
|
e36b091f69 | ||
|
|
0f5d09ce56 | ||
|
|
ae681f57e6 | ||
|
|
26360d9b0f | ||
|
|
c4fd6f73e9 | ||
|
|
b3e9769761 | ||
|
|
d08937d559 | ||
|
|
3ae78bd823 |
12
README.md
12
README.md
@@ -2,13 +2,15 @@
|
||||
|
||||

|
||||
|
||||
GitHub Actions that allow to install and use the [GitVersion](https://github.com/GitTools/GitVersion) and [GitReleaseManager](https://github.com/GitTools/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.
|
||||
|
||||
[](https://github.com/GitTools/actions/actions)
|
||||
[](https://github.com/GitTools/actions/actions)
|
||||
|
||||
[](https://marketplace.visualstudio.com/items?itemName=gittools.gittools)
|
||||
[](https://github.com/marketplace/actions/use-actions)
|
||||
[](https://github.com/GitTools/actions/releases/latest)
|
||||
|
||||
[](https://marketplace.visualstudio.com/items?itemName=gittools.gittools)
|
||||
[](https://github.com/marketplace/actions/gittools)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -17,11 +19,11 @@ GitHub Actions that allow to install and use the [GitVersion](https://github.com
|
||||
Examples for usage of **GitVersion**:
|
||||
|
||||
- [GitHub Actions](docs/examples/github/gitversion/index.md)
|
||||
- [Azure Pipeline tasks](docs/examples/azure/gitversion/index.md)
|
||||
- [Azure Pipelines tasks](docs/examples/azure/gitversion/index.md)
|
||||
|
||||
### GitReleaseManager
|
||||
|
||||
Examples for usage of **GitReleaseManager**:
|
||||
|
||||
- [GitHub Actions](docs/examples/github/gitreleasemanager/index.md)
|
||||
- [Azure Pipeline tasks](docs/examples/azure/gitreleasemanager/index.md)
|
||||
- [Azure Pipelines tasks](docs/examples/azure/gitreleasemanager/index.md)
|
||||
|
||||
13
action.yml
13
action.yml
@@ -1,18 +1,9 @@
|
||||
name: use-actions
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Installs the specific version of GitVersion.Tool
|
||||
name: GitTools
|
||||
description: Build tasks for easy semantic versioning for projects using Git and release management.
|
||||
author: GitTools
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
inputs:
|
||||
versionSpec:
|
||||
description: Required version in the form of 5.x or exact version like 5.0.0
|
||||
required: true
|
||||
default: ''
|
||||
includePrerelease:
|
||||
description: Include pre-release versions when matching a version
|
||||
required: false
|
||||
default: false
|
||||
runs:
|
||||
using: node12
|
||||
main: dist/github/setup/index.js
|
||||
|
||||
5
dist/azure/gitversion/execute/bundle.js
vendored
5
dist/azure/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
5
dist/azure/gitversion/setup/bundle.js
vendored
5
dist/azure/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/azure/images/build-task.png
vendored
BIN
dist/azure/images/build-task.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
BIN
dist/azure/images/pipeline-editor-tasks.png
vendored
Normal file
BIN
dist/azure/images/pipeline-editor-tasks.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
9
dist/azure/overview.md
vendored
9
dist/azure/overview.md
vendored
@@ -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!
|
||||
|
||||

|
||||

|
||||
## Azure Pipelines tasks
|
||||
|
||||

|
||||
|
||||
## Azure Pipelines run examples
|
||||
|
||||

|
||||
|
||||
BIN
dist/azure/screenshots/pipeline-editor-execute-gitversion-task.png
vendored
Normal file
BIN
dist/azure/screenshots/pipeline-editor-execute-gitversion-task.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
dist/azure/screenshots/pipeline-editor-setup-gitversion-task.png
vendored
Normal file
BIN
dist/azure/screenshots/pipeline-editor-setup-gitversion-task.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
BIN
dist/azure/screenshots/pipeline-run-execute-gitversion-task.png
vendored
Normal file
BIN
dist/azure/screenshots/pipeline-run-execute-gitversion-task.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
BIN
dist/azure/screenshots/pipeline-run-setup-gitversion-task.png
vendored
Normal file
BIN
dist/azure/screenshots/pipeline-run-setup-gitversion-task.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
18
dist/azure/vss-extension.json
vendored
18
dist/azure/vss-extension.json
vendored
@@ -19,7 +19,8 @@
|
||||
{ "path": "gitreleasemanager/close" },
|
||||
{ "path": "gitreleasemanager/open" },
|
||||
{ "path": "gitreleasemanager/publish" },
|
||||
{ "path": "gitreleasemanager/addasset" }
|
||||
{ "path": "gitreleasemanager/addasset" },
|
||||
{ "path": "images", "addressable": true }
|
||||
],
|
||||
"categories": [
|
||||
"Azure Pipelines"
|
||||
@@ -55,11 +56,18 @@
|
||||
"uri": "https://github.com/GitTools/actions/issues"
|
||||
}
|
||||
},
|
||||
"screenshots": [{
|
||||
"path": "images/builds.png"
|
||||
"screenshots": [
|
||||
{
|
||||
"path": "screenshots/pipeline-editor-setup-gitversion-task.png"
|
||||
},
|
||||
{
|
||||
"path": "images/build-task.png"
|
||||
"path": "screenshots/pipeline-run-setup-gitversion-task.png"
|
||||
},
|
||||
{
|
||||
"path": "screenshots/pipeline-editor-execute-gitversion-task.png"
|
||||
},
|
||||
{
|
||||
"path": "screenshots/pipeline-run-execute-gitversion-task.png"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
@@ -149,4 +157,4 @@
|
||||
"name": "gitreleasemanager/addasset"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
64
dist/github/gitreleasemanager/addasset/bundle.js
vendored
64
dist/github/gitreleasemanager/addasset/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/close/bundle.js
vendored
64
dist/github/gitreleasemanager/close/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/create/bundle.js
vendored
64
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/discard/bundle.js
vendored
64
dist/github/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/open/bundle.js
vendored
64
dist/github/gitreleasemanager/open/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/publish/bundle.js
vendored
64
dist/github/gitreleasemanager/publish/bundle.js
vendored
File diff suppressed because one or more lines are too long
64
dist/github/gitreleasemanager/setup/bundle.js
vendored
64
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
67
dist/github/gitversion/execute/bundle.js
vendored
67
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
67
dist/github/gitversion/setup/bundle.js
vendored
67
dist/github/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
5
dist/mock/gitversion/execute/bundle.js
vendored
5
dist/mock/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
5
dist/mock/gitversion/setup/bundle.js
vendored
5
dist/mock/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
299
docs/examples/azure/gitversion/execute/usage-examples.md
Normal file
299
docs/examples/azure/gitversion/execute/usage-examples.md
Normal file
@@ -0,0 +1,299 @@
|
||||
# Execute GitVersion Task (gitversion/execute) Usage Examples
|
||||
|
||||
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:
|
||||
|
||||
- GitVersion.Major
|
||||
- GitVersion.Minor
|
||||
- GitVersion.Patch
|
||||
- GitVersion.PreReleaseTag
|
||||
- GitVersion.PreReleaseTagWithDash
|
||||
- GitVersion.PreReleaseLabel
|
||||
- GitVersion.PreReleaseNumber
|
||||
- GitVersion.WeightedPreReleaseNumber
|
||||
- GitVersion.BuildMetaData
|
||||
- GitVersion.BuildMetaDataPadded
|
||||
- GitVersion.FullBuildMetaData
|
||||
- GitVersion.MajorMinorPatch
|
||||
- GitVersion.SemVer
|
||||
- GitVersion.LegacySemVer
|
||||
- GitVersion.LegacySemVerPadded
|
||||
- GitVersion.AssemblySemVer
|
||||
- GitVersion.AssemblySemFileVer
|
||||
- GitVersion.FullSemVer
|
||||
- GitVersion.InformationalVersion
|
||||
- GitVersion.BranchName
|
||||
- GitVersion.EscapedBranchName (since 5.2.0)
|
||||
- GitVersion.Sha
|
||||
- GitVersion.ShortSha
|
||||
- GitVersion.NuGetVersionV2
|
||||
- GitVersion.NuGetVersion
|
||||
- GitVersion.NuGetPreReleaseTagV2
|
||||
- GitVersion.NuGetPreReleaseTag
|
||||
- GitVersion.VersionSourceSha
|
||||
- GitVersion.CommitsSinceVersionSource
|
||||
- GitVersion.CommitsSinceVersionSourcePadded (since 5.2.0)
|
||||
- GitVersion.UncommittedChanges (since 5.5.0)
|
||||
- GitVersion.CommitDate
|
||||
|
||||
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.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Determine Version
|
||||
|
||||
- script: |
|
||||
echo Major: $(GitVersion.Major)
|
||||
echo Minor: $(GitVersion.Minor)
|
||||
echo Patch: $(GitVersion.Patch)
|
||||
echo PreReleaseTag: $(GitVersion.PreReleaseTag)
|
||||
echo PreReleaseTagWithDash: $(GitVersion.PreReleaseTagWithDash)
|
||||
echo PreReleaseLabel: $(GitVersion.PreReleaseLabel)
|
||||
echo PreReleaseNumber: $(GitVersion.PreReleaseNumber)
|
||||
echo WeightedPreReleaseNumber: $(GitVersion.WeightedPreReleaseNumber)
|
||||
echo BuildMetaData: $(GitVersion.BuildMetaData)
|
||||
echo BuildMetaDataPadded: $(GitVersion.BuildMetaDataPadded)
|
||||
echo FullBuildMetaData: $(GitVersion.FullBuildMetaData)
|
||||
echo MajorMinorPatch: $(GitVersion.MajorMinorPatch)
|
||||
echo SemVer: $(GitVersion.SemVer)
|
||||
echo LegacySemVer: $(GitVersion.LegacySemVer)
|
||||
echo LegacySemVerPadded: $(GitVersion.LegacySemVerPadded)
|
||||
echo AssemblySemVer: $(GitVersion.AssemblySemVer)
|
||||
echo AssemblySemFileVer: $(GitVersion.AssemblySemFileVer)
|
||||
echo FullSemVer: $(GitVersion.FullSemVer)
|
||||
echo InformationalVersion: $(GitVersion.InformationalVersion)
|
||||
echo BranchName: $(GitVersion.BranchName)
|
||||
echo EscapedBranchName: $(GitVersion.EscapedBranchName)
|
||||
echo Sha: $(GitVersion.Sha)
|
||||
echo ShortSha: $(GitVersion.ShortSha)
|
||||
echo NuGetVersionV2: $(GitVersion.NuGetVersionV2)
|
||||
echo NuGetVersion: $(GitVersion.NuGetVersion)
|
||||
echo NuGetPreReleaseTagV2: $(GitVersion.NuGetPreReleaseTagV2)
|
||||
echo NuGetPreReleaseTag: $(GitVersion.NuGetPreReleaseTag)
|
||||
echo VersionSourceSha: $(GitVersion.VersionSourceSha)
|
||||
echo CommitsSinceVersionSource: $(GitVersion.CommitsSinceVersionSource)
|
||||
echo CommitsSinceVersionSourcePadded: $(GitVersion.CommitsSinceVersionSourcePadded)
|
||||
echo UncommittedChanges: $(GitVersion.UncommittedChanges)
|
||||
echo CommitDate: $(GitVersion.CommitDate)
|
||||
```
|
||||
|
||||
### Example 6
|
||||
|
||||
Calculate the version for the build and use the `GitVersion.NuGetVersion` variable to set the NuGet package version.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Determine Version
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Pack Example
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: src/Example/LibExample.csproj
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: GitVersion.NuGetVersion # alternative syntax GITVERSION_NUGETVERSION (the former gets converted into the latter internally)
|
||||
```
|
||||
|
||||
### Example 7
|
||||
|
||||
Calculate the version for the build and use the `GitVersion.BranchName` variable in a condition for starting another job.
|
||||
|
||||
```yaml
|
||||
job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
|
||||
job: CreateReleaseNotes
|
||||
condition: and(succeeded(), eq(dependencies.CalculateVersion.outputs['Version.GitVersion.BranchName'], 'main')
|
||||
dependsOn: CalculateVersion
|
||||
```
|
||||
|
||||
### Example 8
|
||||
|
||||
Calculate the version for the build and map the `GitVersion.SemVer` variable into a variable in another job.
|
||||
|
||||
```yaml
|
||||
job: CalculateVersion
|
||||
displayName: Calculate version using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another job.
|
||||
|
||||
job: BuildAndPack
|
||||
variables:
|
||||
Ver.MajorMinorPatch: $[ dependencies.CalculateVersion.outputs['Version.GitVersion.MajorMinorPatch'] ]
|
||||
```
|
||||
|
||||
### Example 9
|
||||
|
||||
Calculate the version for the build and use the `GitVersion.Major` output variable in a condition for starting another stage.
|
||||
|
||||
```yaml
|
||||
stages:
|
||||
- stage: S1
|
||||
jobs:
|
||||
- job: CalculateVersion
|
||||
displayName: Calculate version number using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another stage.
|
||||
|
||||
- stage: S2
|
||||
condition: and(succeeded(), gt(dependencies.S1.outputs['CalculateVersion.Version.GitVersion.Major'], 0))
|
||||
dependsOn: S1
|
||||
```
|
||||
|
||||
### Example 10
|
||||
|
||||
Calculate the version for the build and map the `GitVersion.AssemblySemVer` variable into a variable in another job for a different stage.
|
||||
|
||||
```yaml
|
||||
stages:
|
||||
- stage: S1
|
||||
jobs:
|
||||
- job: CalculateVersion
|
||||
displayName: Calculate version number using GitVersion
|
||||
steps:
|
||||
# gitversion/setup@0 task omitted for brevity.
|
||||
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
name: Version # the step MUST be named to access its output variables in another stage.
|
||||
- stage: S2
|
||||
dependsOn: S1
|
||||
jobs:
|
||||
- job: UpdateAssemblyVersions
|
||||
variables:
|
||||
Ver.AssemblyVer: $[ stageDependencies.S1.CalculateVersion.outputs['Version.GitVersion.AssemblySemVer'] ] # Note the 'stageDependencies.<jobName>' syntax.
|
||||
```
|
||||
@@ -1,43 +1,11 @@
|
||||
# Example
|
||||
# GitVersion Tasks Usage Examples
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitversion/setup@0
|
||||
displayName: Install GitVersion
|
||||
inputs:
|
||||
versionSpec: '5.1.3'
|
||||
- task: gitversion/execute@0
|
||||
displayName: Use GitVersion
|
||||
- script: |
|
||||
echo FullSemVer: $(fullSemVer)
|
||||
echo ##vso[build.updatebuildnumber]$(fullSemVer)
|
||||
echo Major: ${{ steps.gitversion.outputs.major }}
|
||||
echo Minor: ${{ steps.gitversion.outputs.minor }}
|
||||
echo Patch: ${{ steps.gitversion.outputs.patch }}
|
||||
echo PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}
|
||||
echo PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}
|
||||
echo PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
|
||||
echo PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}
|
||||
echo WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}
|
||||
echo BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}
|
||||
echo BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}
|
||||
echo FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}
|
||||
echo MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
|
||||
echo SemVer: ${{ steps.gitversion.outputs.semVer }}
|
||||
echo LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}
|
||||
echo LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}
|
||||
echo AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}
|
||||
echo AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}
|
||||
echo InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}
|
||||
echo BranchName: ${{ steps.gitversion.outputs.branchName }}
|
||||
echo Sha: ${{ steps.gitversion.outputs.sha }}
|
||||
echo ShortSha: ${{ steps.gitversion.outputs.shortSha }}
|
||||
echo NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
|
||||
echo NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}
|
||||
echo NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}
|
||||
echo NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}
|
||||
echo VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}
|
||||
echo CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}
|
||||
echo CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
|
||||
echo CommitDate: ${{ steps.gitversion.outputs.commitDate }}
|
||||
```
|
||||
Use the following links to see usage examples of the Setup GitVersion (**gitversion/setup**) and Execute GitVersion (**gitversion/execute**) tasks.
|
||||
|
||||
## Setup GitVersion (gitversion/setup)
|
||||
|
||||
- [Usage examples](setup/usage-examples.md)
|
||||
|
||||
## Execute GitVersion (gitversion/execute)
|
||||
|
||||
- [Usage examples](execute/usage-examples.md)
|
||||
|
||||
61
docs/examples/azure/gitversion/setup/usage-examples.md
Normal file
61
docs/examples/azure/gitversion/setup/usage-examples.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Setup GitVersion Task (gitversion/setup) Usage Examples
|
||||
|
||||
Find out how to use the **gitversion/setup** task using the examples below.
|
||||
|
||||
> The examples use the latest _0.x_ version of the GitVersion Setup task. It is recommended to use the latest released version in your own pipelines.
|
||||
|
||||
## Inputs
|
||||
|
||||
The Setup GitVersion task accepts the following inputs:
|
||||
|
||||
```yaml
|
||||
versionSpec:
|
||||
description: Required version in the form of 5.x or exact version like 5.0.0.
|
||||
required: true
|
||||
default: ''
|
||||
includePrerelease:
|
||||
description: Include pre-release versions when matching a version.
|
||||
required: false
|
||||
default: false
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage examples
|
||||
|
||||
### Example 1
|
||||
|
||||
Install the latest GitVersion 5 version.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitversion/setup@0
|
||||
displayName: Install GitVersion
|
||||
inputs:
|
||||
versionSpec: '5.x'
|
||||
```
|
||||
|
||||
### Example 2
|
||||
|
||||
Install GitVersion 5.5.0.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitversion/setup@0
|
||||
displayName: Install GitVersion
|
||||
inputs:
|
||||
versionSpec: '5.5.0'
|
||||
```
|
||||
|
||||
### Example 3
|
||||
|
||||
Install the latest GitVersion 6 pre-release version. For example **6.0.0-beta1.1**.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- task: gitversion/setup@0
|
||||
displayName: Install GitVersion
|
||||
inputs:
|
||||
versionSpec: '6.x'
|
||||
includePrerelease: true
|
||||
```
|
||||
283
docs/examples/github/gitversion/execute/usage-examples.md
Normal file
283
docs/examples/github/gitversion/execute/usage-examples.md
Normal file
@@ -0,0 +1,283 @@
|
||||
# Execute GitVersion Action (gitversion/execute) Usage Examples
|
||||
|
||||
Find out how to use the **gitversion/execute** action using the examples below.
|
||||
|
||||
For the GitVersion workflow to execute successfully, you must checkout your Git repository with `fetch-depth: 0` to fetch all history for all tags and branches, as follows:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
```
|
||||
|
||||
This step is omitted from the examples for brevity.
|
||||
|
||||
> The examples use version _0.9.6_ of the GitVersion Execute action. It is recommended to use the latest released version in your own workflows.
|
||||
|
||||
## Inputs
|
||||
|
||||
The Execute GitVersion action 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: 'GitVersion.yml'
|
||||
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 action creates the following outputs:
|
||||
|
||||
- major
|
||||
- minor
|
||||
- patch
|
||||
- preReleaseTag
|
||||
- preReleaseTagWithDash
|
||||
- preReleaseLabel
|
||||
- preReleaseNumber
|
||||
- weightedPreReleaseNumber
|
||||
- buildMetaData
|
||||
- buildMetaDataPadded
|
||||
- fullBuildMetaData
|
||||
- majorMinorPatch
|
||||
- semVer
|
||||
- legacySemVer
|
||||
- legacySemVerPadded
|
||||
- assemblySemVer
|
||||
- assemblySemFileVer
|
||||
- fullSemVer
|
||||
- informationalVersion
|
||||
- branchName
|
||||
- escapedBranchName (since 5.2.0)
|
||||
- sha
|
||||
- shortSha
|
||||
- nuGetVersionV2
|
||||
- nuGetVersion
|
||||
- nuGetPreReleaseTagV2
|
||||
- nuGetPreReleaseTag
|
||||
- versionSourceSha
|
||||
- commitsSinceVersionSource
|
||||
- commitsSinceVersionSourcePadded (since 5.2.0)
|
||||
- uncommittedChanges (since 5.5.0)
|
||||
- commitDate
|
||||
|
||||
The outputs can be accessed using the syntax `${{ steps.<id>.outputs.<outputName> }}`, where `<id>` is the ID assigned to the step that calls the action, by subsequent steps later in the same job. See example [5](#example-5).
|
||||
|
||||
The action also creates environment variables of the form `GITVERSION_<OUTPUTNAME>` for use by other steps in the same job. See example [6](#example-6).
|
||||
|
||||
The outputs can be accessed across jobs by mapping them to job outputs and referencing the job outputs using the `needs` context in dependent jobs. See examples [7](#example-7) and [8](#example-8).
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1
|
||||
|
||||
Calculate the version for the build.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.6 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
```
|
||||
|
||||
### Example 2
|
||||
|
||||
Calculate the version for the build using a config file with the default name **GitVersion.yml**.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
with:
|
||||
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@v0.9.6 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
with:
|
||||
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@v0.9.6 action omitted for brevity.
|
||||
|
||||
- name: Display GitVersion config
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
with:
|
||||
useConfigFile: true
|
||||
additionalArguments: '/showConfig'
|
||||
```
|
||||
|
||||
### Example 5
|
||||
|
||||
Calculate the version for the build and display all the calculated variables in the next step.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.6 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
|
||||
- name: Display GitVersion outputs
|
||||
run: |
|
||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
|
||||
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
|
||||
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
|
||||
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
|
||||
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
|
||||
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
|
||||
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
|
||||
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
|
||||
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
|
||||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
|
||||
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
|
||||
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
|
||||
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
|
||||
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
|
||||
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
|
||||
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
|
||||
echo "EscapedBranchName: ${{ steps.gitversion.outputs.escapedBranchName }}"
|
||||
echo "Sha: ${{ steps.gitversion.outputs.sha }}"
|
||||
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
|
||||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
|
||||
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
|
||||
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
|
||||
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
|
||||
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
|
||||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
||||
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
|
||||
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
||||
```
|
||||
|
||||
### Example 6
|
||||
|
||||
Calculate the version for the build and display the value of the `GITVERSION_SEMVER` environment variable.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
# gitversion/setup@v0.9.6 action omitted for brevity.
|
||||
|
||||
- name: Determine Version
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
|
||||
- name: Display SemVer
|
||||
run: |
|
||||
echo "SemVer: $GITVERSION_SEMVER"
|
||||
```
|
||||
|
||||
### Example 7
|
||||
|
||||
Calculate the version for the build and use the `branchName` output in a condition for starting another job.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
calculate-version:
|
||||
name: Calculate Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branchName: ${{ steps.gitversion.outputs.branchName }} # To use an output in another job, you have to map it to a job output.
|
||||
steps:
|
||||
# gitversion/execute step omitted for brevity
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
|
||||
create-release-notes:
|
||||
name: Create Release Notes
|
||||
runs-on: ubuntu-latest
|
||||
needs: calculate-version
|
||||
if: contains(needs.calculate-version.outputs.branchName, 'main') # Output variable accessed via `needs` context.
|
||||
steps:
|
||||
- run: |
|
||||
# Output variables can also be accessed in steps, using an expression.
|
||||
echo "Creating release notes for ${{ needs.calculate-version.outputs.branchName }} branch."
|
||||
```
|
||||
|
||||
### Example 8
|
||||
|
||||
Calculate the version for the build and map the `semVer` output into an environment variable in another job.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
calculate-version:
|
||||
name: Calculate Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
semVer: ${{ steps.gitversion.outputs.semVer }}
|
||||
steps:
|
||||
# gitversion/execute step omitted for brevity
|
||||
|
||||
- name: Determine Version
|
||||
id: gitversion
|
||||
uses: gittools/actions/gitversion/execute@v0.9.6
|
||||
|
||||
display-semver:
|
||||
name: Display Semantic Version
|
||||
runs-on: ubuntu-latest
|
||||
needs: calculate-version
|
||||
env:
|
||||
SEMVER: ${{ needs.calculate-version.outputs.semVer }}
|
||||
steps:
|
||||
- name: Display version
|
||||
run: |
|
||||
echo SemVer: $SEMVER
|
||||
```
|
||||
@@ -1,50 +1,11 @@
|
||||
# GitVersion
|
||||
# GitVersion Actions Usage Examples
|
||||
|
||||
For the GitVersion workflow to execute successfully, you must checkout your Git
|
||||
repository with `fetch-depth: 0` to fetch all history for all tags and branches.
|
||||
Use the following links to see usage examples of the Setup GitVersion (**gitversion/setup**) and Execute GitVersion (**gitversion/execute**) actions.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.4
|
||||
with:
|
||||
versionSpec: '5.3.x'
|
||||
- name: Use GitVersion
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: gittools/actions/gitversion/execute@v0.9.4
|
||||
- run: |
|
||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
|
||||
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
|
||||
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
|
||||
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
|
||||
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
|
||||
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
|
||||
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
|
||||
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
|
||||
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
|
||||
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
|
||||
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
|
||||
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
|
||||
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
|
||||
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
|
||||
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
|
||||
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
|
||||
echo "Sha: ${{ steps.gitversion.outputs.sha }}"
|
||||
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
|
||||
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
|
||||
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
|
||||
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
|
||||
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
|
||||
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
|
||||
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
|
||||
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
|
||||
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
|
||||
```
|
||||
## Setup GitVersion (gitversion/setup)
|
||||
|
||||
- [Usage examples](setup/usage-examples.md)
|
||||
|
||||
## Execute GitVersion (gitversion/execute)
|
||||
|
||||
- [Usage examples](execute/usage-examples.md)
|
||||
|
||||
61
docs/examples/github/gitversion/setup/usage-examples.md
Normal file
61
docs/examples/github/gitversion/setup/usage-examples.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Setup GitVersion Action (gitversion/setup) Usage Examples
|
||||
|
||||
Find out how to use the **gitversion/setup** action using the examples below.
|
||||
|
||||
> The examples use version _0.9.6_ of the GitVersion Execute action. It is recommended to use the latest released version in your own workflows.
|
||||
|
||||
## Inputs
|
||||
|
||||
The Setup GitVersion action accepts the following inputs:
|
||||
|
||||
```yaml
|
||||
versionSpec:
|
||||
description: Required version in the form of 5.x or exact version like 5.0.0.
|
||||
required: true
|
||||
default: ''
|
||||
includePrerelease:
|
||||
description: Include pre-release versions when matching a version.
|
||||
required: false
|
||||
default: false
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage examples
|
||||
|
||||
### Example 1
|
||||
|
||||
Install the latest GitVersion 5 version.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.6
|
||||
with:
|
||||
versionSpec: '5.x'
|
||||
```
|
||||
|
||||
### Example 2
|
||||
|
||||
Install GitVersion 5.5.0.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.6
|
||||
with:
|
||||
versionSpec: '5.5.0'
|
||||
```
|
||||
|
||||
### Example 3
|
||||
|
||||
Install the latest GitVersion 6 pre-release version. For example **6.0.0-beta1.1**.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Install GitVersion
|
||||
uses: gittools/actions/gitversion/setup@v0.9.6
|
||||
with:
|
||||
versionSpec: '6.x'
|
||||
includePrerelease: true
|
||||
```
|
||||
@@ -19,7 +19,7 @@ inputs:
|
||||
configFilePath:
|
||||
description: Optional path to config file (defaults to GitVersion.yml)
|
||||
required: false
|
||||
default: ''
|
||||
default: 'GitVersion.yml'
|
||||
updateAssemblyInfo:
|
||||
description: Whether to update versions in the AssemblyInfo files
|
||||
required: false
|
||||
@@ -73,6 +73,8 @@ outputs:
|
||||
description: 'The InformationalVersion value'
|
||||
branchName:
|
||||
description: 'The BranchName value'
|
||||
escapedBranchName:
|
||||
description: 'The EscapedBranchName value'
|
||||
sha:
|
||||
description: 'The Sha value'
|
||||
shortSha:
|
||||
@@ -91,5 +93,7 @@ outputs:
|
||||
description: 'The CommitsSinceVersionSource value'
|
||||
commitsSinceVersionSourcePadded:
|
||||
description: 'The CommitsSinceVersionSourcePadded value'
|
||||
uncommittedChanges:
|
||||
description: 'The UncommittedChanges value'
|
||||
commitDate:
|
||||
description: 'The CommitDate value'
|
||||
@@ -1,5 +1,5 @@
|
||||
name: gitversion-setup
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Installs the specific version of GitVersion.Tool
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Installs the specific version of GitVersion tool
|
||||
author: GitTools
|
||||
branding:
|
||||
color: gray-dark
|
||||
|
||||
150
package-lock.json
generated
150
package-lock.json
generated
@@ -18,9 +18,9 @@
|
||||
}
|
||||
},
|
||||
"@actions/http-client": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz",
|
||||
"integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==",
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.9.tgz",
|
||||
"integrity": "sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==",
|
||||
"requires": {
|
||||
"tunnel": "0.0.6"
|
||||
},
|
||||
@@ -38,11 +38,11 @@
|
||||
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
|
||||
},
|
||||
"@actions/tool-cache": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.6.0.tgz",
|
||||
"integrity": "sha512-+fyEBImPD3m5I0o6DflCO0NHY180LPoX8Lo6y4Iez+V17kO8kfkH0VHxb8mUdmD6hn9dWA9Ch1JA20fXoIYUeQ==",
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.6.1.tgz",
|
||||
"integrity": "sha512-F+vwEDwfqcHMKuSkj79pihOnsAMv23EkG76nMpc82UsnXwyQdyEsktGxrB0SNtm7pRqTXEIOoAPTgrSQclXYTg==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.0",
|
||||
"@actions/http-client": "^1.0.8",
|
||||
"@actions/io": "^1.0.1",
|
||||
@@ -89,9 +89,9 @@
|
||||
}
|
||||
},
|
||||
"@types/eslint": {
|
||||
"version": "7.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz",
|
||||
"integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==",
|
||||
"version": "7.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.5.tgz",
|
||||
"integrity": "sha512-Dc6ar9x16BdaR3NSxSF7T4IjL9gxxViJq8RmFd+2UAyA+K6ck2W+gUwfgpG/y9TPyUuBL35109bbULpEynvltA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "*",
|
||||
@@ -127,9 +127,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.14.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
|
||||
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
|
||||
"version": "14.14.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.9.tgz",
|
||||
"integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/normalize-package-data": {
|
||||
@@ -610,15 +610,16 @@
|
||||
}
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "4.14.6",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz",
|
||||
"integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==",
|
||||
"version": "4.14.7",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz",
|
||||
"integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-lite": "^1.0.30001154",
|
||||
"electron-to-chromium": "^1.3.585",
|
||||
"caniuse-lite": "^1.0.30001157",
|
||||
"colorette": "^1.2.1",
|
||||
"electron-to-chromium": "^1.3.591",
|
||||
"escalade": "^3.1.1",
|
||||
"node-releases": "^1.1.65"
|
||||
"node-releases": "^1.1.66"
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
@@ -682,9 +683,9 @@
|
||||
}
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001156",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001156.tgz",
|
||||
"integrity": "sha512-z7qztybA2eFZTB6Z3yvaQBIoJpQtsewRD74adw2UbRWwsRq3jIPvgrQGawBMbfafekQaD21FWuXNcywtTDGGCw==",
|
||||
"version": "1.0.30001159",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001159.tgz",
|
||||
"integrity": "sha512-w9Ph56jOsS8RL20K9cLND3u/+5WASWdhC/PPrf+V3/HsM3uHOavWOR1Xzakbv4Puo/srmPHudkmCRWM7Aq+/UA==",
|
||||
"dev": true
|
||||
},
|
||||
"caseless": {
|
||||
@@ -922,9 +923,9 @@
|
||||
}
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.3.591",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.591.tgz",
|
||||
"integrity": "sha512-ol/0WzjL4NS4Kqy9VD6xXQON91xIihDT36sYCew/G/bnd1v0/4D+kahp26JauQhgFUjrdva3kRSo7URcUmQ+qw==",
|
||||
"version": "1.3.603",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.603.tgz",
|
||||
"integrity": "sha512-J8OHxOeJkoSLgBXfV9BHgKccgfLMHh+CoeRo6wJsi6m0k3otaxS/5vrHpMNSEYY4MISwewqanPOuhAtuE8riQQ==",
|
||||
"dev": true
|
||||
},
|
||||
"emojis-list": {
|
||||
@@ -1823,9 +1824,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node-releases": {
|
||||
"version": "1.1.66",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz",
|
||||
"integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==",
|
||||
"version": "1.1.67",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
|
||||
"integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==",
|
||||
"dev": true
|
||||
},
|
||||
"normalize-package-data": {
|
||||
@@ -2048,9 +2049,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz",
|
||||
"integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.0.tgz",
|
||||
"integrity": "sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw==",
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
@@ -2781,9 +2782,9 @@
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
|
||||
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.2.tgz",
|
||||
"integrity": "sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"typical": {
|
||||
@@ -2889,9 +2890,9 @@
|
||||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz",
|
||||
"integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==",
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.6.0.tgz",
|
||||
"integrity": "sha512-SIeFuBhuheKElRbd84O35UhKc0nxlgSwtzm2ksZ0BVhRJqxVJxEguT/pYhfiR0le/pxTa1VsCp7EOYyTsa6XOA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/eslint-scope": "^3.7.0",
|
||||
@@ -2936,70 +2937,11 @@
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
|
||||
"dev": true
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"jest-worker": {
|
||||
"version": "26.6.2",
|
||||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
|
||||
"integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"merge-stream": "^2.0.0",
|
||||
"supports-color": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz",
|
||||
"integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"tapable": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz",
|
||||
"integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz",
|
||||
"integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==",
|
||||
"dev": true
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz",
|
||||
"integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jest-worker": "^26.6.1",
|
||||
"p-limit": "^3.0.2",
|
||||
"schema-utils": "^3.0.0",
|
||||
"serialize-javascript": "^5.0.1",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^5.3.8"
|
||||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
|
||||
"integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-list-map": "^2.0.1",
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3123,6 +3065,16 @@
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
|
||||
"integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-list-map": "^2.0.1",
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
|
||||
10
package.json
10
package.json
@@ -29,7 +29,7 @@
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/io": "^1.0.2",
|
||||
"@actions/tool-cache": "^1.6.0",
|
||||
"@actions/tool-cache": "^1.6.1",
|
||||
"azure-pipelines-task-lib": "^2.11.3",
|
||||
"azure-pipelines-tool-lib": "^0.13.2",
|
||||
"inversify": "^5.0.1",
|
||||
@@ -37,19 +37,19 @@
|
||||
"uuid": "^8.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.14.7",
|
||||
"@types/node": "^14.14.9",
|
||||
"@types/q": "^1.5.4",
|
||||
"@types/semver-compare": "^1.0.1",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"minimist": "^1.2.5",
|
||||
"prettier": "^2.1.2",
|
||||
"prettier": "^2.2.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
"tfx-cli": "^0.8.3",
|
||||
"ts-loader": "^8.0.11",
|
||||
"typescript": "^4.0.5",
|
||||
"webpack": "^5.4.0",
|
||||
"typescript": "^4.1.2",
|
||||
"webpack": "^5.6.0",
|
||||
"webpack-cli": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export interface GitVersionOutput {
|
||||
FullSemVer: string
|
||||
InformationalVersion: string
|
||||
BranchName: string
|
||||
EscapedBranchName: string
|
||||
Sha: string
|
||||
ShortSha: string
|
||||
NuGetVersionV2: string
|
||||
@@ -48,5 +49,6 @@ export interface GitVersionOutput {
|
||||
VersionSourceSha: string
|
||||
CommitsSinceVersionSource: number
|
||||
CommitsSinceVersionSourcePadded: string
|
||||
UncommittedChanges: number
|
||||
CommitDate: string
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
workDir = srcDir
|
||||
} else {
|
||||
if (this.buildAgent.directoryExists(targetPath)) {
|
||||
workDir = path.join(srcDir, targetPath)
|
||||
workDir = targetPath
|
||||
} else {
|
||||
throw new Error('Directory not found at ' + targetPath)
|
||||
}
|
||||
@@ -182,12 +182,12 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
}
|
||||
|
||||
private toCamelCase(input: string): string {
|
||||
return input.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (
|
||||
match,
|
||||
index
|
||||
) {
|
||||
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
||||
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
||||
})
|
||||
return input.replace(
|
||||
/(?:^\w|[A-Z]|\b\w|\s+)/g,
|
||||
function (match, index) {
|
||||
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
|
||||
return index == 0 ? match.toLowerCase() : match.toUpperCase()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user