Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b882929b02 | ||
|
|
18ac32b856 | ||
|
|
57e92d55a3 | ||
|
|
ad52a31bda | ||
|
|
b8df3542ce | ||
|
|
4090f70509 | ||
|
|
5f2a8b7486 | ||
|
|
9a0c41862a | ||
|
|
12398bf4da | ||
|
|
969586f961 | ||
|
|
0df4aab1a8 | ||
|
|
ca2c8097d2 | ||
|
|
300345b152 | ||
|
|
ef8d92d27a |
14
.eslintrc.js
Normal file
14
.eslintrc.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: [
|
||||||
|
'@typescript-eslint',
|
||||||
|
'sort-keys-fix'
|
||||||
|
],
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/eslint-recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'prettier/@typescript-eslint',
|
||||||
|
],
|
||||||
|
};
|
||||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -8,6 +8,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
@@ -19,11 +20,11 @@ jobs:
|
|||||||
npm run build:azure
|
npm run build:azure
|
||||||
name: Build code
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: ./setup-gitversion
|
uses: ./gitversion/setup
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.2'
|
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-gitversion
|
uses: ./gitversion/execute
|
||||||
- run: |
|
- run: |
|
||||||
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
|
||||||
|
|||||||
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -21,12 +21,12 @@ jobs:
|
|||||||
npm run build:azure
|
npm run build:azure
|
||||||
name: Build code
|
name: Build code
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: ./setup-gitversion
|
uses: ./gitversion/setup
|
||||||
with:
|
with:
|
||||||
versionSpec: '5.1.2'
|
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-gitversion
|
uses: ./gitversion/execute
|
||||||
- run: |
|
- run: |
|
||||||
$date = Get-Date -format "yyMMddHHmm"
|
$date = Get-Date -format "yyMMddHHmm"
|
||||||
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
||||||
@@ -35,8 +35,7 @@ jobs:
|
|||||||
|
|
||||||
. .\dist\azure\update-version.ps1
|
. .\dist\azure\update-version.ps1
|
||||||
update-manifest .\dist\azure\vss-extension.json -Version $version
|
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||||
update-task .\dist\azure\setup-gitversion\task.json -Major $major -Minor $minor
|
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor }
|
||||||
update-task .\dist\azure\execute-gitversion\task.json -Major $major -Minor $minor
|
|
||||||
|
|
||||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
@@ -9,7 +9,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Mock",
|
"preLaunchTask": "Build-Mock",
|
||||||
"name": "Debug Mock Setup GitVersion",
|
"name": "Debug Mock Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/mock/setup-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/mock/gitversion/setup/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Azure",
|
"preLaunchTask": "Build-Azure",
|
||||||
"name": "Debug Azure Setup GitVersion",
|
"name": "Debug Azure Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/azure/setup-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/azure/gitversion/setup/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-GitHub",
|
"preLaunchTask": "Build-GitHub",
|
||||||
"name": "Debug GitHub Setup GitVersion",
|
"name": "Debug GitHub Setup GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/github/setup-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/github/gitversion/setup/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Mock",
|
"preLaunchTask": "Build-Mock",
|
||||||
"name": "Debug Mock Execute GitVersion",
|
"name": "Debug Mock Execute GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/mock/execute-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/mock/gitversion/execute/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Azure",
|
"preLaunchTask": "Build-Azure",
|
||||||
"name": "Debug Azure Execute GitVersion",
|
"name": "Debug Azure Execute GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/azure/execute-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/azure/gitversion/execute/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-GitHub",
|
"preLaunchTask": "Build-GitHub",
|
||||||
"name": "Debug GitHub Execute GitVersion",
|
"name": "Debug GitHub Execute GitVersion",
|
||||||
"program": "${workspaceFolder}/dist/github/execute-gitversion/bundle.js",
|
"program": "${workspaceFolder}/dist/github/gitversion/execute/bundle.js",
|
||||||
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
"outFiles": [ "${workspaceFolder}/**/*.js" ]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -9,7 +9,9 @@ GitHub Actions that allow to install and use the GitVersion and GitReleaseManage
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
See [setup](setup-gitversion/action.yml) and [usage](execute-gitversion/action.yml)
|
See [setup](gitversion/setup/action.yml) and [usage](gitversion/execute/action.yml) for GitVersion
|
||||||
|
|
||||||
|
and [setup](gitreleasemanager/setup/action.yml) for GitReleaseManager
|
||||||
|
|
||||||
## Dependency
|
## Dependency
|
||||||
|
|
||||||
@@ -20,26 +22,24 @@ There are two step dependencies that are required in your workflow before runnin
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
run: |
|
run: git fetch --prune --unshallow
|
||||||
git fetch --prune --unshallow
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Basic:
|
Basic:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: Checkout
|
||||||
- name: Fetch tags and master for GitVersion
|
uses: actions/checkout@v2
|
||||||
run: |
|
- name: Fetch all history for all tags and branches
|
||||||
git fetch --tags
|
run: git fetch --prune --unshallow
|
||||||
git branch --create-reflog master origin/master
|
|
||||||
- name: Install GitVersion
|
- name: Install GitVersion
|
||||||
uses: gittools/actions/setup-gitversion@v0.3
|
uses: gittools/actions/gitversion/setup@v0.6.1
|
||||||
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/actions/execute-gitversion@v0.3
|
uses: gittools/actions/gitversion/execute@v0.6.1
|
||||||
- run: |
|
- run: |
|
||||||
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
echo "Major: ${{ steps.gitversion.outputs.major }}"
|
||||||
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
|
||||||
@@ -80,7 +80,6 @@ Private repos require credentials before you can fetch the master branch and tag
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
|
|||||||
18286
dist/azure/execute-gitversion/bundle.js
vendored
18286
dist/azure/execute-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
18173
dist/azure/gitreleasemanager/create/bundle.js
vendored
Normal file
18173
dist/azure/gitreleasemanager/create/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/create/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/create/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
24
dist/azure/gitreleasemanager/create/task.json
vendored
Normal file
24
dist/azure/gitreleasemanager/create/task.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"id": "c77d38be-46a9-4ef1-a181-2d6050ed23d2",
|
||||||
|
"name": "gitreleasemanager/create",
|
||||||
|
"friendlyName": "Create GitReleaseManager Task",
|
||||||
|
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||||
|
"author": "GitTools Contributors",
|
||||||
|
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||||
|
"category": "Build",
|
||||||
|
"demands": [],
|
||||||
|
"version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"instanceNameFormat": "gitreleasemanager/create"
|
||||||
|
}
|
||||||
18173
dist/azure/gitreleasemanager/setup/bundle.js
vendored
Normal file
18173
dist/azure/gitreleasemanager/setup/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/setup/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/setup/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
41
dist/azure/gitreleasemanager/setup/task.json
vendored
Normal file
41
dist/azure/gitreleasemanager/setup/task.json
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"id": "e3022448-b00d-4b57-b504-606a0bcf8279",
|
||||||
|
"name": "gitreleasemanager/setup",
|
||||||
|
"friendlyName": "Setup GitReleaseManager Task",
|
||||||
|
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||||
|
"author": "GitTools Contributors",
|
||||||
|
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||||
|
"category": "Build",
|
||||||
|
"demands": [],
|
||||||
|
"version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Patch": "0"
|
||||||
|
},
|
||||||
|
"minimumAgentVersion": "2.115.0",
|
||||||
|
"execution": {
|
||||||
|
"Node": {
|
||||||
|
"target": "bundle.js",
|
||||||
|
"argumentFormat": "",
|
||||||
|
"workingDirectory": "."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"instanceNameFormat": "gitreleasemanager/setup",
|
||||||
|
"inputs": [{
|
||||||
|
"name": "versionSpec",
|
||||||
|
"type": "string",
|
||||||
|
"label": "The version spec",
|
||||||
|
"defaultValue": "",
|
||||||
|
"required": true,
|
||||||
|
"helpMarkDown": "Required version in the form of 0.10.x or exact version like 0.10.2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "includePrerelease",
|
||||||
|
"type": "boolean",
|
||||||
|
"label": "Include pre-release versions",
|
||||||
|
"defaultValue": "false",
|
||||||
|
"required": false,
|
||||||
|
"helpMarkDown": "Include pre-release versions when matching a version"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
18289
dist/azure/gitversion/execute/bundle.js
vendored
Normal file
18289
dist/azure/gitversion/execute/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
46
dist/azure/gitversion/execute/lib.json
vendored
Normal file
46
dist/azure/gitversion/execute/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."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
|
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
|
||||||
"name": "gitversion-execute",
|
"name": "gitversion/execute",
|
||||||
"friendlyName": "Execute GitVersion Task",
|
"friendlyName": "Execute GitVersion Task",
|
||||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||||
"author": "GitVersion Contributors",
|
"author": "GitTools Contributors",
|
||||||
"helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help",
|
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||||
"category": "Build",
|
"category": "Build",
|
||||||
"demands": [],
|
"demands": [],
|
||||||
"version": {
|
"version": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitversion-execute",
|
"instanceNameFormat": "gitversion/execute",
|
||||||
"groups": [{
|
"groups": [{
|
||||||
"name": "gitversionDetails",
|
"name": "gitversionDetails",
|
||||||
"displayName": "GitVersion details",
|
"displayName": "GitVersion details",
|
||||||
18289
dist/azure/gitversion/setup/bundle.js
vendored
Normal file
18289
dist/azure/gitversion/setup/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
46
dist/azure/gitversion/setup/lib.json
vendored
Normal file
46
dist/azure/gitversion/setup/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."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
|
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
|
||||||
"name": "gitversion-setup",
|
"name": "gitversion/setup",
|
||||||
"friendlyName": "Setup GitVersion Task",
|
"friendlyName": "Setup GitVersion Task",
|
||||||
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
|
||||||
"author": "GitVersion Contributors",
|
"author": "GitTools Contributors",
|
||||||
"helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help",
|
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
|
||||||
"category": "Build",
|
"category": "Build",
|
||||||
"demands": [],
|
"demands": [],
|
||||||
"version": {
|
"version": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"workingDirectory": "."
|
"workingDirectory": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"instanceNameFormat": "gitversion-setup",
|
"instanceNameFormat": "gitversion/setup",
|
||||||
"inputs": [{
|
"inputs": [{
|
||||||
"name": "versionSpec",
|
"name": "versionSpec",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
18286
dist/azure/setup-gitversion/bundle.js
vendored
18286
dist/azure/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
32
dist/azure/vss-extension.json
vendored
32
dist/azure/vss-extension.json
vendored
@@ -11,8 +11,10 @@
|
|||||||
"id": "Microsoft.VisualStudio.Services"
|
"id": "Microsoft.VisualStudio.Services"
|
||||||
}],
|
}],
|
||||||
"files": [
|
"files": [
|
||||||
{ "path": "execute-gitversion" },
|
{ "path": "gitversion/setup" },
|
||||||
{ "path": "setup-gitversion" }
|
{ "path": "gitversion/execute" },
|
||||||
|
{ "path": "gitreleasemanager/setup" },
|
||||||
|
{ "path": "gitreleasemanager/create" }
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"Azure Pipelines"
|
"Azure Pipelines"
|
||||||
@@ -32,10 +34,10 @@
|
|||||||
],
|
],
|
||||||
"links": {
|
"links": {
|
||||||
"learn": {
|
"learn": {
|
||||||
"uri": "http://gitversion.readthedocs.org/en/stable"
|
"uri": "https://github.com/GitTools/actions"
|
||||||
},
|
},
|
||||||
"getstarted": {
|
"getstarted": {
|
||||||
"uri": "http://gitversion.readthedocs.org/en/stable/build-server-support/build-server/tfs-build-vnext/#running-inside-tfs"
|
"uri": "https://github.com/GitTools/actions"
|
||||||
},
|
},
|
||||||
"license": {
|
"license": {
|
||||||
"uri": "https://github.com/GitTools/actions/blob/master/LICENSE"
|
"uri": "https://github.com/GitTools/actions/blob/master/LICENSE"
|
||||||
@@ -66,7 +68,7 @@
|
|||||||
"ms.vss-distributed-task.tasks"
|
"ms.vss-distributed-task.tasks"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": "setup-gitversion"
|
"name": "gitversion/setup"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"id": "execute-gitversion-task",
|
"id": "execute-gitversion-task",
|
||||||
@@ -75,7 +77,25 @@
|
|||||||
"ms.vss-distributed-task.tasks"
|
"ms.vss-distributed-task.tasks"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": "execute-gitversion"
|
"name": "gitversion/execute"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"id": "setup-gitreleasemanager-task",
|
||||||
|
"type": "ms.vss-distributed-task.task",
|
||||||
|
"targets": [
|
||||||
|
"ms.vss-distributed-task.tasks"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"name": "gitreleasemanager/setup"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"id": "create-gitreleasemanager-task",
|
||||||
|
"type": "ms.vss-distributed-task.task",
|
||||||
|
"targets": [
|
||||||
|
"ms.vss-distributed-task.tasks"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"name": "gitreleasemanager/create"
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
11983
dist/github/execute-gitversion/bundle.js
vendored
11983
dist/github/execute-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
12214
dist/github/gitreleasemanager/create/bundle.js
vendored
Normal file
12214
dist/github/gitreleasemanager/create/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12214
dist/github/gitreleasemanager/setup/bundle.js
vendored
Normal file
12214
dist/github/gitreleasemanager/setup/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12330
dist/github/gitversion/execute/bundle.js
vendored
Normal file
12330
dist/github/gitversion/execute/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11983
dist/github/setup-gitversion/bundle.js
vendored
11983
dist/github/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
7580
dist/mock/gitreleasemanager/create/bundle.js
vendored
Normal file
7580
dist/mock/gitreleasemanager/create/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7580
dist/mock/gitreleasemanager/setup/bundle.js
vendored
Normal file
7580
dist/mock/gitreleasemanager/setup/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7696
dist/mock/gitversion/execute/bundle.js
vendored
Normal file
7696
dist/mock/gitversion/execute/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7696
dist/mock/gitversion/setup/bundle.js
vendored
Normal file
7696
dist/mock/gitversion/setup/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7693
dist/mock/setup-gitversion/bundle.js
vendored
7693
dist/mock/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
9
gitreleasemanager/create/action.yml
Normal file
9
gitreleasemanager/create/action.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: gitreleasemanager-create
|
||||||
|
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Creates the release
|
||||||
|
author: GitTools
|
||||||
|
branding:
|
||||||
|
color: gray-dark
|
||||||
|
icon: git-pull-request
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../../dist/github/gitreleasemanager/create/bundle.js
|
||||||
18
gitreleasemanager/setup/action.yml
Normal file
18
gitreleasemanager/setup/action.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: gitreleasemanager-setup
|
||||||
|
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Installs the specific version of GitReleaseManager.Tool
|
||||||
|
author: GitTools
|
||||||
|
branding:
|
||||||
|
color: gray-dark
|
||||||
|
icon: git-pull-request
|
||||||
|
runs:
|
||||||
|
using: node12
|
||||||
|
main: ../../dist/github/gitreleasemanager/setup/bundle.js
|
||||||
|
inputs:
|
||||||
|
versionSpec:
|
||||||
|
description: Required version in the form of 0.10.x or exact version like 0.10.2
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
includePrerelease:
|
||||||
|
description: Include pre-release versions when matching a version
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
@@ -6,7 +6,7 @@ branding:
|
|||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node12
|
using: node12
|
||||||
main: ../dist/github/execute-gitversion/bundle.js
|
main: ../../dist/github/gitversion/execute/bundle.js
|
||||||
inputs:
|
inputs:
|
||||||
targetPath:
|
targetPath:
|
||||||
description: Optionally supply the path to the working directory
|
description: Optionally supply the path to the working directory
|
||||||
@@ -6,7 +6,7 @@ branding:
|
|||||||
icon: git-pull-request
|
icon: git-pull-request
|
||||||
runs:
|
runs:
|
||||||
using: node12
|
using: node12
|
||||||
main: ../dist/github/setup-gitversion/bundle.js
|
main: ../../dist/github/gitversion/setup/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
|
||||||
64
package-lock.json
generated
64
package-lock.json
generated
@@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz",
|
||||||
"integrity": "sha512-xD+CQd9p4lU7ZfRqmUcbJpqR+Ss51rJRVeXMyOLrZQImN9/8Sy/BEUBnHO/UKD3z03R686PVTLfEPmkropGuLw=="
|
"integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg=="
|
||||||
},
|
},
|
||||||
"@actions/exec": {
|
"@actions/exec": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
@@ -18,9 +18,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.3.tgz",
|
||||||
"integrity": "sha512-vy5DhqTJ1gtEkpRrD/6BHhUlkeyccrOX0BT9KmtO5TWxe5KSSwVHFE+J15Z0dG+tJwZJ/nHC4slUIyqpkahoMg=="
|
"integrity": "sha512-wFwh1U4adB/Zsk4cc9kVqaBOHoknhp/pJQk+aWTocbAZWpIl4Zx/At83WFRLXvxB+5HVTWOACM6qjULMZfQSfw==",
|
||||||
|
"requires": {
|
||||||
|
"tunnel": "0.0.6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": {
|
||||||
|
"version": "0.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||||
|
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@actions/io": {
|
"@actions/io": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@@ -28,13 +38,13 @@
|
|||||||
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
|
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
|
||||||
},
|
},
|
||||||
"@actions/tool-cache": {
|
"@actions/tool-cache": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.3.1.tgz",
|
||||||
"integrity": "sha512-pbv32I89niDShw1YTDo0OFQmWPkZPElE7e3So1jfEzjIyzGRfYIzshwOVhemJZLcDtzo3kxO3GFDAmuVvub/6w==",
|
"integrity": "sha512-sKoEJv0/c7WzjPEq2PO12Sc8QdEp58XIBHMm3c4lUn/iZWgLz9HBeCuFGpLQjDvXJNfLZ4g+WD+rMjgOmpH4Ag==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.0",
|
||||||
"@actions/exec": "^1.0.0",
|
"@actions/exec": "^1.0.0",
|
||||||
"@actions/http-client": "^1.0.1",
|
"@actions/http-client": "^1.0.3",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
"semver": "^6.1.0",
|
"semver": "^6.1.0",
|
||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2"
|
||||||
@@ -48,18 +58,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/code-frame": {
|
"@babel/code-frame": {
|
||||||
"version": "7.5.5",
|
"version": "7.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
|
||||||
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
|
"integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/highlight": "^7.0.0"
|
"@babel/highlight": "^7.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/highlight": {
|
"@babel/highlight": {
|
||||||
"version": "7.5.0",
|
"version": "7.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz",
|
||||||
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
|
"integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chalk": "^2.0.0",
|
"chalk": "^2.0.0",
|
||||||
@@ -68,9 +78,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "13.1.8",
|
"version": "13.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.5.0.tgz",
|
||||||
"integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==",
|
"integrity": "sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/q": {
|
"@types/q": {
|
||||||
@@ -1562,9 +1572,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"diff": {
|
"diff": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"diffie-hellman": {
|
"diffie-hellman": {
|
||||||
@@ -5455,9 +5465,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.20.1",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslint/-/tslint-6.0.0.tgz",
|
||||||
"integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
|
"integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.0.0",
|
"@babel/code-frame": "^7.0.0",
|
||||||
@@ -5471,7 +5481,7 @@
|
|||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"resolve": "^1.3.2",
|
"resolve": "^1.3.2",
|
||||||
"semver": "^5.3.0",
|
"semver": "^5.3.0",
|
||||||
"tslib": "^1.8.0",
|
"tslib": "^1.10.0",
|
||||||
"tsutils": "^2.29.0"
|
"tsutils": "^2.29.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.1",
|
"@actions/core": "^1.2.2",
|
||||||
"@actions/exec": "^1.0.3",
|
"@actions/exec": "^1.0.3",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"@actions/tool-cache": "^1.3.0",
|
"@actions/tool-cache": "^1.3.1",
|
||||||
"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",
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"uuid": "^3.4.0"
|
"uuid": "^3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^13.1.8",
|
"@types/node": "^13.5.0",
|
||||||
"@types/q": "^1.5.2",
|
"@types/q": "^1.5.2",
|
||||||
"@types/semver-compare": "^1.0.1",
|
"@types/semver-compare": "^1.0.1",
|
||||||
"@types/uuid": "^3.4.6",
|
"@types/uuid": "^3.4.6",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"replace-in-file-webpack-plugin": "^1.0.6",
|
"replace-in-file-webpack-plugin": "^1.0.6",
|
||||||
"tfx-cli": "^0.7.11",
|
"tfx-cli": "^0.7.11",
|
||||||
"ts-loader": "^6.2.1",
|
"ts-loader": "^6.2.1",
|
||||||
"tslint": "^5.20.1",
|
"tslint": "^6.0.0",
|
||||||
"typescript": "^3.7.5",
|
"typescript": "^3.7.5",
|
||||||
"webpack": "^4.41.5",
|
"webpack": "^4.41.5",
|
||||||
"webpack-cli": "^3.3.10"
|
"webpack-cli": "^3.3.10"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ 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 "../../core/interfaces";
|
import { IBuildAgent, IExecResult } from "../../core/common";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import * as toolCache from "@actions/tool-cache";
|
|||||||
|
|
||||||
import { injectable } from "inversify";
|
import { injectable } from "inversify";
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../../core/interfaces";
|
import { IBuildAgent, IExecResult } from "../../core/common";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { injectable } from "inversify";
|
import { injectable } from "inversify";
|
||||||
|
|
||||||
import { IBuildAgent, IExecResult } from "../../core/interfaces";
|
import { IBuildAgent, IExecResult } from "../../core/common";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class BuildAgent implements IBuildAgent {
|
class BuildAgent implements IBuildAgent {
|
||||||
|
|||||||
@@ -4,12 +4,70 @@ 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 cmp from "semver-compare";
|
||||||
|
|
||||||
import { inject, injectable } from "inversify";
|
import { inject, injectable } from "inversify";
|
||||||
|
|
||||||
import { IBuildAgent, IDotnetTool, IExecResult, IGitVersionOptions, IGitVersionTool, IVersionManager } from "./interfaces";
|
import { BuildAgent } from "../agent/mock/build-agent";
|
||||||
import { TYPES } from "./types";
|
import { Container } from "inversify";
|
||||||
|
|
||||||
|
const container = new Container();
|
||||||
|
|
||||||
|
export interface IVersionManager {
|
||||||
|
isExplicitVersion(versionSpec: string): boolean;
|
||||||
|
evaluateVersions(versions: string[], versionSpec: string): string;
|
||||||
|
cleanVersion(version: string): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IBuildAgent {
|
||||||
|
agentName: string;
|
||||||
|
find(toolName: string, versionSpec: string, arch?: string): string;
|
||||||
|
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
||||||
|
createTempDir(): Promise<string>;
|
||||||
|
debug(message: string): void;
|
||||||
|
setFailed(message: string, done?: boolean): void;
|
||||||
|
setSucceeded(message: string, done?: boolean): void;
|
||||||
|
exportVariable(name: string, val: string): void;
|
||||||
|
getVariable(name: string): string;
|
||||||
|
addPath(inputPath: string): void;
|
||||||
|
which(tool: string, check?: boolean): Promise<string>;
|
||||||
|
exec(exec: string, args: string[]): Promise<IExecResult>;
|
||||||
|
|
||||||
|
getSourceDir(): string;
|
||||||
|
isValidInputFile(input: string, file: string): boolean;
|
||||||
|
fileExists(file: string): boolean;
|
||||||
|
directoryExists(file: string): boolean;
|
||||||
|
|
||||||
|
setOutput(name: string, value: string): void;
|
||||||
|
getInput(input: string, required?: boolean): string;
|
||||||
|
getBooleanInput(input: string, required?: boolean): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDotnetTool {
|
||||||
|
run(args: string[]): Promise<IExecResult>;
|
||||||
|
toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean): Promise<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IExecResult {
|
||||||
|
stdout: string;
|
||||||
|
stderr: string;
|
||||||
|
code: number;
|
||||||
|
error: Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TYPES = {
|
||||||
|
IBuildAgent: Symbol.for("BuildAgent"),
|
||||||
|
IDotnetTool: Symbol.for("DotnetTool"),
|
||||||
|
IGitVersionTool: Symbol.for("GitVersionTool"),
|
||||||
|
IGitReleaseManagerTool: Symbol.for("GitReleaseManagerTool"),
|
||||||
|
IVersionManager: Symbol.for("VersionManager"),
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SetupOptions = {
|
||||||
|
includePrerelease: "includePrerelease",
|
||||||
|
versionSpec: "versionSpec",
|
||||||
|
};
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class DotnetTool implements IDotnetTool {
|
class DotnetTool implements IDotnetTool {
|
||||||
@@ -110,7 +168,7 @@ class DotnetTool implements IDotnetTool {
|
|||||||
const body: string = await res.readBody();
|
const body: string = await res.readBody();
|
||||||
const data = JSON.parse(body).data;
|
const data = JSON.parse(body).data;
|
||||||
|
|
||||||
const versions = (data[0].versions as Array<{ version: string }>).map((x) => x.version);
|
const versions = (data[0].versions as { version: string }[]).map((x) => x.version);
|
||||||
if (!versions || !versions.length) {
|
if (!versions || !versions.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -144,83 +202,6 @@ class DotnetTool implements IDotnetTool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@injectable()
|
|
||||||
class GitVersionTool implements IGitVersionTool {
|
|
||||||
|
|
||||||
private buildAgent: IBuildAgent;
|
|
||||||
private dotnetTool: IDotnetTool;
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
|
||||||
@inject(TYPES.IDotnetTool) dotnetTool: IDotnetTool,
|
|
||||||
) {
|
|
||||||
this.buildAgent = buildAgent;
|
|
||||||
this.dotnetTool = dotnetTool;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
|
|
||||||
await this.dotnetTool.toolInstall("GitVersion.Tool", versionSpec, false, includePrerelease);
|
|
||||||
}
|
|
||||||
|
|
||||||
public run(options: IGitVersionOptions): Promise<IExecResult> {
|
|
||||||
const workDir = this.getRepoDir(options.targetPath);
|
|
||||||
|
|
||||||
const args = this.getArguments(workDir, options);
|
|
||||||
|
|
||||||
return this.buildAgent.exec("dotnet-gitversion", args);
|
|
||||||
}
|
|
||||||
|
|
||||||
private getRepoDir(targetPath: string): string {
|
|
||||||
let workDir: string;
|
|
||||||
const srcDir = this.buildAgent.getSourceDir();
|
|
||||||
if (!targetPath) {
|
|
||||||
workDir = srcDir;
|
|
||||||
} else {
|
|
||||||
if (this.buildAgent.directoryExists(targetPath)) {
|
|
||||||
workDir = path.join(srcDir, targetPath);
|
|
||||||
} else {
|
|
||||||
throw new Error("Directory not found at " + targetPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return workDir.replace(/\\/g, "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
private getArguments(workDir: string, options: IGitVersionOptions): string[] {
|
|
||||||
const args = [
|
|
||||||
workDir,
|
|
||||||
"/output",
|
|
||||||
"json", // need to use buildserver later
|
|
||||||
];
|
|
||||||
|
|
||||||
const {
|
|
||||||
useConfigFile,
|
|
||||||
configFilePath,
|
|
||||||
updateAssemblyInfo,
|
|
||||||
updateAssemblyInfoFilename,
|
|
||||||
additionalArguments,
|
|
||||||
} = options;
|
|
||||||
|
|
||||||
if (useConfigFile) {
|
|
||||||
if (this.buildAgent.isValidInputFile("configFilePath", configFilePath)) {
|
|
||||||
args.push("/config", configFilePath);
|
|
||||||
} else {
|
|
||||||
throw new Error("GitVersion configuration file not found at " + configFilePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (updateAssemblyInfo) {
|
|
||||||
args.push("/updateassemblyinfo");
|
|
||||||
if (this.buildAgent.isValidInputFile("updateAssemblyInfoFilename", updateAssemblyInfoFilename)) {
|
|
||||||
args.push(updateAssemblyInfoFilename);
|
|
||||||
} else {
|
|
||||||
throw new Error("AssemblyInfoFilename file not found at " + updateAssemblyInfoFilename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
args.push(additionalArguments);
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
class VersionManager implements IVersionManager {
|
class VersionManager implements IVersionManager {
|
||||||
|
|
||||||
@@ -269,8 +250,8 @@ class VersionManager implements IVersionManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
container.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
||||||
DotnetTool,
|
container.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
||||||
GitVersionTool,
|
container.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
|
||||||
VersionManager,
|
|
||||||
};
|
export { container };
|
||||||
|
|||||||
23
src/core/gitreleasemanager.ts
Normal file
23
src/core/gitreleasemanager.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { IDotnetTool, IBuildAgent, TYPES } from "./common";
|
||||||
|
import { injectable, inject } from "inversify";
|
||||||
|
|
||||||
|
export interface IGitReleaseManagerTool {
|
||||||
|
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export class GitReleaseManagerTool implements IGitReleaseManagerTool {
|
||||||
|
|
||||||
|
private dotnetTool: IDotnetTool;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||||
|
@inject(TYPES.IDotnetTool) dotnetTool: IDotnetTool,
|
||||||
|
) {
|
||||||
|
this.dotnetTool = dotnetTool;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
|
||||||
|
await this.dotnetTool.toolInstall("GitReleaseManager.Tool", versionSpec, false, includePrerelease);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,59 +1,158 @@
|
|||||||
import { IBuildAgent, IGitVersion, IGitVersionOptions, IGitVersionTool } from "./interfaces";
|
import { IBuildAgent, IDotnetTool, IExecResult, TYPES } from "./common";
|
||||||
import { ioc } from "./ioc";
|
import { injectable, inject } from "inversify";
|
||||||
import { RunOptions, SetupOptions, TYPES } from "./types";
|
import path = require("path");
|
||||||
|
|
||||||
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
export interface IGitVersionOptions {
|
||||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
targetPath: string;
|
||||||
|
useConfigFile: boolean;
|
||||||
export async function setup() {
|
configFilePath: string;
|
||||||
try {
|
updateAssemblyInfo: boolean;
|
||||||
|
updateAssemblyInfoFilename: string;
|
||||||
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
additionalArguments: string;
|
||||||
|
srcDir: string;
|
||||||
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() {
|
export const RunOptions = {
|
||||||
try {
|
targetPath: "targetPath",
|
||||||
const inputOptions: IGitVersionOptions = getGitVersionOptions();
|
|
||||||
|
|
||||||
const result = await gitVersionTool.run(inputOptions);
|
useConfigFile: "useConfigFile",
|
||||||
|
configFilePath: "configFilePath",
|
||||||
|
|
||||||
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
updateAssemblyInfo: "configFilePath",
|
||||||
writeGitVersionToAgent(gitversion);
|
updateAssemblyInfoFilename: "configFilePath",
|
||||||
|
|
||||||
if (result.code === 0) {
|
additionalArguments: "additionalArguments",
|
||||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
};
|
||||||
|
|
||||||
|
export interface IGitVersion {
|
||||||
|
Major: number;
|
||||||
|
Minor: number;
|
||||||
|
Patch: number;
|
||||||
|
PreReleaseTag: string;
|
||||||
|
PreReleaseTagWithDash: string;
|
||||||
|
PreReleaseLabel: string;
|
||||||
|
PreReleaseNumber: number;
|
||||||
|
WeightedPreReleaseNumber: number;
|
||||||
|
BuildMetaData: number;
|
||||||
|
BuildMetaDataPadded: string;
|
||||||
|
FullBuildMetaData: string;
|
||||||
|
MajorMinorPatch: string;
|
||||||
|
SemVer: string;
|
||||||
|
LegacySemVer: string;
|
||||||
|
LegacySemVerPadded: string;
|
||||||
|
AssemblySemVer: string;
|
||||||
|
AssemblySemFileVer: string;
|
||||||
|
FullSemVer: string;
|
||||||
|
InformationalVersion: string;
|
||||||
|
BranchName: string;
|
||||||
|
Sha: string;
|
||||||
|
ShortSha: string;
|
||||||
|
NuGetVersionV2: string;
|
||||||
|
NuGetVersion: string;
|
||||||
|
NuGetPreReleaseTagV2: string;
|
||||||
|
NuGetPreReleaseTag: string;
|
||||||
|
VersionSourceSha: string;
|
||||||
|
CommitsSinceVersionSource: number;
|
||||||
|
CommitsSinceVersionSourcePadded: string;
|
||||||
|
CommitDate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGitVersionTool {
|
||||||
|
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||||
|
run(options: IGitVersionOptions): Promise<IExecResult>;
|
||||||
|
writeGitVersionToAgent(gitversion: IGitVersion): void;
|
||||||
|
getGitVersionOptions(): IGitVersionOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export class GitVersionTool implements IGitVersionTool {
|
||||||
|
|
||||||
|
private buildAgent: IBuildAgent;
|
||||||
|
private dotnetTool: IDotnetTool;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||||
|
@inject(TYPES.IDotnetTool) dotnetTool: IDotnetTool,
|
||||||
|
) {
|
||||||
|
this.buildAgent = buildAgent;
|
||||||
|
this.dotnetTool = dotnetTool;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
|
||||||
|
await this.dotnetTool.toolInstall("GitVersion.Tool", versionSpec, false, includePrerelease);
|
||||||
|
}
|
||||||
|
|
||||||
|
public run(options: IGitVersionOptions): Promise<IExecResult> {
|
||||||
|
const workDir = this.getRepoDir(options.targetPath);
|
||||||
|
|
||||||
|
const args = this.getArguments(workDir, options);
|
||||||
|
|
||||||
|
return this.buildAgent.exec("dotnet-gitversion", args);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getRepoDir(targetPath: string): string {
|
||||||
|
let workDir: string;
|
||||||
|
const srcDir = this.buildAgent.getSourceDir();
|
||||||
|
if (!targetPath) {
|
||||||
|
workDir = srcDir;
|
||||||
} else {
|
} else {
|
||||||
buildAgent.setFailed(result.error.message, true);
|
if (this.buildAgent.directoryExists(targetPath)) {
|
||||||
|
workDir = path.join(srcDir, targetPath);
|
||||||
|
} else {
|
||||||
|
throw new Error("Directory not found at " + targetPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return workDir.replace(/\\/g, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
private getArguments(workDir: string, options: IGitVersionOptions): string[] {
|
||||||
buildAgent.setFailed(error, true);
|
const args = [
|
||||||
|
workDir,
|
||||||
|
"/output",
|
||||||
|
"json", // need to use buildserver later
|
||||||
|
];
|
||||||
|
|
||||||
|
const {
|
||||||
|
useConfigFile,
|
||||||
|
configFilePath,
|
||||||
|
updateAssemblyInfo,
|
||||||
|
updateAssemblyInfoFilename,
|
||||||
|
additionalArguments,
|
||||||
|
} = options;
|
||||||
|
|
||||||
|
if (useConfigFile) {
|
||||||
|
if (this.buildAgent.isValidInputFile("configFilePath", configFilePath)) {
|
||||||
|
args.push("/config", configFilePath);
|
||||||
|
} else {
|
||||||
|
throw new Error("GitVersion configuration file not found at " + configFilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (updateAssemblyInfo) {
|
||||||
|
args.push("/updateassemblyinfo");
|
||||||
|
if (this.buildAgent.isValidInputFile("updateAssemblyInfoFilename", updateAssemblyInfoFilename)) {
|
||||||
|
args.push(updateAssemblyInfoFilename);
|
||||||
|
} else {
|
||||||
|
throw new Error("AssemblyInfoFilename file not found at " + updateAssemblyInfoFilename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGitVersionOptions(): IGitVersionOptions {
|
args.push(additionalArguments);
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
const targetPath = buildAgent.getInput(RunOptions.targetPath);
|
public getGitVersionOptions(): IGitVersionOptions {
|
||||||
|
|
||||||
const useConfigFile = buildAgent.getBooleanInput(RunOptions.useConfigFile);
|
const targetPath = this.buildAgent.getInput(RunOptions.targetPath);
|
||||||
const configFilePath = buildAgent.getInput(RunOptions.configFilePath);
|
|
||||||
|
|
||||||
const updateAssemblyInfo = buildAgent.getBooleanInput(RunOptions.updateAssemblyInfo);
|
const useConfigFile = this.buildAgent.getBooleanInput(RunOptions.useConfigFile);
|
||||||
const updateAssemblyInfoFilename = buildAgent.getInput(RunOptions.updateAssemblyInfoFilename);
|
const configFilePath = this.buildAgent.getInput(RunOptions.configFilePath);
|
||||||
|
|
||||||
const additionalArguments = buildAgent.getInput(RunOptions.additionalArguments);
|
const updateAssemblyInfo = this.buildAgent.getBooleanInput(RunOptions.updateAssemblyInfo);
|
||||||
|
const updateAssemblyInfoFilename = this.buildAgent.getInput(RunOptions.updateAssemblyInfoFilename);
|
||||||
|
|
||||||
const srcDir = buildAgent.getSourceDir().replace(/\\/g, "/");
|
const additionalArguments = this.buildAgent.getInput(RunOptions.additionalArguments);
|
||||||
|
|
||||||
|
const srcDir = this.buildAgent.getSourceDir().replace(/\\/g, "/");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
targetPath,
|
targetPath,
|
||||||
@@ -66,37 +165,37 @@ function getGitVersionOptions(): IGitVersionOptions {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeGitVersionToAgent(gitversion: IGitVersion): void {
|
public 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);
|
|
||||||
|
|
||||||
|
this.buildAgent.setOutput("major", gitversion.Major.toString());
|
||||||
|
this.buildAgent.setOutput("minor", gitversion.Minor.toString());
|
||||||
|
this.buildAgent.setOutput("patch", gitversion.Patch.toString());
|
||||||
|
this.buildAgent.setOutput("preReleaseTag", gitversion.PreReleaseTag);
|
||||||
|
this.buildAgent.setOutput("preReleaseTagWithDash", gitversion.PreReleaseTagWithDash);
|
||||||
|
this.buildAgent.setOutput("preReleaseLabel", gitversion.PreReleaseLabel);
|
||||||
|
this.buildAgent.setOutput("preReleaseNumber", gitversion.PreReleaseNumber.toString());
|
||||||
|
this.buildAgent.setOutput("weightedPreReleaseNumber", gitversion.WeightedPreReleaseNumber.toString());
|
||||||
|
this.buildAgent.setOutput("buildMetaData", gitversion.BuildMetaData.toString());
|
||||||
|
this.buildAgent.setOutput("buildMetaDataPadded", gitversion.BuildMetaDataPadded);
|
||||||
|
this.buildAgent.setOutput("fullBuildMetaData", gitversion.FullBuildMetaData);
|
||||||
|
this.buildAgent.setOutput("majorMinorPatch", gitversion.MajorMinorPatch);
|
||||||
|
this.buildAgent.setOutput("semVer", gitversion.SemVer);
|
||||||
|
this.buildAgent.setOutput("legacySemVer", gitversion.LegacySemVer);
|
||||||
|
this.buildAgent.setOutput("legacySemVerPadded", gitversion.LegacySemVerPadded);
|
||||||
|
this.buildAgent.setOutput("assemblySemVer", gitversion.AssemblySemVer);
|
||||||
|
this.buildAgent.setOutput("assemblySemFileVer", gitversion.AssemblySemFileVer);
|
||||||
|
this.buildAgent.setOutput("fullSemVer", gitversion.FullSemVer);
|
||||||
|
this.buildAgent.setOutput("informationalVersion", gitversion.InformationalVersion);
|
||||||
|
this.buildAgent.setOutput("branchName", gitversion.BranchName);
|
||||||
|
this.buildAgent.setOutput("sha", gitversion.Sha);
|
||||||
|
this.buildAgent.setOutput("shortSha", gitversion.ShortSha);
|
||||||
|
this.buildAgent.setOutput("nuGetVersionV2", gitversion.NuGetVersionV2);
|
||||||
|
this.buildAgent.setOutput("nuGetVersion", gitversion.NuGetVersion);
|
||||||
|
this.buildAgent.setOutput("nuGetPreReleaseTagV2", gitversion.NuGetPreReleaseTagV2);
|
||||||
|
this.buildAgent.setOutput("nuGetPreReleaseTag", gitversion.NuGetPreReleaseTag);
|
||||||
|
this.buildAgent.setOutput("versionSourceSha", gitversion.VersionSourceSha);
|
||||||
|
this.buildAgent.setOutput("commitsSinceVersionSource", gitversion.CommitsSinceVersionSource.toString());
|
||||||
|
this.buildAgent.setOutput("commitsSinceVersionSourcePadded", gitversion.CommitsSinceVersionSourcePadded);
|
||||||
|
this.buildAgent.setOutput("commitDate", gitversion.CommitDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
export interface IVersionManager {
|
|
||||||
isExplicitVersion(versionSpec: string): boolean;
|
|
||||||
evaluateVersions(versions: string[], versionSpec: string): string;
|
|
||||||
cleanVersion(version: string): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IBuildAgent {
|
|
||||||
agentName: string;
|
|
||||||
find(toolName: string, versionSpec: string, arch?: string): string;
|
|
||||||
cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
|
||||||
createTempDir(): Promise<string>;
|
|
||||||
debug(message: string): void;
|
|
||||||
setFailed(message: string, done?: boolean): void;
|
|
||||||
setSucceeded(message: string, done?: boolean): void;
|
|
||||||
exportVariable(name: string, val: string): void;
|
|
||||||
getVariable(name: string): string;
|
|
||||||
addPath(inputPath: string): void;
|
|
||||||
which(tool: string, check?: boolean): Promise<string>;
|
|
||||||
exec(exec: string, args: string[]): Promise<IExecResult>;
|
|
||||||
|
|
||||||
getSourceDir(): string;
|
|
||||||
isValidInputFile(input: string, file: string): boolean;
|
|
||||||
fileExists(file: string): boolean;
|
|
||||||
directoryExists(file: string): boolean;
|
|
||||||
|
|
||||||
setOutput(name: string, value: string): void;
|
|
||||||
getInput(input: string, required?: boolean): string;
|
|
||||||
getBooleanInput(input: string, required?: boolean): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IDotnetTool {
|
|
||||||
run(args: string[]): Promise<IExecResult>;
|
|
||||||
toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean): Promise<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Argument {
|
|
||||||
constructor(public readonly name: string, public readonly value: string) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export interface IGitVersionTool {
|
|
||||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
|
||||||
run(options: IGitVersionOptions): Promise<IExecResult>;
|
|
||||||
}
|
|
||||||
export interface IExecResult {
|
|
||||||
stdout: string;
|
|
||||||
stderr: string;
|
|
||||||
code: number;
|
|
||||||
error: Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGitVersionOptions {
|
|
||||||
targetPath: string;
|
|
||||||
useConfigFile: boolean;
|
|
||||||
configFilePath: string;
|
|
||||||
updateAssemblyInfo: boolean;
|
|
||||||
updateAssemblyInfoFilename: string;
|
|
||||||
additionalArguments: string;
|
|
||||||
srcDir: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGitVersion {
|
|
||||||
Major: number;
|
|
||||||
Minor: number;
|
|
||||||
Patch: number;
|
|
||||||
PreReleaseTag: string;
|
|
||||||
PreReleaseTagWithDash: string;
|
|
||||||
PreReleaseLabel: string;
|
|
||||||
PreReleaseNumber: number;
|
|
||||||
WeightedPreReleaseNumber: number;
|
|
||||||
BuildMetaData: number;
|
|
||||||
BuildMetaDataPadded: string;
|
|
||||||
FullBuildMetaData: string;
|
|
||||||
MajorMinorPatch: string;
|
|
||||||
SemVer: string;
|
|
||||||
LegacySemVer: string;
|
|
||||||
LegacySemVerPadded: string;
|
|
||||||
AssemblySemVer: string;
|
|
||||||
AssemblySemFileVer: string;
|
|
||||||
FullSemVer: string;
|
|
||||||
InformationalVersion: string;
|
|
||||||
BranchName: string;
|
|
||||||
Sha: string;
|
|
||||||
ShortSha: string;
|
|
||||||
NuGetVersionV2: string;
|
|
||||||
NuGetVersion: string;
|
|
||||||
NuGetPreReleaseTagV2: string;
|
|
||||||
NuGetPreReleaseTag: string;
|
|
||||||
VersionSourceSha: string;
|
|
||||||
CommitsSinceVersionSource: number;
|
|
||||||
CommitsSinceVersionSourcePadded: string;
|
|
||||||
CommitDate: string;
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { Container } from "inversify";
|
|
||||||
|
|
||||||
import { BuildAgent } from "../agent/mock/build-agent";
|
|
||||||
import { DotnetTool, GitVersionTool, VersionManager } from "./common";
|
|
||||||
import { IBuildAgent, IDotnetTool, IGitVersionTool, IVersionManager } from "./interfaces";
|
|
||||||
import { TYPES } from "./types";
|
|
||||||
|
|
||||||
const ioc = new Container();
|
|
||||||
|
|
||||||
ioc.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
|
||||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
|
||||||
ioc.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
|
|
||||||
ioc.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
|
||||||
|
|
||||||
export { ioc };
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
const TYPES = {
|
|
||||||
IBuildAgent: Symbol.for("BuildAgent"),
|
|
||||||
IDotnetTool: Symbol.for("DotnetTool"),
|
|
||||||
IGitVersionTool: Symbol.for("GitVersionTool"),
|
|
||||||
IVersionManager: Symbol.for("VersionManager"),
|
|
||||||
};
|
|
||||||
|
|
||||||
const SetupOptions = {
|
|
||||||
includePrerelease: "includePrerelease",
|
|
||||||
versionSpec: "versionSpec",
|
|
||||||
};
|
|
||||||
|
|
||||||
const RunOptions = {
|
|
||||||
targetPath: "targetPath",
|
|
||||||
|
|
||||||
useConfigFile: "useConfigFile",
|
|
||||||
configFilePath: "configFilePath",
|
|
||||||
|
|
||||||
updateAssemblyInfo: "configFilePath",
|
|
||||||
updateAssemblyInfoFilename: "configFilePath",
|
|
||||||
|
|
||||||
additionalArguments: "additionalArguments",
|
|
||||||
};
|
|
||||||
|
|
||||||
export { SetupOptions, RunOptions, TYPES };
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
import { run } from "./core/gitversion";
|
|
||||||
|
|
||||||
run();
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import "reflect-metadata";
|
|
||||||
import { setup } from "./core/gitversion";
|
|
||||||
|
|
||||||
setup();
|
|
||||||
4
src/tasks/gitreleasemanager/create.ts
Normal file
4
src/tasks/gitreleasemanager/create.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { create } from "./main";
|
||||||
|
|
||||||
|
create();
|
||||||
34
src/tasks/gitreleasemanager/main.ts
Normal file
34
src/tasks/gitreleasemanager/main.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { container, IBuildAgent, TYPES, SetupOptions } from "../../core/common";
|
||||||
|
import { IGitReleaseManagerTool, GitReleaseManagerTool } from "../../core/gitreleasemanager";
|
||||||
|
|
||||||
|
container.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool);
|
||||||
|
|
||||||
|
const gitReleaseManagerTool = container.get<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool);
|
||||||
|
const buildAgent = container.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 gitReleaseManagerTool.install(versionSpec, includePrerelease);
|
||||||
|
|
||||||
|
buildAgent.setSucceeded("GitVersionManager installed successfully", true);
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error.message, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function create() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
||||||
|
|
||||||
|
buildAgent.setSucceeded("GitVersionManager created release successfully", true);
|
||||||
|
} catch (error) {
|
||||||
|
buildAgent.setFailed(error.message, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
4
src/tasks/gitreleasemanager/setup.ts
Normal file
4
src/tasks/gitreleasemanager/setup.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { setup } from "./main";
|
||||||
|
|
||||||
|
setup();
|
||||||
4
src/tasks/gitversion/execute.ts
Normal file
4
src/tasks/gitversion/execute.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { run } from "./main";
|
||||||
|
|
||||||
|
run();
|
||||||
43
src/tasks/gitversion/main.ts
Normal file
43
src/tasks/gitversion/main.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { container, IBuildAgent, TYPES, SetupOptions } from "../../core/common";
|
||||||
|
import { IGitVersionTool, IGitVersionOptions, IGitVersion, GitVersionTool } from "../../core/gitversion";
|
||||||
|
|
||||||
|
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
||||||
|
|
||||||
|
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
||||||
|
const buildAgent = container.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 = gitVersionTool.getGitVersionOptions();
|
||||||
|
|
||||||
|
const result = await gitVersionTool.run(inputOptions);
|
||||||
|
|
||||||
|
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
||||||
|
gitVersionTool.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
4
src/tasks/gitversion/setup.ts
Normal file
4
src/tasks/gitversion/setup.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { setup } from "./main";
|
||||||
|
|
||||||
|
setup();
|
||||||
@@ -8,8 +8,10 @@ module.exports = (env) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
entry: {
|
entry: {
|
||||||
'setup-gitversion': path.resolve(__dirname, 'src/setup-gitversion.ts'),
|
'gitversion/setup': path.resolve(__dirname, 'src/tasks/gitversion/setup.ts'),
|
||||||
'execute-gitversion': path.resolve(__dirname, 'src/execute-gitversion.ts'),
|
'gitversion/execute': path.resolve(__dirname, 'src/tasks/gitversion/execute.ts'),
|
||||||
|
'gitreleasemanager/setup': path.resolve(__dirname, 'src/tasks/gitreleasemanager/setup.ts'),
|
||||||
|
'gitreleasemanager/create': path.resolve(__dirname, 'src/tasks/gitreleasemanager/create.ts'),
|
||||||
},
|
},
|
||||||
target: 'node',
|
target: 'node',
|
||||||
mode: mode,
|
mode: mode,
|
||||||
|
|||||||
Reference in New Issue
Block a user