Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e98e2ad3c | ||
|
|
1e937858a2 | ||
|
|
0eae1609b6 | ||
|
|
ee69b451cc | ||
|
|
5ed9f1a870 | ||
|
|
8c92ba9adb | ||
|
|
df7bec89f0 | ||
|
|
b9310160df | ||
|
|
0dc080dece | ||
|
|
e15823128e | ||
|
|
43b2de33fa | ||
|
|
ab48b3cddc | ||
|
|
3f6597b086 | ||
|
|
65b3a90f3f | ||
|
|
88007cb218 | ||
|
|
036fb8fb1d | ||
|
|
019e954030 | ||
|
|
f09d4de93d | ||
|
|
af8f283fe6 | ||
|
|
8e8806b8a9 | ||
|
|
28adff5627 | ||
|
|
6465152ce9 | ||
|
|
bba2ce73bc | ||
|
|
c9f6b4a624 | ||
|
|
8d2218c621 | ||
|
|
c43caa6782 | ||
|
|
bbb232759a | ||
|
|
ba00901a2e | ||
|
|
fea9a70a36 | ||
|
|
64f41a665b | ||
|
|
b1d05d399b | ||
|
|
29d3a7a7ad | ||
|
|
58ad325b1e | ||
|
|
e701a20249 | ||
|
|
643b30de7b | ||
|
|
eb233b1b34 | ||
|
|
dd89dbaaec | ||
|
|
97950ee2f4 | ||
|
|
da49d7514f | ||
|
|
a8aa4e71b8 | ||
|
|
1e3e561d5a | ||
|
|
1860979786 |
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -9,17 +9,21 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Fetch tags and master for GitVersion
|
- name: Fetch all history for all tags and branches
|
||||||
run: |
|
run: |
|
||||||
git fetch --tags
|
git fetch --prune --unshallow
|
||||||
git branch --create-reflog master origin/master
|
- run: |
|
||||||
|
npm install
|
||||||
|
npm run build:github
|
||||||
|
npm run build:azure
|
||||||
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: ./setup
|
uses: ./setup-gitversion
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.x'
|
versionSpec: '5.1.2'
|
||||||
- name: Use GitVersion
|
- name: Use GitVersion
|
||||||
id: gitversion # step id used as reference for output values
|
id: gitversion # step id used as reference for output values
|
||||||
uses: ./execute
|
uses: ./execute-gitversion
|
||||||
- run: |
|
- run: |
|
||||||
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
|
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||||
|
|||||||
43
.github/workflows/release.yml
vendored
Normal file
43
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: release
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Fetch all history for all tags and branches
|
||||||
|
run: |
|
||||||
|
git fetch --prune --unshallow
|
||||||
|
- run: |
|
||||||
|
npm install
|
||||||
|
npm run build:github
|
||||||
|
npm run build:azure
|
||||||
|
name: Build code
|
||||||
|
- name: Install GitVersion
|
||||||
|
uses: ./setup-gitversion
|
||||||
|
with:
|
||||||
|
versionSpec: '5.1.2'
|
||||||
|
- name: Use GitVersion
|
||||||
|
id: gitversion # step id used as reference for output values
|
||||||
|
uses: ./execute-gitversion
|
||||||
|
- run: |
|
||||||
|
$date = Get-Date -format "yyMMddHHmm"
|
||||||
|
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
||||||
|
$major = "${{steps.gitversion.outputs.major}}"
|
||||||
|
$minor = "${{steps.gitversion.outputs.minor}}"
|
||||||
|
|
||||||
|
. .\dist\azure\update-version.ps1
|
||||||
|
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||||
|
update-task .\dist\azure\setup-gitversion\task.json -Major $major -Minor $minor
|
||||||
|
update-task .\dist\azure\execute-gitversion\task.json -Major $major -Minor $minor
|
||||||
|
|
||||||
|
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||||
|
shell: pwsh
|
||||||
|
name: Publish Azure extension
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,4 +2,5 @@ node_modules/
|
|||||||
|
|
||||||
.taskkey
|
.taskkey
|
||||||
*.js
|
*.js
|
||||||
!dist/**/*.js
|
!dist/**/*.js
|
||||||
|
*.vsix
|
||||||
|
|||||||
54
.vscode/launch.json
vendored
54
.vscode/launch.json
vendored
@@ -5,40 +5,52 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
|
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "tsc: build - src/azure/tsconfig.json",
|
"preLaunchTask": "Build-Mock",
|
||||||
"name": "Run Azure Pipeline (setup) Task",
|
"name": "Debug Mock Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/src/azure/setup.ts",
|
"program": "${workspaceFolder}/dist/mock/setup-gitversion/bundle.js",
|
||||||
"outFiles": ["${workspaceFolder}/**/*.js"]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "tsc: build - src/github/tsconfig.json",
|
"preLaunchTask": "Build-Azure",
|
||||||
"name": "Run GitHub Actions (setup)",
|
"name": "Debug Azure Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/src/github/setup.ts",
|
"program": "${workspaceFolder}/dist/azure/setup-gitversion/bundle.js",
|
||||||
"outFiles": ["${workspaceFolder}/**/*.js"]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "tsc: build - src/azure/tsconfig.json",
|
"preLaunchTask": "Build-GitHub",
|
||||||
"name": "Run Azure Pipeline (execute) Task",
|
"name": "Debug GitHub Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/src/azure/execute.ts",
|
"program": "${workspaceFolder}/dist/github/setup-gitversion/bundle.js",
|
||||||
"outFiles": ["${workspaceFolder}/**/*.js"]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "tsc: build - src/github/tsconfig.json",
|
"preLaunchTask": "Build-Mock",
|
||||||
"name": "Run GitHub Actions (execute)",
|
"name": "Debug Mock Execute GitVersion",
|
||||||
"program": "${workspaceFolder}/src/github/execute.ts",
|
"program": "${workspaceFolder}/dist/mock/execute-gitversion/bundle.js",
|
||||||
"outFiles": ["${workspaceFolder}/**/*.js"]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "Build-Azure",
|
||||||
|
"name": "Debug Azure Execute GitVersion",
|
||||||
|
"program": "${workspaceFolder}/dist/azure/execute-gitversion/bundle.js",
|
||||||
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"preLaunchTask": "Build-GitHub",
|
||||||
|
"name": "Debug GitHub Execute GitVersion",
|
||||||
|
"program": "${workspaceFolder}/dist/github/execute-gitversion/bundle.js",
|
||||||
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
22
.vscode/tasks.json
vendored
Normal file
22
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build-Mock",
|
||||||
|
"type": "npm",
|
||||||
|
"script": "build:mock"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build-Azure",
|
||||||
|
"type": "npm",
|
||||||
|
"script": "build:azure"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build-GitHub",
|
||||||
|
"type": "npm",
|
||||||
|
"script": "build:github"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal 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.
|
||||||
71
README.md
71
README.md
@@ -1,12 +1,15 @@
|
|||||||
# 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)
|
||||||
|
[](https://github.com/GitTools/actions/actions)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
See [setup](setup/action.yml) and [usage](execute/action.yml)
|
See [setup](setup-gitversion/action.yml) and [usage](execute-gitversion/action.yml)
|
||||||
|
|
||||||
## Dependency
|
## Dependency
|
||||||
|
|
||||||
@@ -15,11 +18,10 @@ There are two step dependencies that are required in your workflow before runnin
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
- name: Fetch tags and master for GitVersion
|
- name: Fetch all history for all tags and branches
|
||||||
run: |
|
run: |
|
||||||
git fetch --tags
|
git fetch --prune --unshallow
|
||||||
git branch --create-reflog master origin/master
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Basic:
|
Basic:
|
||||||
@@ -32,12 +34,57 @@ Basic:
|
|||||||
git fetch --tags
|
git fetch --tags
|
||||||
git branch --create-reflog master origin/master
|
git branch --create-reflog master origin/master
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: gittools/use-gitversion/setup@v0.2
|
uses: gittools/actions/setup-gitversion@v0.3
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.x'
|
versionSpec: '5.1.x'
|
||||||
- name: Use GitVersion
|
- name: Use GitVersion
|
||||||
id: gitversion # step id used as reference for output values
|
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: |
|
- 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 }}"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Private Repositories
|
||||||
|
|
||||||
|
Private repos require credentials before you can fetch the master branch and tags.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Fetch all history for all tags and branches
|
||||||
|
run: |
|
||||||
|
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||||
|
git fetch --prune --unshallow
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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
|
description: GitHub Action for Easy Semantic Versioning with GitVersion. Installs the specific version of GitVersion.Tool
|
||||||
author: GitTools
|
author: GitTools
|
||||||
branding:
|
branding:
|
||||||
@@ -15,4 +15,4 @@ inputs:
|
|||||||
default: false
|
default: false
|
||||||
runs:
|
runs:
|
||||||
using: node12
|
using: node12
|
||||||
main: dist/github/setup/index.js
|
main: dist/github/setup/index.js
|
||||||
|
|||||||
18286
dist/azure/execute-gitversion/bundle.js
vendored
Normal file
18286
dist/azure/execute-gitversion/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/execute-gitversion/icon.png
vendored
Normal file
BIN
dist/azure/execute-gitversion/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
46
dist/azure/execute-gitversion/lib.json
vendored
Normal file
46
dist/azure/execute-gitversion/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
88
dist/azure/execute-gitversion/task.json
vendored
Normal file
88
dist/azure/execute-gitversion/task.json
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"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": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
16699
dist/azure/execute/index.js
vendored
16699
dist/azure/execute/index.js
vendored
File diff suppressed because one or more lines are too long
14
dist/azure/execute/lib.json
vendored
14
dist/azure/execute/lib.json
vendored
@@ -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."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
36
dist/azure/execute/lib1.json
vendored
36
dist/azure/execute/lib1.json
vendored
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BIN
dist/azure/images/build-task.png
vendored
Normal file
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
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
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
16558
dist/azure/index.js
vendored
File diff suppressed because one or more lines are too long
14
dist/azure/lib.json
vendored
14
dist/azure/lib.json
vendored
@@ -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."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
36
dist/azure/lib1.json
vendored
36
dist/azure/lib1.json
vendored
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
6
dist/azure/overview.md
vendored
Normal file
6
dist/azure/overview.md
vendored
Normal 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!
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
18286
dist/azure/setup-gitversion/bundle.js
vendored
Normal file
18286
dist/azure/setup-gitversion/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/setup-gitversion/icon.png
vendored
Normal file
BIN
dist/azure/setup-gitversion/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
46
dist/azure/setup-gitversion/lib.json
vendored
Normal file
46
dist/azure/setup-gitversion/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
41
dist/azure/setup-gitversion/task.json
vendored
Normal file
41
dist/azure/setup-gitversion/task.json
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"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": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"instanceNameFormat": "gitversion-setup",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
16699
dist/azure/setup/index.js
vendored
16699
dist/azure/setup/index.js
vendored
File diff suppressed because one or more lines are too long
14
dist/azure/setup/lib.json
vendored
14
dist/azure/setup/lib.json
vendored
@@ -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."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
36
dist/azure/setup/lib1.json
vendored
36
dist/azure/setup/lib1.json
vendored
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
38
dist/azure/update-version.ps1
vendored
Normal file
38
dist/azure/update-version.ps1
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
function update-task() {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory=$True, Position=0, ValueFromPipeline=$true)]
|
||||||
|
[System.String]
|
||||||
|
$file,
|
||||||
|
|
||||||
|
[Parameter(Mandatory=$True, Position=1, ValueFromPipeline=$false)]
|
||||||
|
[System.String]
|
||||||
|
$major,
|
||||||
|
|
||||||
|
[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false)]
|
||||||
|
[System.String]
|
||||||
|
$minor
|
||||||
|
)
|
||||||
|
$file = Resolve-Path $file
|
||||||
|
$jqMajor = '.version.Major=\"' + $major +'\"';
|
||||||
|
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
||||||
|
Write-Host "Update task from $file to version $major.$minor"
|
||||||
|
|
||||||
|
Get-Content $file | jq $jqMajor | jq $jqMinor | Set-Content $file
|
||||||
|
}
|
||||||
|
|
||||||
|
function update-manifest() {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory=$True, Position=0, ValueFromPipeline=$true)]
|
||||||
|
[System.String]
|
||||||
|
$file,
|
||||||
|
|
||||||
|
[Parameter(Mandatory=$True, Position=1, ValueFromPipeline=$false)]
|
||||||
|
[System.String]
|
||||||
|
$version
|
||||||
|
)
|
||||||
|
$file = Resolve-Path $file
|
||||||
|
$jqVersion = '.version=\"' + $version +'\"';
|
||||||
|
Write-Host "Update manifest version to $version"
|
||||||
|
|
||||||
|
Get-Content $file | jq $jqVersion | Set-Content $file
|
||||||
|
}
|
||||||
81
dist/azure/vss-extension.json
vendored
Normal file
81
dist/azure/vss-extension.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
11983
dist/github/execute-gitversion/bundle.js
vendored
Normal file
11983
dist/github/execute-gitversion/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9922
dist/github/execute/index.js
vendored
9922
dist/github/execute/index.js
vendored
File diff suppressed because one or more lines are too long
11983
dist/github/setup-gitversion/bundle.js
vendored
Normal file
11983
dist/github/setup-gitversion/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9922
dist/github/setup/index.js
vendored
9922
dist/github/setup/index.js
vendored
File diff suppressed because one or more lines are too long
7693
dist/mock/execute-gitversion/bundle.js
vendored
Normal file
7693
dist/mock/execute-gitversion/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7693
dist/mock/setup-gitversion/bundle.js
vendored
Normal file
7693
dist/mock/setup-gitversion/bundle.js
vendored
Normal file
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
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../dist/github/execute-gitversion/bundle.js
|
||||||
|
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'
|
||||||
@@ -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
|
|
||||||
5788
package-lock.json
generated
5788
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "use-gitversion",
|
"name": "gittools-actions",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -8,12 +8,15 @@
|
|||||||
},
|
},
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"package-azure": "npm run package-azure-setup && npm run package-azure-execute",
|
"build:mock": "webpack --config webpack.config.js --env.agent=mock",
|
||||||
"package-github": "npm run package-github-setup && npm run package-github-execute",
|
"build:azure": "webpack --config webpack.config.js --env.agent=azure",
|
||||||
"package-azure-setup": "ncc build src/azure/setup.ts -o dist/azure/setup",
|
"build:github": "webpack --config webpack.config.js --env.agent=github",
|
||||||
"package-azure-execute": "ncc build src/azure/execute.ts -o dist/azure/execute",
|
"build:mock:prod": "npm run build:mock -- --env.mode=production",
|
||||||
"package-github-setup": "ncc build src/github/setup.ts -o dist/github/setup",
|
"build:azure:prod": "npm run build:azure -- --env.mode=production",
|
||||||
"package-github-execute": "ncc build src/github/execute.ts -o dist/github/execute"
|
"build:github:prod": "npm run build:github -- --env.mode=production",
|
||||||
|
"build": "npm run build:mock && npm run build:azure && npm run build:github",
|
||||||
|
"build:prod": "npm run build:mock:prod && npm run build:azure:prod && npm run build:github:prod",
|
||||||
|
"publish:azure": "tfx extension publish --root ./dist/azure --no-wait-validation --auth-type pat"
|
||||||
},
|
},
|
||||||
"author": "GitTools",
|
"author": "GitTools",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -21,22 +24,29 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.1",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.3",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.2",
|
||||||
"@actions/tool-cache": "^1.1.2",
|
"@actions/tool-cache": "^1.3.0",
|
||||||
"azure-pipelines-task-lib": "2.9.3",
|
"azure-pipelines-task-lib": "^2.9.3",
|
||||||
"azure-pipelines-tool-lib": "0.12.0",
|
"azure-pipelines-tool-lib": "^0.12.0",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"typed-rest-client": "1.5.0",
|
"typed-rest-client": "^1.7.1",
|
||||||
"uuid": "^3.3.3"
|
"uuid": "^3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "12.12.11",
|
"@types/node": "^13.1.8",
|
||||||
"@types/q": "1.5.2",
|
"@types/q": "^1.5.2",
|
||||||
|
"@types/semver-compare": "^1.0.1",
|
||||||
|
"@types/uuid": "^3.4.6",
|
||||||
|
"json-update": "^5.3.0",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||||
|
"tfx-cli": "^0.7.11",
|
||||||
|
"ts-loader": "^6.2.1",
|
||||||
"tslint": "^5.20.1",
|
"tslint": "^5.20.1",
|
||||||
"typescript": "^3.7.2",
|
"typescript": "^3.7.5",
|
||||||
"@zeit/ncc": "^0.20.5"
|
"webpack": "^4.41.5",
|
||||||
|
"webpack-cli": "^3.3.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,9 @@ author: GitTools
|
|||||||
branding:
|
branding:
|
||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../dist/github/setup-gitversion/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec:
|
versionSpec:
|
||||||
description: Required version in the form of 5.x or exact version like 5.0.0
|
description: Required version in the form of 5.x or exact version like 5.0.0
|
||||||
@@ -12,7 +15,4 @@ inputs:
|
|||||||
includePrerelease:
|
includePrerelease:
|
||||||
description: Include pre-release versions when matching a version
|
description: Include pre-release versions when matching a version
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
runs:
|
|
||||||
using: node12
|
|
||||||
main: ../dist/github/setup/index.js
|
|
||||||
@@ -3,11 +3,15 @@ import { injectable } from "inversify";
|
|||||||
import * as taskLib from "azure-pipelines-task-lib/task";
|
import * as taskLib from "azure-pipelines-task-lib/task";
|
||||||
import * as toolLib from "azure-pipelines-tool-lib/tool";
|
import * as toolLib from "azure-pipelines-tool-lib/tool";
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../interfaces";
|
import { IBuildAgent, IExecResult } from "../../core/interfaces";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|
||||||
|
public get agentName(): string {
|
||||||
|
return "Azure Pipelines";
|
||||||
|
}
|
||||||
|
|
||||||
public find(toolName: string, versionSpec: string, arch?: string): string {
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
return toolLib.findLocalTool(toolName, versionSpec, arch);
|
return toolLib.findLocalTool(toolName, versionSpec, arch);
|
||||||
}
|
}
|
||||||
@@ -77,15 +81,15 @@ class BuildAgent implements IBuildAgent {
|
|||||||
return taskLib.getBoolInput(input, required);
|
return taskLib.getBoolInput(input, required);
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidInputFile(input: string, file: string) {
|
public isValidInputFile(input: string, file: string): boolean {
|
||||||
return taskLib.filePathSupplied(input) && this.fileExists(file);
|
return taskLib.filePathSupplied(input) && this.fileExists(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public fileExists(file: string) {
|
public fileExists(file: string): boolean {
|
||||||
return taskLib.exist(file) && taskLib.stats(file).isFile();
|
return taskLib.exist(file) && taskLib.stats(file).isFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public directoryExists(file: string) {
|
public directoryExists(file: string): boolean {
|
||||||
return taskLib.exist(file) && taskLib.stats(file).isDirectory();
|
return taskLib.exist(file) && taskLib.stats(file).isDirectory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as uuidV4 from "uuid/v4";
|
|
||||||
|
import uuidv4 from "uuid";
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import * as exe from "@actions/exec";
|
import * as exe from "@actions/exec";
|
||||||
@@ -9,11 +10,14 @@ import * as toolCache from "@actions/tool-cache";
|
|||||||
|
|
||||||
import { injectable } from "inversify";
|
import { injectable } from "inversify";
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../interfaces";
|
import { IBuildAgent, IExecResult } from "../../core/interfaces";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
public Stats;
|
|
||||||
|
public get agentName(): string {
|
||||||
|
return "GitHub Actions";
|
||||||
|
}
|
||||||
|
|
||||||
public find(toolName: string, versionSpec: string, arch?: string): string {
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
return toolCache.find(toolName, versionSpec, arch);
|
return toolCache.find(toolName, versionSpec, arch);
|
||||||
@@ -42,7 +46,7 @@ public Stats;
|
|||||||
}
|
}
|
||||||
tempDirectory = path.join(baseLocation, "actions", "temp");
|
tempDirectory = path.join(baseLocation, "actions", "temp");
|
||||||
}
|
}
|
||||||
const dest = path.join(tempDirectory, uuidV4());
|
const dest = path.join(tempDirectory, uuidv4());
|
||||||
await io.mkdirP(dest);
|
await io.mkdirP(dest);
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
@@ -118,17 +122,17 @@ public Stats;
|
|||||||
return (inputValue || "false").toLowerCase() === "true";
|
return (inputValue || "false").toLowerCase() === "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidInputFile(input: string, file: string) {
|
public isValidInputFile(input: string, file: string): boolean {
|
||||||
const pathValue = path.resolve(this.getInput(input) || "");
|
const pathValue = path.resolve(this.getInput(input) || "");
|
||||||
const repoRoot = this.getSourceDir();
|
const repoRoot = this.getSourceDir();
|
||||||
return pathValue !== repoRoot;
|
return pathValue !== repoRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public fileExists(file: string) {
|
public fileExists(file: string): boolean {
|
||||||
return this._exist(file) && this._stats(file).isFile();
|
return this._exist(file) && this._stats(file).isFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public directoryExists(file: string) {
|
public directoryExists(file: string): boolean {
|
||||||
return this._exist(file) && this._stats(file).isDirectory();
|
return this._exist(file) && this._stats(file).isDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
104
src/agent/mock/build-agent.ts
Normal file
104
src/agent/mock/build-agent.ts
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import { injectable } from "inversify";
|
||||||
|
|
||||||
|
import { IBuildAgent, IExecResult } from "../../core/interfaces";
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|
||||||
|
public get agentName(): string {
|
||||||
|
console.log("getAgentName");
|
||||||
|
return "Mock";
|
||||||
|
}
|
||||||
|
|
||||||
|
public find(toolName: string, versionSpec: string, arch?: string): string {
|
||||||
|
console.log("find");
|
||||||
|
return "find";
|
||||||
|
}
|
||||||
|
|
||||||
|
public cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string> {
|
||||||
|
console.log("cacheDir");
|
||||||
|
return Promise.resolve("cacheDir");
|
||||||
|
}
|
||||||
|
|
||||||
|
public createTempDir(): Promise<string> {
|
||||||
|
console.log("createTempDir");
|
||||||
|
return Promise.resolve("createTempDir");
|
||||||
|
}
|
||||||
|
|
||||||
|
public debug(message: string): void {
|
||||||
|
console.log("debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public setFailed(message: string, done?: boolean): void {
|
||||||
|
console.log("setFailed");
|
||||||
|
}
|
||||||
|
|
||||||
|
public setSucceeded(message: string, done?: boolean): void {
|
||||||
|
console.log("setSucceeded");
|
||||||
|
}
|
||||||
|
|
||||||
|
public exportVariable(name: string, val: string): void {
|
||||||
|
console.log("exportVariable");
|
||||||
|
}
|
||||||
|
|
||||||
|
public getVariable(name: string): string {
|
||||||
|
console.log("getVariable");
|
||||||
|
return "getVariable";
|
||||||
|
}
|
||||||
|
|
||||||
|
public addPath(inputPath: string): void {
|
||||||
|
console.log("addPath");
|
||||||
|
}
|
||||||
|
|
||||||
|
public which(tool: string, check?: boolean): Promise<string> {
|
||||||
|
console.log("which");
|
||||||
|
return Promise.resolve("which");
|
||||||
|
}
|
||||||
|
|
||||||
|
public exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
|
return Promise.resolve({
|
||||||
|
code: 0,
|
||||||
|
error: null,
|
||||||
|
stderr: "result.stderr",
|
||||||
|
stdout: "result.stdout",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSourceDir(): string {
|
||||||
|
console.log("getSourceDir");
|
||||||
|
return "getSourceDir";
|
||||||
|
}
|
||||||
|
|
||||||
|
public setOutput(name: string, value: string): void {
|
||||||
|
console.log("setOutput");
|
||||||
|
}
|
||||||
|
|
||||||
|
public getInput(input: string, required?: boolean): string {
|
||||||
|
console.log("getInput");
|
||||||
|
return "getInput";
|
||||||
|
}
|
||||||
|
|
||||||
|
public getBooleanInput(input: string, required?: boolean): boolean {
|
||||||
|
console.log("getBooleanInput");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public isValidInputFile(input: string, file: string) {
|
||||||
|
console.log("isValidInputFile");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public fileExists(file: string) {
|
||||||
|
console.log("fileExists");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public directoryExists(file: string) {
|
||||||
|
console.log("directoryExists");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
BuildAgent,
|
||||||
|
};
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
|
|
||||||
import { IBuildAgent, IGitVersionTool } from "../interfaces";
|
|
||||||
import { ioc } from "../ioc";
|
|
||||||
import { run } from "../main";
|
|
||||||
import { TYPES } from "../types";
|
|
||||||
import { BuildAgent } from "./build-agent";
|
|
||||||
|
|
||||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
|
||||||
|
|
||||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
|
||||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
|
||||||
|
|
||||||
run(buildAgent, gitVersionTool);
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
|
|
||||||
import { IBuildAgent, IGitVersionTool } from "../interfaces";
|
|
||||||
import { ioc } from "../ioc";
|
|
||||||
import { setup } from "../main";
|
|
||||||
import { TYPES } from "../types";
|
|
||||||
import { BuildAgent } from "./build-agent";
|
|
||||||
|
|
||||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
|
||||||
|
|
||||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
|
||||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
|
||||||
|
|
||||||
setup(buildAgent, gitVersionTool);
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig.json"
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@ import * as os from "os";
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as semver from "semver";
|
import * as semver from "semver";
|
||||||
import * as http from "typed-rest-client/HttpClient";
|
import * as http from "typed-rest-client/HttpClient";
|
||||||
|
import cmp from "semver-compare";
|
||||||
|
|
||||||
import { inject, injectable } from "inversify";
|
import { inject, injectable } from "inversify";
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ class GitVersionTool implements IGitVersionTool {
|
|||||||
return workDir.replace(/\\/g, "/");
|
return workDir.replace(/\\/g, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
private getArguments(workDir: string, options: IGitVersionOptions) {
|
private getArguments(workDir: string, options: IGitVersionOptions): string[] {
|
||||||
const args = [
|
const args = [
|
||||||
workDir,
|
workDir,
|
||||||
"/output",
|
"/output",
|
||||||
@@ -220,8 +221,6 @@ class GitVersionTool implements IGitVersionTool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cmp = require("semver-compare");
|
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class VersionManager implements IVersionManager {
|
class VersionManager implements IVersionManager {
|
||||||
|
|
||||||
102
src/core/gitversion.ts
Normal file
102
src/core/gitversion.ts
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
import { IBuildAgent, IGitVersion, IGitVersionOptions, IGitVersionTool } from "./interfaces";
|
||||||
|
import { ioc } from "./ioc";
|
||||||
|
import { RunOptions, SetupOptions, TYPES } from "./types";
|
||||||
|
|
||||||
|
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
||||||
|
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
||||||
|
|
||||||
|
export async function setup() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
||||||
|
|
||||||
|
const versionSpec = buildAgent.getInput(SetupOptions.versionSpec);
|
||||||
|
const includePrerelease = buildAgent.getBooleanInput(SetupOptions.includePrerelease);
|
||||||
|
|
||||||
|
await gitVersionTool.install(versionSpec, includePrerelease);
|
||||||
|
|
||||||
|
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error.message, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function run() {
|
||||||
|
try {
|
||||||
|
const inputOptions: IGitVersionOptions = getGitVersionOptions();
|
||||||
|
|
||||||
|
const result = await gitVersionTool.run(inputOptions);
|
||||||
|
|
||||||
|
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
||||||
|
writeGitVersionToAgent(gitversion);
|
||||||
|
|
||||||
|
if (result.code === 0) {
|
||||||
|
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
||||||
|
} else {
|
||||||
|
buildAgent.setFailed(result.error.message, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGitVersionOptions(): IGitVersionOptions {
|
||||||
|
|
||||||
|
const targetPath = buildAgent.getInput(RunOptions.targetPath);
|
||||||
|
|
||||||
|
const useConfigFile = buildAgent.getBooleanInput(RunOptions.useConfigFile);
|
||||||
|
const configFilePath = buildAgent.getInput(RunOptions.configFilePath);
|
||||||
|
|
||||||
|
const updateAssemblyInfo = buildAgent.getBooleanInput(RunOptions.updateAssemblyInfo);
|
||||||
|
const updateAssemblyInfoFilename = buildAgent.getInput(RunOptions.updateAssemblyInfoFilename);
|
||||||
|
|
||||||
|
const additionalArguments = buildAgent.getInput(RunOptions.additionalArguments);
|
||||||
|
|
||||||
|
const srcDir = buildAgent.getSourceDir().replace(/\\/g, "/");
|
||||||
|
|
||||||
|
return {
|
||||||
|
targetPath,
|
||||||
|
useConfigFile,
|
||||||
|
configFilePath,
|
||||||
|
updateAssemblyInfo,
|
||||||
|
updateAssemblyInfoFilename,
|
||||||
|
additionalArguments,
|
||||||
|
srcDir,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeGitVersionToAgent(gitversion: IGitVersion): void {
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ export interface IVersionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IBuildAgent {
|
export interface IBuildAgent {
|
||||||
|
agentName: string;
|
||||||
find(toolName: string, versionSpec: string, arch?: string): string;
|
find(toolName: string, versionSpec: string, arch?: string): string;
|
||||||
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
||||||
createTempDir(): Promise<string>;
|
createTempDir(): Promise<string>;
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
import { Container } from "inversify";
|
import { Container } from "inversify";
|
||||||
|
|
||||||
|
import { BuildAgent } from "../agent/mock/build-agent";
|
||||||
import { DotnetTool, GitVersionTool, VersionManager } from "./common";
|
import { DotnetTool, GitVersionTool, VersionManager } from "./common";
|
||||||
import { IDotnetTool, IGitVersionTool, IVersionManager } from "./interfaces";
|
import { IBuildAgent, IDotnetTool, IGitVersionTool, IVersionManager } from "./interfaces";
|
||||||
import { TYPES } from "./types";
|
import { TYPES } from "./types";
|
||||||
|
|
||||||
const ioc = new Container();
|
const ioc = new Container();
|
||||||
|
|
||||||
ioc.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
ioc.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
||||||
|
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
||||||
ioc.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
|
ioc.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
|
||||||
ioc.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
ioc.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
||||||
|
|
||||||
4
src/execute-gitversion.ts
Normal file
4
src/execute-gitversion.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { run } from "./core/gitversion";
|
||||||
|
|
||||||
|
run();
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
|
|
||||||
import { IBuildAgent, IGitVersionTool } from "../interfaces";
|
|
||||||
import { ioc } from "../ioc";
|
|
||||||
import { run } from "../main";
|
|
||||||
import { TYPES } from "../types";
|
|
||||||
import { BuildAgent } from "./build-agent";
|
|
||||||
|
|
||||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
|
||||||
|
|
||||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
|
||||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
|
||||||
|
|
||||||
run(buildAgent, gitVersionTool);
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
|
|
||||||
import { IBuildAgent, IGitVersionTool } from "../interfaces";
|
|
||||||
import { ioc } from "../ioc";
|
|
||||||
import { setup } from "../main";
|
|
||||||
import { TYPES } from "../types";
|
|
||||||
import { BuildAgent } from "./build-agent";
|
|
||||||
|
|
||||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
|
||||||
|
|
||||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
|
||||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
|
||||||
|
|
||||||
setup(buildAgent, gitVersionTool);
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../tsconfig.json"
|
|
||||||
}
|
|
||||||
70
src/main.ts
70
src/main.ts
@@ -1,70 +0,0 @@
|
|||||||
import { IBuildAgent, IGitVersion, IGitVersionOptions, IGitVersionTool } from "./interfaces";
|
|
||||||
|
|
||||||
import { RunOptions, SetupOptions } from "./types";
|
|
||||||
|
|
||||||
export async function setup(buildAgent: IBuildAgent, gitVersionTool: IGitVersionTool) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
|
||||||
|
|
||||||
const versionSpec = buildAgent.getInput(SetupOptions.versionSpec);
|
|
||||||
const includePrerelease = buildAgent.getBooleanInput(SetupOptions.includePrerelease);
|
|
||||||
|
|
||||||
await gitVersionTool.install(versionSpec, includePrerelease);
|
|
||||||
|
|
||||||
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
|
||||||
} catch (error) {
|
|
||||||
buildAgent.setFailed(error.message, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function run(buildAgent: IBuildAgent, gitVersionTool: IGitVersionTool) {
|
|
||||||
try {
|
|
||||||
const inputOptions: IGitVersionOptions = getGitVersionOptions(buildAgent);
|
|
||||||
|
|
||||||
const result = await gitVersionTool.run(inputOptions);
|
|
||||||
|
|
||||||
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
|
||||||
writeGitVersionToAgent(buildAgent, gitversion);
|
|
||||||
|
|
||||||
if (result.code === 0) {
|
|
||||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
|
||||||
} else {
|
|
||||||
buildAgent.setFailed(result.error.message, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
buildAgent.setFailed(error, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getGitVersionOptions(buildAgent: IBuildAgent): IGitVersionOptions {
|
|
||||||
|
|
||||||
const targetPath = buildAgent.getInput(RunOptions.targetPath);
|
|
||||||
|
|
||||||
const useConfigFile = buildAgent.getBooleanInput(RunOptions.useConfigFile);
|
|
||||||
const configFilePath = buildAgent.getInput(RunOptions.configFilePath);
|
|
||||||
|
|
||||||
const updateAssemblyInfo = buildAgent.getBooleanInput(RunOptions.updateAssemblyInfo);
|
|
||||||
const updateAssemblyInfoFilename = buildAgent.getInput(RunOptions.updateAssemblyInfoFilename);
|
|
||||||
|
|
||||||
const additionalArguments = buildAgent.getInput(RunOptions.additionalArguments);
|
|
||||||
|
|
||||||
const srcDir = buildAgent.getSourceDir().replace(/\\/g, "/");
|
|
||||||
|
|
||||||
return {
|
|
||||||
targetPath,
|
|
||||||
useConfigFile,
|
|
||||||
configFilePath,
|
|
||||||
updateAssemblyInfo,
|
|
||||||
updateAssemblyInfoFilename,
|
|
||||||
additionalArguments,
|
|
||||||
srcDir,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function writeGitVersionToAgent(buildAgent: IBuildAgent, gitversion: IGitVersion): void {
|
|
||||||
buildAgent.setOutput("fullSemVer", gitversion.FullSemVer);
|
|
||||||
buildAgent.setOutput("majorMinorPatch", gitversion.MajorMinorPatch);
|
|
||||||
buildAgent.setOutput("shortSha", gitversion.ShortSha);
|
|
||||||
}
|
|
||||||
4
src/setup-gitversion.ts
Normal file
4
src/setup-gitversion.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { setup } from "./core/gitversion";
|
||||||
|
|
||||||
|
setup();
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "CommonJS",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"target": "es2015",
|
"target": "ES2016",
|
||||||
"sourceMap": false,
|
"noImplicitAny": true,
|
||||||
"lib": ["es2015", "dom"],
|
"sourceMap": true,
|
||||||
|
"lib": ["ES2016"],
|
||||||
"types": ["reflect-metadata"],
|
"types": ["reflect-metadata"],
|
||||||
"inlineSourceMap": true,
|
"esModuleInterop":true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true
|
"emitDecoratorMetadata": true
|
||||||
}
|
}
|
||||||
56
webpack.config.js
Normal file
56
webpack.config.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = (env) => {
|
||||||
|
const mode = env.mode || 'development';
|
||||||
|
const agent = env.agent || 'mock';
|
||||||
|
|
||||||
|
return {
|
||||||
|
entry: {
|
||||||
|
'setup-gitversion': path.resolve(__dirname, 'src/setup-gitversion.ts'),
|
||||||
|
'execute-gitversion': path.resolve(__dirname, 'src/execute-gitversion.ts'),
|
||||||
|
},
|
||||||
|
target: 'node',
|
||||||
|
mode: mode,
|
||||||
|
devtool: mode == 'development' ? 'inline-source-map' : false,
|
||||||
|
module: {
|
||||||
|
rules: [{
|
||||||
|
test: /\.tsx?$/,
|
||||||
|
use: 'ts-loader',
|
||||||
|
exclude: /node_modules/,
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.tsx', '.ts', '.js', '.json'],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
libraryTarget: 'commonjs2',
|
||||||
|
filename: '[name]/bundle.js',
|
||||||
|
path: path.resolve(__dirname, `dist/${agent}`),
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.NormalModuleReplacementPlugin(
|
||||||
|
/agent\/mock\/build-agent/,
|
||||||
|
`../agent/${agent}/build-agent`
|
||||||
|
),
|
||||||
|
new ReplaceInFileWebpackPlugin([{
|
||||||
|
dir: `dist/${agent}`,
|
||||||
|
test: /bundle.js/,
|
||||||
|
rules: [{
|
||||||
|
search: /__webpack_require__\(.*\)\(resourceFile\)/,
|
||||||
|
replace: 'require(resourceFile)'
|
||||||
|
}, {
|
||||||
|
search: /call\(this, \"\/\"\)\)/gi,
|
||||||
|
replace: "call(this, __dirname))"
|
||||||
|
}, {
|
||||||
|
search: /let pkg.*'package.json'\)\);/,
|
||||||
|
replace: ''
|
||||||
|
}, {
|
||||||
|
search: /let userAgent = 'vsts-task-installer\/' \+ pkg.version;/,
|
||||||
|
replace: "let userAgent = 'vsts-task-installer'"
|
||||||
|
}]
|
||||||
|
}])
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user