9 Commits
v0.2 ... v0.3

Author SHA1 Message Date
Artur Stolear
e701a20249 update readme 2019-11-29 12:35:13 +02:00
Artur Stolear
643b30de7b rename the actions 2019-11-29 12:22:28 +02:00
Artur
eb233b1b34 Update action.yml 2019-11-29 12:16:37 +02:00
Artur Stolear
dd89dbaaec renamed the root action to actions 2019-11-29 12:14:26 +02:00
Artur
97950ee2f4 GH-6 Support all GitVersion variables (#7) 2019-11-29 11:12:26 +02:00
Artur
da49d7514f Update README.md 2019-11-26 15:43:27 +02:00
Artur
a8aa4e71b8 Added Github Actions CI badge 2019-11-26 15:43:04 +02:00
Gary Ewan Park
1e3e561d5a (doc) Minor correction (#5)
Github -> GitHub
2019-11-22 23:18:49 +02:00
Artur Stolear
1860979786 changed to lowercase 2019-11-22 20:24:42 +02:00
13 changed files with 258 additions and 64 deletions

View File

@@ -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 }}"

View File

@@ -1,12 +1,14 @@
# use-gitversion
# GitTools actions
![GitVersion](https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png "GitVersion")
![GitTools](docs/icon.png "GitTools")
Github Action that installs and uses the GitVersion tool
GitHub Actions that allow to install and use the GitVersion and GitReleaseManager tools
[![Build Status](https://github.com/GitTools/actions/workflows/CI/badge.svg)](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 }}"
```

View File

@@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
docs/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View 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

View File

@@ -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

View File

@@ -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",

View File

@@ -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);
}