65 Commits

Author SHA1 Message Date
Artur Stolear
4dc8ca33d2 include patch when versioning tasks 2020-02-10 11:25:57 +02:00
Artur Stolear
cf8a2d8310 small improvements to webpack.config 2020-02-10 11:25:57 +02:00
Artur Stolear
6643846bbb use node __dirname and __filename in webpack 2020-02-09 19:42:43 +02:00
Artur Stolear
a0d003d148 use the targetDirectory based on repo root 2020-02-09 09:32:38 +02:00
Artur Stolear
571cacf6d9 compiled open action 2020-02-09 09:27:22 +02:00
Artur Stolear
b7fcc8e701 added GRM open action 2020-02-09 09:27:22 +02:00
Artur Stolear
3d22c1208a compiled close action 2020-02-09 08:51:45 +02:00
Artur Stolear
4ff3b135ec added GRM close action 2020-02-09 08:51:45 +02:00
Artur Stolear
c39eddbc81 moved targetDirectory filed to common base 2020-02-09 00:49:14 +02:00
Artur Stolear
4bda6b5eba renamed gitversion-tool and gitreleasemanager-tool to just tool 2020-02-09 00:30:13 +02:00
Artur Stolear
edd278e744 use the targetDirectory based on repo root
use the targetDirectory based on repo root
2020-02-09 00:28:20 +02:00
Artur Stolear
c7eb02e614 compiled discard action 2020-02-08 21:32:40 +02:00
Artur Stolear
6cbe5073c3 added GRM discard action 2020-02-08 21:32:22 +02:00
Artur Stolear
0e2e93e6aa added GRM create assets 2020-02-08 20:32:41 +02:00
Artur Stolear
274c9b2e99 moved the common settings to a file 2020-02-08 19:20:43 +02:00
Artur Stolear
dab6b01596 moved the gitversion settings to a file 2020-02-08 19:02:57 +02:00
Artur Stolear
b98ee9d8b2 create action for GRM (2)
added azure task definition
2020-02-08 17:38:58 +02:00
Artur Stolear
aba63c943d made gitversion & gitreleasemanager extend dotnet-tool 2020-02-08 15:49:46 +02:00
Artur Stolear
1be05ba386 create action for GRM (2)
check the options settings
2020-02-08 10:57:00 +02:00
Artur Stolear
632a7fdad0 create action for GRM (2) 2020-02-08 10:40:14 +02:00
Artur Stolear
b677d43869 fix github version of isValidInputFile 2020-02-08 10:07:21 +02:00
Artur Stolear
1c5c0557da minor 2020-02-08 09:19:57 +02:00
Artur Stolear
f17101e556 moved tools to separate folders 2020-02-07 22:38:58 +02:00
Artur Stolear
7dee6ba225 split the common.ts into several files 2020-02-07 22:18:48 +02:00
Artur Stolear
237764149f minor 2020-02-03 19:31:31 +02:00
dependabot-preview[bot]
5021e6bca9 Bump @types/node from 13.5.3 to 13.7.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.3 to 13.7.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 09:11:34 +01:00
dependabot-preview[bot]
b541d2f286 Bump @types/node from 13.5.2 to 13.5.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.2 to 13.5.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 09:39:39 +02:00
dependabot-preview[bot]
2e93547963 Bump @types/node from 13.5.1 to 13.5.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.1 to 13.5.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 09:33:31 +02:00
dependabot-preview[bot]
22c25b670a Bump @types/uuid from 3.4.6 to 3.4.7
Bumps [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid) from 3.4.6 to 3.4.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 09:49:31 +02:00
dependabot-preview[bot]
32247c8ed9 Bump @types/node from 13.5.0 to 13.5.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.5.0 to 13.5.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 09:49:19 +02:00
Artur Stolear
b882929b02 added create action for GRM 2020-01-26 23:01:40 +02:00
Artur Stolear
18ac32b856 re-arranged files 2020-01-26 09:03:09 +02:00
Artur Stolear
57e92d55a3 updated README 2020-01-25 19:37:19 +02:00
Artur Stolear
ad52a31bda rework the tasks structure 2020-01-25 09:29:13 +02:00
Artur Stolear
b8df3542ce rework the tasks structure 2020-01-25 08:48:01 +02:00
Artur Stolear
4090f70509 updated README with the new actions paths 2020-01-24 16:21:04 +02:00
Artur Stolear
5f2a8b7486 move the github actions to separate folders within tool folder 2020-01-24 15:01:23 +02:00
Joseph Petersen
9a0c41862a update basic example to use actions/checkout@v2 2020-01-24 11:30:24 +02:00
dependabot-preview[bot]
12398bf4da Bump @actions/tool-cache from 1.3.0 to 1.3.1
Bumps [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/master/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/tool-cache)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-24 10:32:25 +02:00
dependabot-preview[bot]
969586f961 Bump @actions/core from 1.2.1 to 1.2.2
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/master/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-24 10:31:39 +02:00
dependabot-preview[bot]
0df4aab1a8 Bump @types/node from 13.1.8 to 13.5.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.1.8 to 13.5.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-24 10:31:27 +02:00
dependabot-preview[bot]
ca2c8097d2 Bump tslint from 5.20.1 to 6.0.0
Bumps [tslint](https://github.com/palantir/tslint) from 5.20.1 to 6.0.0.
- [Release notes](https://github.com/palantir/tslint/releases)
- [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/palantir/tslint/compare/5.20.1...6.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-24 10:29:19 +02:00
Artur Stolear
300345b152 added setup for gitreleasemanager 2020-01-23 21:22:05 +02:00
Artur Stolear
ef8d92d27a update the author to gittools for azure tasks 2020-01-23 18:05:57 +02:00
Artur Stolear
5e98e2ad3c disable release in prod mode 2020-01-22 19:42:02 +02:00
Artur Stolear
1e937858a2 added the compiled versions 2020-01-22 19:31:05 +02:00
Artur Stolear
0eae1609b6 actually building the code in the CI 2020-01-22 19:26:46 +02:00
Artur Stolear
ee69b451cc fix for webpack bundle 2020-01-22 17:53:35 +02:00
Artur Stolear
5ed9f1a870 using webpack for azure task 2020-01-20 19:06:54 +02:00
Artur Stolear
8c92ba9adb added webpack config 2020-01-20 18:52:56 +02:00
dependabot-preview[bot]
df7bec89f0 Bump typescript from 3.7.4 to 3.7.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.7.4 to 3.7.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.7.4...v3.7.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-19 17:07:03 +02:00
Artur Stolear
b9310160df display logs 2020-01-19 17:07:03 +02:00
Artur Stolear
0dc080dece display logs 2020-01-17 13:16:15 +02:00
Artur Stolear
e15823128e merge json resources 2020-01-16 14:20:59 +02:00
Artur Stolear
43b2de33fa setting the azure pipeline task version 2020-01-15 22:42:44 +02:00
Artur Stolear
ab48b3cddc made the azure pipeline task version 1.0.0 2020-01-15 18:31:08 +02:00
Artur Stolear
3f6597b086 update readme 2020-01-15 18:09:15 +02:00
Artur Stolear
65b3a90f3f remove @zeit/ncc in favor of webpack 2020-01-15 18:05:09 +02:00
Artur Stolear
88007cb218 use actions/checkout@v2 2020-01-15 17:59:19 +02:00
Artur Stolear
036fb8fb1d set version 5.1.2 for now 2020-01-15 17:44:41 +02:00
Artur Stolear
019e954030 move to webpack 2020-01-15 17:41:37 +02:00
Artur Stolear
f09d4de93d moved to core folder the common scripts 2020-01-15 17:41:30 +02:00
James Schafer
af8f283fe6 Remove private repo command from the basic example 2019-12-07 21:34:47 +02:00
James Schafer
8e8806b8a9 Update README.md 2019-12-07 21:34:47 +02:00
James Schafer
28adff5627 Add private repo documentation
Add git credentials to documentation to support private repositories
2019-12-07 21:34:47 +02:00
103 changed files with 278821 additions and 54081 deletions

14
.eslintrc.js Normal file
View 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',
],
};

View File

@@ -8,18 +8,23 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: |
git fetch --tags
git branch --create-reflog master origin/master
git fetch --prune --unshallow
- run: |
npm install
npm run build:github
npm run build:azure
name: Build code
- name: Install GitVersion
uses: ./setup-gitversion
uses: ./gitversion/setup
with:
versionSpec: '5.1.x'
versionSpec: '5.1.2'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: ./execute-gitversion
uses: ./gitversion/execute
- run: |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"

View File

@@ -11,23 +11,33 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: |
git fetch --tags
git branch --create-reflog master origin/master
- name: Install GitVersion
uses: ./setup-gitversion
with:
versionSpec: '5.1.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: ./execute-gitversion
git fetch --prune --unshallow
- run: |
npm install
npm run build:github
npm run build:azure
name: Build code
- name: Install GitVersion
uses: ./gitversion/setup
with:
versionSpec: '5.1.2'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: ./gitversion/execute
- run: |
$date = Get-Date -format "yyMMddHHmm"
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
$override = '{\"version\": \"' + $version + '\"}'
npm run publish-azure -- --token ${{ secrets.TFX_TOKEN }} --override $override
$major = "${{steps.gitversion.outputs.major}}"
$minor = "${{steps.gitversion.outputs.minor}}"
$patch = "${{steps.gitversion.outputs.patch}}"
. .\dist\azure\update-version.ps1
update-manifest .\dist\azure\vss-extension.json -Version $version
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
shell: pwsh
name: Publish Azure extension

54
.vscode/launch.json vendored
View File

@@ -5,40 +5,52 @@
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"preLaunchTask": "tsc: build - src/azure/tsconfig.json",
"name": "Run Azure Pipeline (setup) Task",
"program": "${workspaceFolder}/src/azure/setup.ts",
"outFiles": ["${workspaceFolder}/**/*.js"]
"preLaunchTask": "Build-Mock",
"name": "Debug Mock Setup GitVersion",
"program": "${workspaceFolder}/dist/mock/gitversion/setup/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
{
"type": "node",
"request": "launch",
"preLaunchTask": "tsc: build - src/github/tsconfig.json",
"name": "Run GitHub Actions (setup)",
"program": "${workspaceFolder}/src/github/setup.ts",
"outFiles": ["${workspaceFolder}/**/*.js"]
"preLaunchTask": "Build-Azure",
"name": "Debug Azure Setup GitVersion",
"program": "${workspaceFolder}/dist/azure/gitversion/setup/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
{
"type": "node",
"request": "launch",
"preLaunchTask": "tsc: build - src/azure/tsconfig.json",
"name": "Run Azure Pipeline (execute) Task",
"program": "${workspaceFolder}/src/azure/execute.ts",
"outFiles": ["${workspaceFolder}/**/*.js"]
"preLaunchTask": "Build-GitHub",
"name": "Debug GitHub Setup GitVersion",
"program": "${workspaceFolder}/dist/github/gitversion/setup/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
{
"type": "node",
"request": "launch",
"preLaunchTask": "tsc: build - src/github/tsconfig.json",
"name": "Run GitHub Actions (execute)",
"program": "${workspaceFolder}/src/github/execute.ts",
"outFiles": ["${workspaceFolder}/**/*.js"]
}
"preLaunchTask": "Build-Mock",
"name": "Debug Mock Execute GitVersion",
"program": "${workspaceFolder}/dist/mock/gitversion/execute/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
{
"type": "node",
"request": "launch",
"preLaunchTask": "Build-Azure",
"name": "Debug Azure Execute GitVersion",
"program": "${workspaceFolder}/dist/azure/gitversion/execute/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
{
"type": "node",
"request": "launch",
"preLaunchTask": "Build-GitHub",
"name": "Debug GitHub Execute GitVersion",
"program": "${workspaceFolder}/dist/github/gitversion/execute/bundle.js",
"outFiles": [ "${workspaceFolder}/**/*.js" ]
},
]
}

22
.vscode/tasks.json vendored Normal file
View 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"
},
]
}

