21 Commits
v0.2 ... v0.3.1

Author SHA1 Message Date
Artur
6465152ce9 fow now ci only outputs the version, later will execute tests 2019-11-30 22:46:38 +02:00
Artur
bba2ce73bc Create release.yml 2019-11-30 22:43:38 +02:00
Artur
c9f6b4a624 Update ci.yml 2019-11-30 21:35:30 +02:00
Artur Stolear
8d2218c621 publish azure extension 2019-11-30 21:13:13 +02:00
Artur Stolear
c43caa6782 update 2019-11-30 20:06:42 +02:00
Artur
bbb232759a create a new azure devops extensions 2019-11-30 20:06:42 +02:00
Artur Stolear
ba00901a2e create a new azure devops extensions 2019-11-30 18:26:13 +02:00
Artur Stolear
fea9a70a36 add tfx azure-pack 2019-11-30 18:26:13 +02:00
Artur Stolear
64f41a665b work in progress packaging azure pipeline task 2019-11-30 18:26:13 +02:00
Artur Stolear
b1d05d399b add azure pipeline prerequisites 2019-11-30 18:26:13 +02:00
Tobias Diez
29d3a7a7ad Extend readme by all GitVersion variables
Add the output of all GitVersion to the readme.
2019-11-30 15:11:58 +02:00
Artur
58ad325b1e Create LICENSE 2019-11-29 13:02:08 +02:00
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
34 changed files with 1963 additions and 16686 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 }}"

33
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: release
on:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
run: |
git fetch --tags
git branch --create-reflog master origin/master
- name: Install GitVersion
uses: ./setup-gitversion
with:
versionSpec: '5.1.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: ./execute-gitversion
- run: |
npm install
$date = Get-Date -format "yyMMddHHmm"
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
$override = '{\"version\": \"' + $version + '\"}'
npm run publish-azure -- --token ${{ secrets.TFX_TOKEN }} --override $override
shell: pwsh
name: Publish Azure extension

3
.gitignore vendored
View File

