Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97950ee2f4 | ||
|
|
da49d7514f | ||
|
|
a8aa4e71b8 | ||
|
|
1e3e561d5a | ||
|
|
1860979786 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -22,4 +22,4 @@ jobs:
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: ./execute
|
||||
- run: |
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||

|
||||
|
||||
Github Action that installs and uses the GitVersion tool
|
||||
GitHub Action that installs and uses the GitVersion tool
|
||||
|
||||
[](https://github.com/GitTools/use-gitversion/actions)
|
||||
## Usage
|
||||
|
||||
See [setup](setup/action.yml) and [usage](execute/action.yml)
|
||||
@@ -39,5 +40,5 @@ Basic:
|
||||
id: gitversion # step id used as reference for output values
|
||||
uses: gittools/use-gitversion/execute@v0.2
|
||||
- run: |
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
|
||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||
```
|
||||
|
||||
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
@@ -30,12 +30,66 @@ inputs:
|
||||
required: false
|
||||
default: ''
|
||||
outputs:
|
||||
fullSemVer:
|
||||
description: 'The FullSemVer value'
|
||||
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
|
||||
@@ -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