View File

@@ -5,10 +5,13 @@
GitHub Actions that allow to install and use the GitVersion and GitReleaseManager tools
[![Build Status](https://github.com/GitTools/actions/workflows/CI/badge.svg)](https://github.com/GitTools/actions/actions)
[![Build Status](https://github.com/GitTools/actions/workflows/release/badge.svg)](https://github.com/GitTools/actions/actions)
## 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
@@ -17,29 +20,26 @@ There are two step dependencies that are required in your workflow before runnin
```yaml
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
run: |
git fetch --tags
git branch --create-reflog master origin/master
uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
```
Basic:
```yaml
steps:
- uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
run: |
git fetch --tags
git branch --create-reflog master origin/master
- name: Checkout
uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/setup-gitversion@v0.3
uses: gittools/actions/gitversion/setup@v0.6.1
with:
versionSpec: '5.1.x'
- name: Use GitVersion
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: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
@@ -71,4 +71,19 @@ Basic:
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
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
```

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +0,0 @@
{
"messages": {
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading": "Downloading: %s",
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"TOOL_LIB_ExtractingArchive": "Extracting archive",
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
}
}

View File

@@ -1,36 +0,0 @@
{
"messages": {
"LIB_UnhandledEx": "Unhandled: %s",
"LIB_FailOnCode": "Failure return code: %d",
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
"LIB_ReturnCode": "Return code: %d",
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired": "%s not supplied",
"LIB_InputRequired": "Input required: %s",
"LIB_InvalidPattern": "Invalid pattern: '%s'",
"LIB_EndpointNotExist": "Endpoint not present: %s",
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
"LIB_PathNotFound": "Not found %s: %s",
"LIB_PathHasNullByte": "Path cannot contain null bytes",
"LIB_OperationFailed": "Failed %s: %s",
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported": "Platform not supported: %s"
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View 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."
}
}

View File

@@ -0,0 +1,60 @@
{
"id": "f5304356-f6e3-48e9-9b65-a9efa41ce7a2",
"name": "gitreleasemanager/close",
"friendlyName": "Close 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/close",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View 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."
}
}

View File

@@ -0,0 +1,95 @@
{
"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",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": false,
"helpMarkDown": "The milestone to use"
}, {
"name": "name",
"type": "string",
"label": "The name of the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "The name of the release"
}, {
"name": "inputFilePath",
"type": "string",
"label": "The path to the file to be used as the content of the release notes",
"defaultValue": "",
"required": false,
"helpMarkDown": "The path to the file to be used as the content of the release notes"
}, {
"name": "pre",
"type": "boolean",
"label": "Creates the release as a pre-release",
"defaultValue": "false",
"required": false,
"helpMarkDown": "Creates the release as a pre-release"
}, {
"name": "targetcommitish",
"type": "string",
"label": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch",
"defaultValue": "",
"required": false,
"helpMarkDown": "The commit to tag. Can be a branch or SHA. Defaults to repository's default branch"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}, {
"name": "assets",
"type": "multiLine",
"label": "Path(s) to the file(s) to include in the release",
"defaultValue": "",
"required": false,
"helpMarkDown": "Path(s) to the file(s) to include in the release. Separated by newline"
}]
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View 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."
}
}