@@ -2,4 +2,5 @@ node_modules/
.taskkey
*.js
!dist/**/*.js
!dist/**/*.js
*.vsix

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Git Tools
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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,41 @@ 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 "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 }}"
```

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

BIN
dist/azure/execute-gitversion/icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

File diff suppressed because one or more lines are too long

89
dist/azure/execute-gitversion/task.json vendored Normal file
View File

@@ -0,0 +1,89 @@
{
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
"name": "gitversion-execute",
"friendlyName": "Execute GitVersion Task",
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
"author": "GitVersion Contributors",
"helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help",
"category": "Build",
"demands": [],
"version": {
"Major": "5",
"Minor": "0",
"Patch": "2"
},
"minimumAgentVersion": "2.115.0",
"instanceNameFormat": "gitversion-execute",
"groups": [{
"name": "gitversionDetails",
"displayName": "GitVersion details",
"isExpanded": true
},
{
"name": "additional",
"displayName": "Additional Options",
"isExpanded": false
}
],
"inputs": [{
"name": "targetPath",
"type": "string",
"label": "Working directory path",
"defaultValue": "",
"required": false,
"helpMarkDown": "Optionally supply the path to the working directory",
"groupName": "gitversionDetails"
},
{
"name": "useConfigFile",
"type": "boolean",
"label": "Specify Configuration file",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Whether to use a custom configuration file"
},
{
"name": "configFilePath",
"type": "filePath",
"label": "Configuration file",
"defaultValue": "",
"required": false,
"helpMarkDown": "Optional path to config file (defaults to GitVersion.yml)",
"visibleRule": "useConfigFile = true"
},
{
"name": "updateAssemblyInfo",
"type": "boolean",
"label": "Update AssemblyInfo files",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Whether to update versions in the AssemblyInfo files"
},
{
"name": "updateAssemblyInfoFilename",
"type": "string",
"label": "Update Assembly File",
"defaultValue": "",
"required": false,
"helpMarkDown": "Update versions in specified file",
"visibleRule": "updateAssemblyInfo = true"
},
{
"name": "additionalArguments",
"type": "string",
"label": "Additional GitVersion arguments",
"defaultValue": "",
"required": false,
"helpMarkDown": "Additional arguments to send to GitVersion",
"groupName": "additional"
}
],
"execution": {
"Node": {
"target": "index.js",
"argumentFormat": "",
"workingDirectory": "."
}
}
}

BIN
dist/azure/images/build-task.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
dist/azure/images/builds.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
dist/azure/images/icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

16558
dist/azure/index.js vendored

File diff suppressed because one or more lines are too long

6
dist/azure/overview.md vendored Normal file
View File

@@ -0,0 +1,6 @@
Versioning when using Git, solved. GitVersion looks at your Git history and works out the [semantic version](http://semver.org) of the commit being built.
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!
![Build Task](https://raw.githubusercontent.com/GitTools/GitVersion/master/src/GitVersionVsixTask/images/build-task.png)
![Builds](https://raw.githubusercontent.com/GitTools/GitVersion/master/src/GitVersionVsixTask/images/builds.png)

BIN
dist/azure/setup-gitversion/icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

File diff suppressed because one or more lines are too long

42
dist/azure/setup-gitversion/task.json vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
"name": "gitversion-setup",
"friendlyName": "Setup GitVersion Task",
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
"author": "GitVersion Contributors",
"helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help",
"category": "Build",
"demands": [],
"version": {
"Major": "5",
"Minor": "0",
"Patch": "2"
},
"minimumAgentVersion": "2.115.0",
"inputs": [{
"name": "versionSpec",
"type": "string",
"label": "The version spec",
"defaultValue": "",
"required": true,
"helpMarkDown": "Required version in the form of 5.x or exact version like 5.0.0"
},
{
"name": "includePrerelease",
"type": "boolean",
"label": "Include pre-release versions",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Include pre-release versions when matching a version"
}
],
"instanceNameFormat": "gitversion-setup",
"execution": {
"Node": {
"target": "index.js",
"argumentFormat": "",
"workingDirectory": "."
}
}
}

View File

@@ -1,14 +0,0 @@
{
"messages": {
"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": "Extracting archive",
"_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."
}
}

View File

@@ -1,36 +0,0 @@
{
"messages": {
"LIB_UnhandledEx": "Unhandled: %s",
"LIB_FailOnCode": "Failure return code: %d",
"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_MultilineSecret": "Secrets cannot contain multiple lines",
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
"LIB_ReturnCode": "Return code: %d",
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
"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_InvalidEndpointAuth": "Invalid endpoint auth: %s",
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
"LIB_PathNotFound": "Not found %s: %s",
"LIB_PathHasNullByte": "Path cannot contain null bytes",
"LIB_OperationFailed": "Failed %s: %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"
}
}

81
dist/azure/vss-extension.json vendored Normal file
View File

@@ -0,0 +1,81 @@
{
"manifestVersion": 1,
"id": "gittools",
"name": "GitTools",
"version": "0.0.1",
"publisher": "gittools",
"public": true,
"author": "GitTools Contributors",
"description": "Build tasks for easy semantic versioning for projects using Git and release management.",
"targets": [{
"id": "Microsoft.VisualStudio.Services"
}],
"files": [
{ "path": "execute-gitversion" },
{ "path": "setup-gitversion" }
],
"categories": [
"Azure Pipelines"
],
"galleryFlags": [
"Public"
],
"icons": {
"default": "images/icon.png"
},
"tags": [
"semver",
"git",
"versioning",
"gitflow",
"githubflow"
],
"links": {
"learn": {
"uri": "http://gitversion.readthedocs.org/en/stable"
},
"getstarted": {
"uri": "http://gitversion.readthedocs.org/en/stable/build-server-support/build-server/tfs-build-vnext/#running-inside-tfs"
},
"license": {
"uri": "https://github.com/GitTools/actions/blob/master/LICENSE"
},
"repository": {
"uri": "https://github.com/GitTools/actions.git"
},
"support": {
"uri": "https://github.com/GitTools/actions/issues"
}
},
"screenshots": [{
"path": "images/builds.png"
},
{
"path": "images/build-task.png"
}
],
"content": {
"details": {
"path": "overview.md"
}
},
"contributions": [{
"id": "setup-gitversion-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "setup-gitversion"
}
}, {
"id": "execute-gitversion-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "execute-gitversion"
}
}]
}

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

1388
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"name": "use-gitversion",
"name": "gittools-actions",
"version": "1.0.0",
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
"repository": {
@@ -8,12 +8,14 @@
},
"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",
"package-azure-execute": "ncc build src/azure/execute.ts -o dist/azure/execute",
"package-github-setup": "ncc build src/github/setup.ts -o dist/github/setup",
"package-github-execute": "ncc build src/github/execute.ts -o dist/github/execute"
"package-github-execute": "ncc build src/github/execute.ts -o dist/github/execute",
"publish-azure": "tfx extension publish --root ./dist/azure --no-wait-validation --auth-type pat"
},
"author": "GitTools",
"contributors": [
@@ -35,6 +37,7 @@
"@types/node": "12.12.11",
"@types/q": "1.5.2",
"reflect-metadata": "^0.1.13",
"tfx-cli": "0.7.11",
"tslint": "^5.20.1",
"typescript": "^3.7.2",
"@zeit/ncc": "^0.20.5"

View File

@@ -13,7 +13,6 @@ import { IBuildAgent, IExecResult } from "../interfaces";
@injectable()
class BuildAgent implements IBuildAgent {
public Stats;
public find(toolName: string, versionSpec: string, arch?: string): string {
return toolCache.find(toolName, versionSpec, arch);

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