Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e701a20249 | ||
|
|
643b30de7b | ||
|
|
eb233b1b34 | ||
|
|
dd89dbaaec | ||
|
|
97950ee2f4 | ||
|
|
da49d7514f | ||
|
|
a8aa4e71b8 | ||
|
|
1e3e561d5a | ||
|
|
1860979786 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -15,11 +15,11 @@ jobs:
|
||||
git fetch --tags
|
||||
git branch --create-reflog master origin/master
|
||||
- name: Install GitVersion
|
||||
uses: ./setup
|
||||
uses: ./setup-gitversion
|
||||
with:
|
||||
versionSpec: '5.1.x'
|
||||
- name: Use GitVersion
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: ./execute
|
||||
uses: ./execute-gitversion
|
||||
- run: |
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
|
||||
16
README.md
16
README.md
@@ -1,12 +1,14 @@
|
||||
# use-gitversion
|
||||
# GitTools actions
|
||||
|
||||

|
||||

|
||||
|
||||
Github Action that installs and uses the GitVersion tool
|
||||
GitHub Actions that allow to install and use the GitVersion and GitReleaseManager tools
|
||||
|
||||
[](https://github.com/GitTools/actions/actions)
|
||||
|
||||
## Usage
|
||||
|
||||
See [setup](setup/action.yml) and [usage](execute/action.yml)
|
||||
See [setup](setup-gitversion/action.yml) and [usage](execute-gitversion/action.yml)
|
||||
|
||||
## Dependency
|
||||
|
||||
@@ -32,12 +34,12 @@ Basic:
|
||||
git fetch --tags
|
||||
git branch --create-reflog master origin/master
|
||||
- name: Install GitVersion
|
||||
uses: gittools/use-gitversion/setup@v0.2
|
||||
uses: gittools/actions/setup-gitversion@v0.3
|
||||
with:
|
||||
versionSpec: '5.1.x'
|
||||
- name: Use GitVersion
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: gittools/use-gitversion/execute@v0.2
|
||||
uses: gittools/actions/execute-gitversion@v0.3
|
||||
- run: |
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: use-gitversion
|
||||
name: use-actions
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Installs the specific version of GitVersion.Tool
|
||||
author: GitTools
|
||||
branding:
|
||||
@@ -15,4 +15,4 @@ inputs:
|
||||
default: false
|
||||
runs:
|
||||
using: node12
|
||||
main: dist/github/setup/index.js
|
||||
main: dist/github/setup/index.js
|
||||
|
||||
31
dist/azure/execute/index.js
vendored
31
dist/azure/execute/index.js
vendored
File diff suppressed because one or more lines are too long
31
dist/azure/setup/index.js
vendored
31
dist/azure/setup/index.js
vendored
File diff suppressed because one or more lines are too long
31
dist/github/execute/index.js
vendored
31
dist/github/execute/index.js
vendored
File diff suppressed because one or more lines are too long
31
dist/github/setup/index.js
vendored
31
dist/github/setup/index.js
vendored
File diff suppressed because one or more lines are too long
BIN
docs/icon.png
Normal file
BIN
docs/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
95
execute-gitversion/action.yml
Normal file
95
execute-gitversion/action.yml
Normal file
@@ -0,0 +1,95 @@
|
||||
name: gitversion-execute
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Execute GitVersion to obtain version information
|
||||
author: GitTools
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
inputs:
|
||||
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:
|
||||
major: # id of output
|
||||
description: 'The Major value'
|
||||
minor:
|
||||
description: 'The Minor value'
|
||||
patch:
|
||||
description: 'The Patch value'
|
||||
preReleaseTag:
|
||||
description: 'The PreReleaseTag value'
|
||||
preReleaseTagWithDash:
|
||||
description: 'The PreReleaseTagWithDash value'
|
||||
preReleaseLabel:
|
||||
description: 'The PreReleaseLabel value'
|
||||
preReleaseNumber:
|
||||
description: 'The PreReleaseNumber value'
|
||||
weightedPreReleaseNumber:
|
||||
description: 'The WeightedPreReleaseNumber value'
|
||||
buildMetaData:
|
||||
description: 'The BuildMetaData value'
|
||||
buildMetaDataPadded:
|
||||
description: 'The BuildMetaDataPadded value'
|
||||
fullBuildMetaData:
|
||||
description: 'The FullBuildMetaData value'
|
||||
majorMinorPatch:
|
||||
description: 'The MajorMinorPatch value'
|
||||
semVer:
|
||||
description: 'The SemVer value'
|
||||
legacySemVer:
|
||||
description: 'The LegacySemVer value'
|
||||
legacySemVerPadded:
|
||||
description: 'The LegacySemVerPadded value'
|
||||
assemblySemVer:
|
||||
description: 'The AssemblySemVer value'
|
||||
assemblySemFileVer:
|
||||
description: 'The AssemblySemFileVer value'
|
||||
fullSemVer:
|
||||
description: 'The FullSemVer value'
|
||||
informationalVersion:
|
||||
description: 'The InformationalVersion value'
|
||||
branchName:
|
||||
description: 'The BranchName value'
|
||||
sha:
|
||||
description: 'The Sha value'
|
||||
shortSha:
|
||||
description: 'The ShortSha value'
|
||||
nuGetVersionV2:
|
||||
description: 'The NuGetVersionV2 value'
|
||||
nuGetVersion:
|
||||
description: 'The NuGetVersion value'
|
||||
nuGetPreReleaseTagV2:
|
||||
description: 'The NuGetPreReleaseTagV2 value'
|
||||
nuGetPreReleaseTag:
|
||||
description: 'The NuGetPreReleaseTag value'
|
||||
versionSourceSha:
|
||||
description: 'The VersionSourceSha value'
|
||||
commitsSinceVersionSource:
|
||||
description: 'The CommitsSinceVersionSource value'
|
||||
commitsSinceVersionSourcePadded:
|
||||
description: 'The CommitsSinceVersionSourcePadded value'
|
||||
commitDate:
|
||||
description: 'The CommitDate value'
|
||||
runs:
|
||||
using: node12
|
||||
main: ../dist/github/execute/index.js
|
||||
@@ -1,41 +0,0 @@
|
||||
name: gitversion-execute
|
||||
description: GitHub Action for Easy Semantic Versioning with GitVersion. Execute GitVersion to obtain version information
|
||||
author: GitTools
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
inputs:
|
||||
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:
|
||||
fullSemVer:
|
||||
description: 'The FullSemVer value'
|
||||
majorMinorPatch:
|
||||
description: 'The MajorMinorPatch value'
|
||||
shortSha:
|
||||
description: 'The ShortSha value'
|
||||
runs:
|
||||
using: node12
|
||||
main: ../dist/github/execute/index.js
|
||||
@@ -8,6 +8,7 @@
|
||||
},
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"package": "npm run package-github && npm run package-azure",
|
||||
"package-azure": "npm run package-azure-setup && npm run package-azure-execute",
|
||||
"package-github": "npm run package-github-setup && npm run package-github-execute",
|
||||
"package-azure-setup": "ncc build src/azure/setup.ts -o dist/azure/setup",
|
||||
|
||||
35
src/main.ts
35
src/main.ts
@@ -64,7 +64,36 @@ function getGitVersionOptions(buildAgent: IBuildAgent): IGitVersionOptions {
|
||||
}
|
||||
|
||||
function writeGitVersionToAgent(buildAgent: IBuildAgent, gitversion: IGitVersion): void {
|
||||
buildAgent.setOutput("fullSemVer", gitversion.FullSemVer);
|
||||
buildAgent.setOutput("majorMinorPatch", gitversion.MajorMinorPatch);
|
||||
buildAgent.setOutput("shortSha", gitversion.ShortSha);
|
||||
|
||||
buildAgent.setOutput("major", gitversion.Major.toString());
|
||||
buildAgent.setOutput("minor", gitversion.Minor.toString());
|
||||
buildAgent.setOutput("patch", gitversion.Patch.toString());
|
||||
buildAgent.setOutput("preReleaseTag", gitversion.PreReleaseTag);
|
||||
buildAgent.setOutput("preReleaseTagWithDash", gitversion.PreReleaseTagWithDash);
|
||||
buildAgent.setOutput("preReleaseLabel", gitversion.PreReleaseLabel);
|
||||
buildAgent.setOutput("preReleaseNumber", gitversion.PreReleaseNumber.toString());
|
||||
buildAgent.setOutput("weightedPreReleaseNumber", gitversion.WeightedPreReleaseNumber.toString());
|
||||
buildAgent.setOutput("buildMetaData", gitversion.BuildMetaData.toString());
|
||||
buildAgent.setOutput("buildMetaDataPadded", gitversion.BuildMetaDataPadded);
|
||||
buildAgent.setOutput("fullBuildMetaData", gitversion.FullBuildMetaData);
|
||||
buildAgent.setOutput("majorMinorPatch", gitversion.MajorMinorPatch);
|
||||
buildAgent.setOutput("semVer", gitversion.SemVer);
|
||||
buildAgent.setOutput("legacySemVer", gitversion.LegacySemVer);
|
||||
buildAgent.setOutput("legacySemVerPadded", gitversion.LegacySemVerPadded);
|
||||
buildAgent.setOutput("assemblySemVer", gitversion.AssemblySemVer);
|
||||
buildAgent.setOutput("assemblySemFileVer", gitversion.AssemblySemFileVer);
|
||||
buildAgent.setOutput("fullSemVer", gitversion.FullSemVer);
|
||||
buildAgent.setOutput("informationalVersion", gitversion.InformationalVersion);
|
||||
buildAgent.setOutput("branchName", gitversion.BranchName);
|
||||
buildAgent.setOutput("sha", gitversion.Sha);
|
||||
buildAgent.setOutput("shortSha", gitversion.ShortSha);
|
||||
buildAgent.setOutput("nuGetVersionV2", gitversion.NuGetVersionV2);
|
||||
buildAgent.setOutput("nuGetVersion", gitversion.NuGetVersion);
|
||||
buildAgent.setOutput("nuGetPreReleaseTagV2", gitversion.NuGetPreReleaseTagV2);
|
||||
buildAgent.setOutput("nuGetPreReleaseTag", gitversion.NuGetPreReleaseTag);
|
||||
buildAgent.setOutput("versionSourceSha", gitversion.VersionSourceSha);
|
||||
buildAgent.setOutput("commitsSinceVersionSource", gitversion.CommitsSinceVersionSource.toString());
|
||||
buildAgent.setOutput("commitsSinceVersionSourcePadded", gitversion.CommitsSinceVersionSourcePadded);
|
||||
buildAgent.setOutput("commitDate", gitversion.CommitDate);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user