View File

@@ -0,0 +1,60 @@
{
"id": "9ae78b66-6100-4522-8106-b7ae00bbfcdf",
"name": "gitreleasemanager/discard",
"friendlyName": "Discard 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/discard",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
}

18484
dist/azure/gitreleasemanager/open/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View 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."
}
}

View File

@@ -0,0 +1,60 @@
{
"id": "5d437bf5-f193-4449-b531-c4c69eebaa48",
"name": "gitreleasemanager/open",
"friendlyName": "Discard 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/open",
"inputs": [{
"name": "owner",
"type": "string",
"label": "The owner of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The owner of the repository"
}, {
"name": "repository",
"type": "string",
"label": "The name of the repository",
"defaultValue": "",
"required": true,
"helpMarkDown": "The name of the repository"
}, {
"name": "token",
"type": "string",
"label": "The access token to access GitHub with",
"defaultValue": "",
"required": true,
"helpMarkDown": "The access token to access GitHub with"
}, {
"name": "milestone",
"type": "string",
"label": "The milestone to use",
"defaultValue": "",
"required": true,
"helpMarkDown": "The milestone to use"
}, {
"name": "targetDirectory",
"type": "string",
"label": "The directory on which GitReleaseManager should be executed. Defaults to current directory",
"defaultValue": "",
"required": false,
"helpMarkDown": "The directory on which GitReleaseManager should be executed. Defaults to current directory"
}]
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View 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."
}
}

View 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"
}
]
}

18396
dist/azure/gitversion/execute/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

46
dist/azure/gitversion/execute/lib.json vendored Normal file
View 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."
}
}

View File

@@ -1,19 +1,26 @@
{
"id": "9013cf7f-ee8d-49f4-a39b-db244928d391",
"name": "gitversion-execute",
"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",
"author": "GitTools Contributors",
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
"category": "Build",
"demands": [],
"version": {
"Major": "5",
"Major": "1",
"Minor": "0",
"Patch": "2"
"Patch": "0"
},
"minimumAgentVersion": "2.115.0",
"instanceNameFormat": "gitversion-execute",
"execution": {
"Node": {
"target": "bundle.js",
"argumentFormat": "",
"workingDirectory": "."
}
},
"instanceNameFormat": "gitversion/execute",
"groups": [{
"name": "gitversionDetails",
"displayName": "GitVersion details",
@@ -77,13 +84,5 @@
"helpMarkDown": "Additional arguments to send to GitVersion",
"groupName": "additional"
}
],
"execution": {
"Node": {
"target": "index.js",
"argumentFormat": "",
"workingDirectory": "."
}
}
]
}

18396
dist/azure/gitversion/setup/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

46
dist/azure/gitversion/setup/lib.json vendored Normal file
View 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."
}
}

View File

@@ -1,18 +1,26 @@
{
"id": "a06c02ae-7b9a-4082-90dc-fe27b500e54f",
"name": "gitversion-setup",
"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",
"author": "GitTools Contributors",
"helpMarkDown": "See the [documentation](https://gitversion.net/docs/) for help",
"category": "Build",
"demands": [],
"version": {
"Major": "5",
"Major": "1",
"Minor": "0",
"Patch": "2"
"Patch": "0"
},
"minimumAgentVersion": "2.115.0",
"execution": {
"Node": {
"target": "bundle.js",
"argumentFormat": "",
"workingDirectory": "."
}
},
"instanceNameFormat": "gitversion/setup",
"inputs": [{
"name": "versionSpec",
"type": "string",
@@ -29,14 +37,5 @@
"required": false,
"helpMarkDown": "Include pre-release versions when matching a version"
}
],
"instanceNameFormat": "gitversion-setup",
"execution": {
"Node": {
"target": "index.js",
"argumentFormat": "",
"workingDirectory": "."
}
}
]
}

View File

@@ -2,5 +2,5 @@ Versioning when using Git, solved. GitVersion looks at your Git history and work
It works with most branching strategies but has been designed mainly around GitFlow and GitHubFlow (pull request workflow). The calculated version numbers can then be accessed through variables such as `$(GitVersion.NuGetVersion)` and `$(GitVersion.SemVer)`. It is also very configurable to allow it to work with most release workflows!
![Build Task](https://raw.githubusercontent.com/GitTools/GitVersion/master/src/GitVersionVsixTask/images/build-task.png)
![Builds](https://raw.githubusercontent.com/GitTools/GitVersion/master/src/GitVersionVsixTask/images/builds.png)
![Build Task](https://raw.githubusercontent.com/GitTools/actions/master/dist/azure/images/build-task.png)
![Builds](https://raw.githubusercontent.com/GitTools/actions/master/dist/azure/images/builds.png)

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +0,0 @@
{
"messages": {
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_Downloading": "Downloading: %s",
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
"TOOL_LIB_ExtractingArchive": "Extracting archive",
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
}
}

View File

@@ -1,36 +0,0 @@
{
"messages": {
"LIB_UnhandledEx": "Unhandled: %s",
"LIB_FailOnCode": "Failure return code: %d",
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
"LIB_ReturnCode": "Return code: %d",
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
"LIB_ParameterIsRequired": "%s not supplied",
"LIB_InputRequired": "Input required: %s",
"LIB_InvalidPattern": "Invalid pattern: '%s'",
"LIB_EndpointNotExist": "Endpoint not present: %s",
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
"LIB_PathNotFound": "Not found %s: %s",
"LIB_PathHasNullByte": "Path cannot contain null bytes",
"LIB_OperationFailed": "Failed %s: %s",
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
"LIB_PlatformNotSupported": "Platform not supported: %s"
}
}

43
dist/azure/update-version.ps1 vendored Normal file
View File

@@ -0,0 +1,43 @@
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,
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false)]
[System.String]
$patch
)
$file = Resolve-Path $file
$jqMajor = '.version.Major=\"' + $major +'\"';
$jqMinor = '.version.Minor=\"' + $minor +'\"';
$jqPatch = '.version.Patch=\"' + $patch +'\"';
Write-Host "Update task from $file to version $major.$minor.$patch"
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | 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
}

View File

@@ -11,8 +11,13 @@
"id": "Microsoft.VisualStudio.Services"
}],
"files": [
{ "path": "execute-gitversion" },
{ "path": "setup-gitversion" }
{ "path": "gitversion/setup" },
{ "path": "gitversion/execute" },
{ "path": "gitreleasemanager/setup" },
{ "path": "gitreleasemanager/create" },
{ "path": "gitreleasemanager/discard" },
{ "path": "gitreleasemanager/close" },
{ "path": "gitreleasemanager/open" }
],
"categories": [
"Azure Pipelines"
@@ -32,10 +37,10 @@
],
"links": {
"learn": {
"uri": "http://gitversion.readthedocs.org/en/stable"
"uri": "https://github.com/GitTools/actions"
},
"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": {
"uri": "https://github.com/GitTools/actions/blob/master/LICENSE"
@@ -66,7 +71,7 @@
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "setup-gitversion"
"name": "gitversion/setup"
}
}, {
"id": "execute-gitversion-task",
@@ -75,7 +80,52 @@
"ms.vss-distributed-task.tasks"
],
"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"
}
}, {
"id": "discard-gitreleasemanager-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "gitreleasemanager/discard"
}
}, {
"id": "close-gitreleasemanager-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "gitreleasemanager/close"
}
}, {
"id": "open-gitreleasemanager-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "gitreleasemanager/open"
}
}]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

12478
dist/github/gitversion/execute/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

12478
dist/github/gitversion/setup/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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7928
dist/mock/gitreleasemanager/open/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

7840
dist/mock/gitversion/execute/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

7840
dist/mock/gitversion/setup/bundle.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,30 @@
name: gitreleasemanager-close
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Closes a release
author: GitTools
branding:
color: gray-dark
icon: git-pull-request
runs:
using: node12
main: ../../dist/github/gitreleasemanager/close/bundle.js
inputs:
owner:
description: The owner of the repository
required: true
default: ''
repository:
description: The name of the repository
required: true
default: ''
token:
description: The access token to access GitHub with
required: true
default: ''
milestone:
description: The milestone to use
required: true
default: ''
targetDirectory:
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
required: false
default: ''

View File

@@ -0,0 +1,46 @@
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
inputs:
owner:
description: The owner of the repository
required: true
default: ''
repository:
description: The name of the repository
required: true
default: ''
token:
description: The access token to access GitHub with
required: true
default: ''
milestone:
description: The milestone to use
required: false
default: ''
name:
description: The name of the release
required: false
default: ''
inputFilePath:
description: The path to the file to be used as the content of the release notes
required: false
default: ''
pre:
description: Creates the release as a pre-release
required: false
default: 'false'
targetcommitish:
description: The commit to tag. Can be a branch or SHA. Defaults to repository's default branch
required: false
default: ''
targetDirectory:
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
required: false
default: ''

View File

@@ -0,0 +1,30 @@
name: gitreleasemanager-discard
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Discards a release
author: GitTools
branding:
color: gray-dark
icon: git-pull-request
runs:
using: node12
main: ../../dist/github/gitreleasemanager/discard/bundle.js
inputs:
owner:
description: The owner of the repository
required: true
default: ''
repository:
description: The name of the repository
required: true
default: ''
token:
description: The access token to access GitHub with
required: true
default: ''
milestone:
description: The milestone to use
required: true
default: ''
targetDirectory:
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
required: false
default: ''

View File

@@ -0,0 +1,30 @@
name: gitreleasemanager-open
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Opens a release
author: GitTools
branding:
color: gray-dark
icon: git-pull-request
runs:
using: node12
main: ../../dist/github/gitreleasemanager/open/bundle.js
inputs:
owner:
description: The owner of the repository
required: true
default: ''
repository:
description: The name of the repository
required: true
default: ''
token:
description: The access token to access GitHub with
required: true
default: ''
milestone:
description: The milestone to use
required: true
default: ''
targetDirectory:
description: The directory on which GitReleaseManager should be executed. Defaults to current directory
required: false
default: ''

View 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

View File

@@ -4,6 +4,9 @@ author: GitTools
branding:
color: gray-dark
icon: git-pull-request
runs:
using: node12
main: ../../dist/github/gitversion/execute/bundle.js
inputs:
targetPath:
description: Optionally supply the path to the working directory
@@ -89,7 +92,4 @@ outputs:
commitsSinceVersionSourcePadded:
description: 'The CommitsSinceVersionSourcePadded value'
commitDate:
description: 'The CommitDate value'
runs:
using: node12
main: ../dist/github/execute/index.js
description: 'The CommitDate value'

View File

@@ -4,6 +4,9 @@ author: GitTools
branding:
color: gray-dark
icon: git-pull-request
runs:
using: node12
main: ../../dist/github/gitversion/setup/bundle.js
inputs:
versionSpec:
description: Required version in the form of 5.x or exact version like 5.0.0
@@ -12,7 +15,4 @@ inputs:
includePrerelease:
description: Include pre-release versions when matching a version
required: false
default: false
runs:
using: node12
main: ../dist/github/setup/index.js
default: false

4452
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,14 +8,15 @@
},
"main": "main.js",
"scripts": {
"package": "npm run package-github && npm run package-azure",
"package-azure": "npm run package-azure-setup && npm run package-azure-execute",
"package-github": "npm run package-github-setup && npm run package-github-execute",
"package-azure-setup": "ncc build src/azure/setup.ts -o dist/azure/setup",
"package-azure-execute": "ncc build src/azure/execute.ts -o dist/azure/execute",
"package-github-setup": "ncc build src/github/setup.ts -o dist/github/setup",
"package-github-execute": "ncc build src/github/execute.ts -o dist/github/execute",
"publish-azure": "tfx extension publish --root ./dist/azure --no-wait-validation --auth-type pat"
"build:mock": "webpack --config webpack.config.js --env.agent=mock",
"build:azure": "webpack --config webpack.config.js --env.agent=azure",
"build:github": "webpack --config webpack.config.js --env.agent=github",
"build:mock:prod": "npm run build:mock -- --env.mode=production",
"build:azure:prod": "npm run build:azure -- --env.mode=production",
"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",
"contributors": [
@@ -23,23 +24,29 @@
],
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1",
"@actions/tool-cache": "^1.1.2",
"azure-pipelines-task-lib": "2.9.3",
"azure-pipelines-tool-lib": "0.12.0",
"@actions/core": "^1.2.2",
"@actions/exec": "^1.0.3",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^1.3.1",
"azure-pipelines-task-lib": "^2.9.3",
"azure-pipelines-tool-lib": "^0.12.0",
"inversify": "^5.0.1",
"typed-rest-client": "1.5.0",
"uuid": "^3.3.3"
"typed-rest-client": "^1.7.1",
"uuid": "^3.4.0"
},
"devDependencies": {
"@types/node": "12.12.11",
"@types/q": "1.5.2",
"@types/node": "^13.7.0",
"@types/q": "^1.5.2",
"@types/semver-compare": "^1.0.1",
"@types/uuid": "^3.4.7",
"json-update": "^5.3.0",
"reflect-metadata": "^0.1.13",
"tfx-cli": "0.7.11",
"tslint": "^5.20.1",
"typescript": "^3.7.2",
"@zeit/ncc": "^0.20.5"
"replace-in-file-webpack-plugin": "^1.0.6",
"tfx-cli": "^0.7.11",
"ts-loader": "^6.2.1",
"tslint": "^6.0.0",
"typescript": "^3.7.5",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
}
}

View File

@@ -3,11 +3,15 @@ import { injectable } from "inversify";
import * as taskLib from "azure-pipelines-task-lib/task";
import * as toolLib from "azure-pipelines-tool-lib/tool";
import { IBuildAgent, IExecResult } from "../interfaces";
import { IBuildAgent, IExecResult } from "../../core/models";
@injectable()
class BuildAgent implements IBuildAgent {
public get agentName(): string {
return "Azure Pipelines";
}
public find(toolName: string, versionSpec: string, arch?: string): string {
return toolLib.findLocalTool(toolName, versionSpec, arch);
}
@@ -73,19 +77,26 @@ class BuildAgent implements IBuildAgent {
return taskLib.getInput(input, required);
}
public getListInput(input: string, required?: boolean): string[] {
return taskLib
.getInput(input, required)
.split("\n")
.filter(x => x !== "");
}
public getBooleanInput(input: string, required?: boolean): boolean {
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);
}
public fileExists(file: string) {
public fileExists(file: string): boolean {
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();
}
}

View File

@@ -1,6 +1,7 @@
import * as fs from "fs";
import * as path from "path";
import * as uuidV4 from "uuid/v4";
import uuidv4 from "uuid";
import * as core from "@actions/core";
import * as exe from "@actions/exec";
@@ -9,11 +10,15 @@ import * as toolCache from "@actions/tool-cache";
import { injectable } from "inversify";
import { IBuildAgent, IExecResult } from "../interfaces";
import { IBuildAgent, IExecResult } from "../../core/models";
@injectable()
class BuildAgent implements IBuildAgent {
public get agentName(): string {
return "GitHub Actions";
}
public find(toolName: string, versionSpec: string, arch?: string): string {
return toolCache.find(toolName, versionSpec, arch);
}
@@ -41,7 +46,7 @@ class BuildAgent implements IBuildAgent {
}
tempDirectory = path.join(baseLocation, "actions", "temp");
}
const dest = path.join(tempDirectory, uuidV4());
const dest = path.join(tempDirectory, uuidv4());
await io.mkdirP(dest);
return dest;
}
@@ -112,22 +117,33 @@ class BuildAgent implements IBuildAgent {
return core.getInput(input, { required } as core.InputOptions);
}
public getListInput(input: string, required?: boolean): string[] {
return core
.getInput(input, { required } as core.InputOptions)
.split("\n")
.filter(x => x !== "");
}
public getBooleanInput(input: string, required?: boolean): boolean {
const inputValue = this.getInput(input, required);
return (inputValue || "false").toLowerCase() === "true";
}
public isValidInputFile(input: string, file: string) {
const pathValue = path.resolve(this.getInput(input) || "");
public isValidInputFile(input: string, file: string): boolean {
return this.filePathSupplied(input) && this.fileExists(file);
}
public filePathSupplied(file: string): boolean {
const pathValue = path.resolve(this.getInput(file) || "");
const repoRoot = this.getSourceDir();
return pathValue !== repoRoot;
}
public fileExists(file: string) {
public fileExists(file: string): boolean {
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();
}

View File

@@ -0,0 +1,109 @@
import { injectable } from "inversify";
import { IBuildAgent, IExecResult } from "../../core/models";
@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 getListInput(input: string, required?: boolean): string[] {
console.log("getListInput");
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,
};

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
{
"extends": "../tsconfig.json"
}

View File

@@ -1,20 +1,22 @@
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as semver from "semver";
import * as http from "typed-rest-client/HttpClient";
import { inject, injectable } from "inversify";
import { TYPES, IExecResult, IBuildAgent } from "./models";
import { IVersionManager } from "./versionManager";
import { IBuildAgent, IDotnetTool, IExecResult, IGitVersionOptions, IGitVersionTool, IVersionManager } from "./interfaces";
import { TYPES } from "./types";
export interface IDotnetTool {
disableTelemetry(): void;
toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean): Promise<string>;
}
@injectable()
class DotnetTool implements IDotnetTool {
export class DotnetTool implements IDotnetTool {
private buildAgent: IBuildAgent;
private versionManager: IVersionManager;
protected buildAgent: IBuildAgent;
protected versionManager: IVersionManager;
private httpClient: http.HttpClient;
constructor(
@@ -26,8 +28,13 @@ class DotnetTool implements IDotnetTool {
this.httpClient = new http.HttpClient("dotnet");
}
public run(args: string[]): Promise<IExecResult> {
return this.buildAgent.exec("dotnet", args);
public disableTelemetry(): void {
this.buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
}
public execute(cmd: string, args: string[]): Promise<IExecResult> {
console.log(`Command: ${cmd} ${args.join(' ')}`);
return this.buildAgent.exec(cmd, args);
}
public async toolInstall(toolName: string, versionSpec: string, checkLatest: boolean, includePre: boolean)
@@ -109,7 +116,7 @@ class DotnetTool implements IDotnetTool {
const body: string = await res.readBody();
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) {
return null;
}
@@ -129,7 +136,7 @@ class DotnetTool implements IDotnetTool {
args = args.concat(["--version", version]);
}
const result = await this.run(args);
const result = await this.execute("dotnet", args);
const status = result.code === 0 ? "success" : "failure";
const message = result.code === 0 ? result.stdout : result.stderr;
@@ -141,137 +148,4 @@ class DotnetTool implements IDotnetTool {
return await this.buildAgent.cacheDir(tempDirectory, toolName, version);
}
}
@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) {
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;
}
}
const cmp = require("semver-compare");
@injectable()
class VersionManager implements IVersionManager {
private buildAgent: IBuildAgent;
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
) {
this.buildAgent = buildAgent;
}
public isExplicitVersion(versionSpec: string): boolean {
const c = semver.clean(versionSpec);
this.buildAgent.debug("isExplicit: " + c);
const valid = semver.valid(c) != null;
this.buildAgent.debug("explicit? " + valid);
return valid;
}
public evaluateVersions(versions: string[], versionSpec: string): string {
let version: string;
this.buildAgent.debug("evaluating " + versions.length + " versions");
versions = versions.sort(cmp);
for (let i = versions.length - 1; i >= 0; i--) {
const potential: string = versions[i];
const satisfied: boolean = semver.satisfies(potential, versionSpec);
if (satisfied) {
version = potential;
break;
}
}
if (version) {
this.buildAgent.debug("matched: " + version);
} else {
this.buildAgent.debug("match not found");
}
return version;
}
public cleanVersion(version: string): string {
this.buildAgent.debug("cleaning: " + version);
return semver.clean(version);
}
}
export {
DotnetTool,
GitVersionTool,
VersionManager,
};
}

11
src/core/ioc.ts Normal file
View File

@@ -0,0 +1,11 @@
import { Container } from "inversify";
import { IVersionManager, VersionManager } from "./versionManager";
import { TYPES, IBuildAgent } from "./models";
import { BuildAgent } from "../agent/mock/build-agent";
const container = new Container();
container.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
container.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
export default container;

49
src/core/models.ts Normal file
View File

@@ -0,0 +1,49 @@
export const TYPES = {
IBuildAgent: Symbol.for("BuildAgent"),
IDotnetTool: Symbol.for("DotnetTool"),
IGitVersionTool: Symbol.for("GitVersionTool"),
IGitReleaseManagerTool: Symbol.for("GitReleaseManagerTool"),
IVersionManager: Symbol.for("VersionManager"),
};
export enum SetupFields {
includePrerelease = "includePrerelease",
versionSpec = "versionSpec",
};
export interface ISetupSettings {
[SetupFields.versionSpec]: string;
[SetupFields.includePrerelease]: boolean;
}
export interface IExecResult {
stdout: string;
stderr: string;
code: number;
error: Error;
}
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;
getListInput(input: string, required?: boolean): string[];
getBooleanInput(input: string, required?: boolean): boolean;
}

14
src/core/settings.ts Normal file
View File

@@ -0,0 +1,14 @@
import { IBuildAgent, SetupFields, ISetupSettings } from "./models";
export class Settings {
public static getSetupSettings(buildAgent: IBuildAgent): ISetupSettings {
const versionSpec = buildAgent.getInput(SetupFields.versionSpec);
const includePrerelease = buildAgent.getBooleanInput(SetupFields.includePrerelease);
return {
versionSpec,
includePrerelease
}
}
}

View File

@@ -0,0 +1,59 @@
import cmp from "semver-compare";
import * as semver from "semver";
import { injectable, inject } from "inversify";
import { IBuildAgent, TYPES } from "./models";
export interface IVersionManager {
isExplicitVersion(versionSpec: string): boolean;
evaluateVersions(versions: string[], versionSpec: string): string;
cleanVersion(version: string): string;
}
@injectable()
export class VersionManager implements IVersionManager {
private buildAgent: IBuildAgent;
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
) {
this.buildAgent = buildAgent;
}
public isExplicitVersion(versionSpec: string): boolean {
const c = semver.clean(versionSpec);
this.buildAgent.debug("isExplicit: " + c);
const valid = semver.valid(c) != null;
this.buildAgent.debug("explicit? " + valid);
return valid;
}
public evaluateVersions(versions: string[], versionSpec: string): string {
let version: string;
this.buildAgent.debug("evaluating " + versions.length + " versions");
versions = versions.sort(cmp);
for (let i = versions.length - 1; i >= 0; i--) {
const potential: string = versions[i];
const satisfied: boolean = semver.satisfies(potential, versionSpec);
if (satisfied) {
version = potential;
break;
}
}
if (version) {
this.buildAgent.debug("matched: " + version);
} else {
this.buildAgent.debug("match not found");
}
return version;
}
public cleanVersion(version: string): string {
this.buildAgent.debug("cleaning: " + version);
return semver.clean(version);
}
}

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
{
"extends": "../tsconfig.json"
}

View File

@@ -1,91 +0,0 @@
export interface IVersionManager {
isExplicitVersion(versionSpec: string): boolean;
evaluateVersions(versions: string[], versionSpec: string): string;
cleanVersion(version: string): string;
}
export interface IBuildAgent {
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;
}

View File

@@ -1,13 +0,0 @@
import { Container } from "inversify";
import { DotnetTool, GitVersionTool, VersionManager } from "./common";
import { IDotnetTool, IGitVersionTool, IVersionManager } from "./interfaces";
import { TYPES } from "./types";
const ioc = new Container();
ioc.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
ioc.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
ioc.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
export { ioc };

View File

@@ -1,99 +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("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);
}

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { close } from "./main";
close();

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { create } from "./main";
create();

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { discard } from "./main";
discard();

View File

@@ -0,0 +1,86 @@
import { IBuildAgent, TYPES, SetupFields } from "../../core/models";
import { IGitReleaseManagerTool, GitReleaseManagerTool } from "../../tools/gitreleasemanager/tool";
import { Settings as CommonSettings } from "../../core/settings";
import { Settings } from "../../tools/gitreleasemanager/settings";
import container from "../../core/ioc";
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 {
gitReleaseManagerTool.disableTelemetry();
const settings = CommonSettings.getSetupSettings(buildAgent);
await gitReleaseManagerTool.install(settings.versionSpec, settings.includePrerelease);
buildAgent.setSucceeded("GitVersionManager installed successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
export async function create() {
try {
gitReleaseManagerTool.disableTelemetry();
const settings = Settings.getCreateSettings(buildAgent);
await gitReleaseManagerTool.create(settings);
buildAgent.setSucceeded("GitVersionManager created release successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
export async function discard() {
try {
gitReleaseManagerTool.disableTelemetry();
const settings = Settings.getDiscardSettings(buildAgent);
await gitReleaseManagerTool.discard(settings);
buildAgent.setSucceeded("GitVersionManager discarded release successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
export async function close() {
try {
gitReleaseManagerTool.disableTelemetry();
const settings = Settings.getCloseSettings(buildAgent);
await gitReleaseManagerTool.close(settings);
buildAgent.setSucceeded("GitVersionManager closed release successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
export async function open() {
try {
gitReleaseManagerTool.disableTelemetry();
const settings = Settings.getOpenSettings(buildAgent);
await gitReleaseManagerTool.close(settings);
buildAgent.setSucceeded("GitVersionManager opened release successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { open } from "./main";
open();

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { setup } from "./main";
setup();

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { run } from "./main";
run();

View File

@@ -0,0 +1,50 @@
import { IBuildAgent, TYPES, SetupFields } from "../../core/models";
import { Settings as CommonSettings } from "../../core/settings";
import { Settings } from "../../tools/gitversion/settings";
import { IGitVersionTool, GitVersionTool } from "../../tools/gitversion/tool";
import { GitVersionSettings, GitVersionOutput } from "../../tools/gitversion/models";
import container from "../../core/ioc";
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 {
gitVersionTool.disableTelemetry();
const settings = CommonSettings.getSetupSettings(buildAgent);
await gitVersionTool.install(settings.versionSpec, settings.includePrerelease);
buildAgent.setSucceeded("GitVersion installed successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
export async function run() {
try {
gitVersionTool.disableTelemetry();
const settings: GitVersionSettings = Settings.getGitVersionSettings(buildAgent);
const result = await gitVersionTool.run(settings);
const gitversion = JSON.parse(result.stdout) as GitVersionOutput;
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);
}
}

View File

@@ -0,0 +1,4 @@
import "reflect-metadata";
import { setup } from "./main";
setup();

View File

@@ -0,0 +1,55 @@
export enum CommonFields {
repository = "repository",
owner = "owner",
token = "token",
targetDirectory = "targetDirectory",
}
export enum CreateFields {
milestone = "milestone",
releaseName = "releaseName",
inputFileName = "inputFileName",
isPreRelease = "isPreRelease",
commit = "commit",
assets = "assets",
}
export enum DiscardFields {
milestone = "milestone",
}
export enum CloseFields {
milestone = "milestone",
}
export enum OpenFields {
milestone = "milestone",
}
export interface GitReleaseManagerSettings {
[CommonFields.repository]: string;
[CommonFields.owner]: string;
[CommonFields.token]: string;
[CommonFields.targetDirectory]: string;
}
export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettings {
[CreateFields.milestone]: string;
[CreateFields.releaseName]: string;
[CreateFields.inputFileName]: string;
[CreateFields.isPreRelease]: boolean;
[CreateFields.commit]: string;
[CreateFields.assets]?: string[];
}
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
[DiscardFields.milestone]: string;
}
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
[CloseFields.milestone]: string;
}
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
[OpenFields.milestone]: string;
}

View File

@@ -0,0 +1,78 @@
import { IBuildAgent } from "../../core/models";
import {
GitReleaseManagerSettings,
CommonFields, CreateFields, DiscardFields,
CloseFields, OpenFields,
GitReleaseManagerCreateSettings,
GitReleaseManagerDiscardSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerOpenSettings,
} from "./models";
export class Settings {
public static getCreateSettings(buildAgent: IBuildAgent): GitReleaseManagerCreateSettings {
const milestone = buildAgent.getInput(CreateFields.milestone);
const releaseName = buildAgent.getInput(CreateFields.releaseName);
const inputFileName = buildAgent.getInput(CreateFields.inputFileName);
const isPreRelease = buildAgent.getBooleanInput(CreateFields.isPreRelease);
const commit = buildAgent.getInput(CreateFields.commit);
const assets = buildAgent.getListInput(CreateFields.assets);
const commonSettings = Settings.getCommonSettings(buildAgent);
return {
...commonSettings,
milestone,
releaseName,
inputFileName,
isPreRelease,
commit,
assets
}
}
public static getDiscardSettings(buildAgent: IBuildAgent): GitReleaseManagerDiscardSettings {
const milestone = buildAgent.getInput(DiscardFields.milestone);
const commonSettings = Settings.getCommonSettings(buildAgent);
return {
...commonSettings,
milestone,
}
}
public static getCloseSettings(buildAgent: IBuildAgent): GitReleaseManagerCloseSettings {
const milestone = buildAgent.getInput(CloseFields.milestone);
const commonSettings = Settings.getCommonSettings(buildAgent);
return {
...commonSettings,
milestone,
}
}
public static getOpenSettings(buildAgent: IBuildAgent): GitReleaseManagerOpenSettings {
const milestone = buildAgent.getInput(OpenFields.milestone);
const commonSettings = Settings.getCommonSettings(buildAgent);
return {
...commonSettings,
milestone,
}
}
private static getCommonSettings(buildAgent: IBuildAgent): GitReleaseManagerSettings {
const owner = buildAgent.getInput(CommonFields.owner, true);
const repository = buildAgent.getInput(CommonFields.repository, true);
const token = buildAgent.getInput(CommonFields.token, true);
const targetDirectory = buildAgent.getInput(CommonFields.targetDirectory);
return {
owner,
repository,
token,
targetDirectory,
};
}
}

View File

@@ -0,0 +1,154 @@
import path = require("path");
import { TYPES, IBuildAgent, IExecResult } from "../../core/models";
import { injectable, inject } from "inversify";
import { DotnetTool, IDotnetTool } from "../../core/dotnet-tool";
import { IVersionManager } from "../../core/versionManager";
import {
GitReleaseManagerSettings,
GitReleaseManagerCreateSettings,
GitReleaseManagerDiscardSettings,
GitReleaseManagerCloseSettings,
GitReleaseManagerOpenSettings,
} from "./models";
export interface IGitReleaseManagerTool extends IDotnetTool {
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult>;
discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult>;
close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult>;
open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult>;
}
@injectable()
export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseManagerTool {
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@inject(TYPES.IVersionManager) versionManager: IVersionManager
) {
super(buildAgent, versionManager);
}
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
await this.toolInstall("GitReleaseManager.Tool", versionSpec, false, includePrerelease);
}
public create(settings: GitReleaseManagerCreateSettings): Promise<IExecResult> {
const args = this.getCreateArguments(settings);
return this.execute("dotnet-gitreleasemanager", args);
}
public discard(settings: GitReleaseManagerDiscardSettings): Promise<IExecResult> {
const args = this.getDiscardArguments(settings);
return this.execute("dotnet-gitreleasemanager", args);
}
public close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult> {
const args = this.getCloseArguments(settings);
return this.execute("dotnet-gitreleasemanager", args);
}
public open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult> {
const args = this.getCloseArguments(settings);
return this.execute("dotnet-gitreleasemanager", args);
}
getCommonArguments(settings: GitReleaseManagerSettings): string[] {
const args: string[] = [];
args.push("--owner", settings.owner);
args.push("--repository", settings.repository);
args.push("--token", settings.token);
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
args.push("--targetDirectory", settings.targetDirectory);
return args;
}
getDiscardArguments(settings: GitReleaseManagerDiscardSettings): string[] {
const args: string[] = ['discard', ...this.getCommonArguments(settings)];
if (settings.milestone) {
args.push("--milestone", settings.milestone);
}
return args;
}
getCloseArguments(settings: GitReleaseManagerCloseSettings): string[] {
const args: string[] = ['close', ...this.getCommonArguments(settings)];
if (settings.milestone) {
args.push("--milestone", settings.milestone);
}
return args;
}
getOpenArguments(settings: GitReleaseManagerOpenSettings): string[] {
const args: string[] = ['open', ...this.getCommonArguments(settings)];
if (settings.milestone) {
args.push("--milestone", settings.milestone);
}
return args;
}
getCreateArguments(settings: GitReleaseManagerCreateSettings): string[] {
const args: string[] = ['create', ...this.getCommonArguments(settings)];
if (settings.milestone) {
args.push("--milestone", settings.milestone);
}
if (settings.releaseName) {
args.push("--name", settings.releaseName);
}
if (settings.commit) {
args.push("--targetcommitish", settings.commit);
}
if (settings.inputFileName) {
if (this.buildAgent.fileExists(settings.inputFileName)) {
args.push("--inputFilePath", settings.inputFileName);
} else {
throw new Error("GitReleaseManager inputFilePath not found at " + settings.inputFileName);
}
}
if (settings.isPreRelease) {
args.push("--pre");
}
if (settings.assets && settings.assets.length > 0) {
settings.assets = settings.assets.map(asset => {
return path.join(settings.targetDirectory, asset)
})
args.push("--assets", settings.assets.join(","));
}
return 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, "/");
}
}

View File

@@ -0,0 +1,52 @@
export enum ExecuteFields {
targetPath = "targetPath",
useConfigFile = "useConfigFile",
configFilePath = "configFilePath",
updateAssemblyInfo = "updateAssemblyInfo",
updateAssemblyInfoFilename = "updateAssemblyInfoFilename",
additionalArguments = "additionalArguments",
srcDir = "srcDir",
};
export interface GitVersionSettings {
[ExecuteFields.targetPath]: string;
[ExecuteFields.useConfigFile]: boolean;
[ExecuteFields.configFilePath]: string;
[ExecuteFields.updateAssemblyInfo]: boolean;
[ExecuteFields.updateAssemblyInfoFilename]: string;
[ExecuteFields.additionalArguments]: string;
[ExecuteFields.srcDir]: string;
}
export interface GitVersionOutput {
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;
}

View File

@@ -0,0 +1,30 @@
import { IBuildAgent } from "../../core/models";
import { GitVersionSettings, ExecuteFields } from "./models";
export class Settings {
public static getGitVersionSettings(buildAgent: IBuildAgent): GitVersionSettings {
const targetPath = buildAgent.getInput(ExecuteFields.targetPath);
const useConfigFile = buildAgent.getBooleanInput(ExecuteFields.useConfigFile);
const configFilePath = buildAgent.getInput(ExecuteFields.configFilePath);
const updateAssemblyInfo = buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo);
const updateAssemblyInfoFilename = buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename);
const additionalArguments = buildAgent.getInput(ExecuteFields.additionalArguments);
const srcDir = buildAgent.getSourceDir().replace(/\\/g, "/");
return {
targetPath,
useConfigFile,
configFilePath,
updateAssemblyInfo,
updateAssemblyInfoFilename,
additionalArguments,
srcDir,
};
}
}

View File

@@ -0,0 +1,120 @@
import path = require("path");
import { injectable, inject } from "inversify";
import { IExecResult, IBuildAgent, TYPES } from "../../core/models";
import { DotnetTool, IDotnetTool } from "../../core/dotnet-tool";
import { GitVersionSettings, GitVersionOutput, ExecuteFields } from "./models";
import { IVersionManager } from "../../core/versionManager";
export interface IGitVersionTool extends IDotnetTool {
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
run(options: GitVersionSettings): Promise<IExecResult>;
writeGitVersionToAgent(gitversion: GitVersionOutput): void;
}
@injectable()
export class GitVersionTool extends DotnetTool implements IGitVersionTool {
constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@inject(TYPES.IVersionManager) versionManager: IVersionManager
) {
super(buildAgent, versionManager);
}
public async install(versionSpec: string, includePrerelease: boolean): Promise<void> {
await this.toolInstall("GitVersion.Tool", versionSpec, false, includePrerelease);
}
public run(options: GitVersionSettings): Promise<IExecResult> {
const workDir = this.getRepoDir(options.targetPath);
const args = this.getArguments(workDir, options);
return this.execute("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: GitVersionSettings): 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;
}
public writeGitVersionToAgent(gitversion: GitVersionOutput): void {
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);
}
}

Some files were not shown because too many files have changed in this diff Show More