Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dc8ca33d2 | ||
|
|
cf8a2d8310 | ||
|
|
6643846bbb | ||
|
|
a0d003d148 | ||
|
|
571cacf6d9 | ||
|
|
b7fcc8e701 | ||
|
|
3d22c1208a | ||
|
|
4ff3b135ec | ||
|
|
c39eddbc81 |
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -32,10 +32,11 @@ jobs:
|
||||
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
|
||||
$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 }
|
||||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
|
||||
|
||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||
shell: pwsh
|
||||
|
||||
18484
dist/azure/gitreleasemanager/close/bundle.js
vendored
Normal file
18484
dist/azure/gitreleasemanager/close/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/close/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/close/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
46
dist/azure/gitreleasemanager/close/lib.json
vendored
Normal file
46
dist/azure/gitreleasemanager/close/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"messages": {
|
||||
"LIB_UnhandledEx": "Unhandled: %s",
|
||||
"LIB_FailOnCode": "Failure return code: %d",
|
||||
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
|
||||
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
|
||||
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
|
||||
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
|
||||
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
|
||||
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
|
||||
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
|
||||
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
|
||||
"LIB_ReturnCode": "Return code: %d",
|
||||
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
|
||||
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
|
||||
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
|
||||
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
|
||||
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
|
||||
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
|
||||
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
|
||||
"LIB_ParameterIsRequired": "%s not supplied",
|
||||
"LIB_InputRequired": "Input required: %s",
|
||||
"LIB_InvalidPattern": "Invalid pattern: '%s'",
|
||||
"LIB_EndpointNotExist": "Endpoint not present: %s",
|
||||
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
|
||||
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
|
||||
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
|
||||
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
|
||||
"LIB_PathNotFound": "Not found %s: %s",
|
||||
"LIB_PathHasNullByte": "Path cannot contain null bytes",
|
||||
"LIB_OperationFailed": "Failed %s: %s",
|
||||
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
|
||||
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
|
||||
"LIB_PlatformNotSupported": "Platform not supported: %s",
|
||||
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
|
||||
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_Downloading": "Downloading: %s",
|
||||
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
|
||||
"TOOL_LIB_ExtractingArchive": "Extracting archive",
|
||||
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
|
||||
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
|
||||
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
|
||||
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
|
||||
}
|
||||
}
|
||||
60
dist/azure/gitreleasemanager/close/task.json
vendored
Normal file
60
dist/azure/gitreleasemanager/close/task.json
vendored
Normal 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"
|
||||
}]
|
||||
}
|
||||
234
dist/azure/gitreleasemanager/create/bundle.js
vendored
234
dist/azure/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
234
dist/azure/gitreleasemanager/discard/bundle.js
vendored
234
dist/azure/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
18484
dist/azure/gitreleasemanager/open/bundle.js
vendored
Normal file
18484
dist/azure/gitreleasemanager/open/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/gitreleasemanager/open/icon.png
vendored
Normal file
BIN
dist/azure/gitreleasemanager/open/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
46
dist/azure/gitreleasemanager/open/lib.json
vendored
Normal file
46
dist/azure/gitreleasemanager/open/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"messages": {
|
||||
"LIB_UnhandledEx": "Unhandled: %s",
|
||||
"LIB_FailOnCode": "Failure return code: %d",
|
||||
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
|
||||
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
|
||||
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
|
||||
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
|
||||
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
|
||||
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
|
||||
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
|
||||
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
|
||||
"LIB_ReturnCode": "Return code: %d",
|
||||
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
|
||||
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
|
||||
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
|
||||
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
|
||||
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
|
||||
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
|
||||
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
|
||||
"LIB_ParameterIsRequired": "%s not supplied",
|
||||
"LIB_InputRequired": "Input required: %s",
|
||||
"LIB_InvalidPattern": "Invalid pattern: '%s'",
|
||||
"LIB_EndpointNotExist": "Endpoint not present: %s",
|
||||
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
|
||||
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
|
||||
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
|
||||
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
|
||||
"LIB_PathNotFound": "Not found %s: %s",
|
||||
"LIB_PathHasNullByte": "Path cannot contain null bytes",
|
||||
"LIB_OperationFailed": "Failed %s: %s",
|
||||
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
|
||||
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
|
||||
"LIB_PlatformNotSupported": "Platform not supported: %s",
|
||||
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
|
||||
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_Downloading": "Downloading: %s",
|
||||
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
|
||||
"TOOL_LIB_ExtractingArchive": "Extracting archive",
|
||||
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
|
||||
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
|
||||
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
|
||||
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
|
||||
}
|
||||
}
|
||||
60
dist/azure/gitreleasemanager/open/task.json
vendored
Normal file
60
dist/azure/gitreleasemanager/open/task.json
vendored
Normal 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"
|
||||
}]
|
||||
}
|
||||
234
dist/azure/gitreleasemanager/setup/bundle.js
vendored
234
dist/azure/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
147
dist/azure/gitversion/execute/bundle.js
vendored
147
dist/azure/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
147
dist/azure/gitversion/setup/bundle.js
vendored
147
dist/azure/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
11
dist/azure/update-version.ps1
vendored
11
dist/azure/update-version.ps1
vendored
@@ -10,14 +10,19 @@ function update-task() {
|
||||
|
||||
[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false)]
|
||||
[System.String]
|
||||
$minor
|
||||
$minor,
|
||||
|
||||
[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false)]
|
||||
[System.String]
|
||||
$patch
|
||||
)
|
||||
$file = Resolve-Path $file
|
||||
$jqMajor = '.version.Major=\"' + $major +'\"';
|
||||
$jqMinor = '.version.Minor=\"' + $minor +'\"';
|
||||
Write-Host "Update task from $file to version $major.$minor"
|
||||
$jqPatch = '.version.Patch=\"' + $patch +'\"';
|
||||
Write-Host "Update task from $file to version $major.$minor.$patch"
|
||||
|
||||
Get-Content $file | jq $jqMajor | jq $jqMinor | Set-Content $file
|
||||
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
|
||||
}
|
||||
|
||||
function update-manifest() {
|
||||
|
||||
22
dist/azure/vss-extension.json
vendored
22
dist/azure/vss-extension.json
vendored
@@ -15,7 +15,9 @@
|
||||
{ "path": "gitversion/execute" },
|
||||
{ "path": "gitreleasemanager/setup" },
|
||||
{ "path": "gitreleasemanager/create" },
|
||||
{ "path": "gitreleasemanager/discard" }
|
||||
{ "path": "gitreleasemanager/discard" },
|
||||
{ "path": "gitreleasemanager/close" },
|
||||
{ "path": "gitreleasemanager/open" }
|
||||
],
|
||||
"categories": [
|
||||
"Azure Pipelines"
|
||||
@@ -107,5 +109,23 @@
|
||||
"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"
|
||||
}
|
||||
}]
|
||||
}
|
||||
12566
dist/github/gitreleasemanager/close/bundle.js
vendored
Normal file
12566
dist/github/gitreleasemanager/close/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
92
dist/github/gitreleasemanager/create/bundle.js
vendored
92
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
92
dist/github/gitreleasemanager/discard/bundle.js
vendored
92
dist/github/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
12566
dist/github/gitreleasemanager/open/bundle.js
vendored
Normal file
12566
dist/github/gitreleasemanager/open/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
92
dist/github/gitreleasemanager/setup/bundle.js
vendored
92
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
5
dist/github/gitversion/execute/bundle.js
vendored
5
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
5
dist/github/gitversion/setup/bundle.js
vendored
5
dist/github/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
7928
dist/mock/gitreleasemanager/close/bundle.js
vendored
Normal file
7928
dist/mock/gitreleasemanager/close/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89
dist/mock/gitreleasemanager/create/bundle.js
vendored
89
dist/mock/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
89
dist/mock/gitreleasemanager/discard/bundle.js
vendored
89
dist/mock/gitreleasemanager/discard/bundle.js
vendored
File diff suppressed because one or more lines are too long
7928
dist/mock/gitreleasemanager/open/bundle.js
vendored
Normal file
7928
dist/mock/gitreleasemanager/open/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89
dist/mock/gitreleasemanager/setup/bundle.js
vendored
89
dist/mock/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
30
gitreleasemanager/close/action.yml
Normal file
30
gitreleasemanager/close/action.yml
Normal 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: ''
|
||||
30
gitreleasemanager/open/action.yml
Normal file
30
gitreleasemanager/open/action.yml
Normal 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: ''
|
||||
4
src/tasks/gitreleasemanager/close.ts
Normal file
4
src/tasks/gitreleasemanager/close.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import "reflect-metadata";
|
||||
import { close } from "./main";
|
||||
|
||||
close();
|
||||
@@ -53,4 +53,34 @@ export async function discard() {
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
4
src/tasks/gitreleasemanager/open.ts
Normal file
4
src/tasks/gitreleasemanager/open.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import "reflect-metadata";
|
||||
import { open } from "./main";
|
||||
|
||||
open();
|
||||
@@ -2,6 +2,7 @@ export enum CommonFields {
|
||||
repository = "repository",
|
||||
owner = "owner",
|
||||
token = "token",
|
||||
targetDirectory = "targetDirectory",
|
||||
}
|
||||
|
||||
export enum CreateFields {
|
||||
@@ -10,19 +11,26 @@ export enum CreateFields {
|
||||
inputFileName = "inputFileName",
|
||||
isPreRelease = "isPreRelease",
|
||||
commit = "commit",
|
||||
targetDirectory = "targetDirectory",
|
||||
assets = "assets",
|
||||
}
|
||||
|
||||
export enum DiscardFields {
|
||||
milestone = "milestone",
|
||||
targetDirectory = "targetDirectory",
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -31,11 +39,17 @@ export interface GitReleaseManagerCreateSettings extends GitReleaseManagerSettin
|
||||
[CreateFields.inputFileName]: string;
|
||||
[CreateFields.isPreRelease]: boolean;
|
||||
[CreateFields.commit]: string;
|
||||
[CreateFields.targetDirectory]: string;
|
||||
[CreateFields.assets]?: string[];
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerDiscardSettings extends GitReleaseManagerSettings {
|
||||
[DiscardFields.milestone]: string;
|
||||
[DiscardFields.targetDirectory]: string;
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerCloseSettings extends GitReleaseManagerSettings {
|
||||
[CloseFields.milestone]: string;
|
||||
}
|
||||
|
||||
export interface GitReleaseManagerOpenSettings extends GitReleaseManagerSettings {
|
||||
[OpenFields.milestone]: string;
|
||||
}
|
||||
@@ -1,15 +1,23 @@
|
||||
import { IBuildAgent } from "../../core/models";
|
||||
import { GitReleaseManagerSettings, CommonFields, CreateFields, GitReleaseManagerCreateSettings, DiscardFields, GitReleaseManagerDiscardSettings } from "./models";
|
||||
import {
|
||||
GitReleaseManagerSettings,
|
||||
CommonFields, CreateFields, DiscardFields,
|
||||
CloseFields, OpenFields,
|
||||
|
||||
GitReleaseManagerCreateSettings,
|
||||
GitReleaseManagerDiscardSettings,
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerOpenSettings,
|
||||
} from "./models";
|
||||
|
||||
export class Settings {
|
||||
|
||||
public static getCreateSettings(buildAgent: IBuildAgent) : GitReleaseManagerCreateSettings {
|
||||
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 targetDirectory = buildAgent.getInput(CreateFields.targetDirectory);
|
||||
const assets = buildAgent.getListInput(CreateFields.assets);
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
||||
@@ -20,20 +28,37 @@ export class Settings {
|
||||
inputFileName,
|
||||
isPreRelease,
|
||||
commit,
|
||||
targetDirectory,
|
||||
assets
|
||||
}
|
||||
}
|
||||
|
||||
public static getDiscardSettings(buildAgent: IBuildAgent) : GitReleaseManagerDiscardSettings {
|
||||
public static getDiscardSettings(buildAgent: IBuildAgent): GitReleaseManagerDiscardSettings {
|
||||
const milestone = buildAgent.getInput(DiscardFields.milestone);
|
||||
const targetDirectory = buildAgent.getInput(CreateFields.targetDirectory);
|
||||
|
||||
const commonSettings = Settings.getCommonSettings(buildAgent);
|
||||
return {
|
||||
...commonSettings,
|
||||
milestone,
|
||||
targetDirectory,
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +66,13 @@ export class Settings {
|
||||
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
|
||||
token,
|
||||
targetDirectory,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,17 @@ import { IVersionManager } from "../../core/versionManager";
|
||||
import {
|
||||
GitReleaseManagerSettings,
|
||||
GitReleaseManagerCreateSettings,
|
||||
GitReleaseManagerDiscardSettings
|
||||
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()
|
||||
@@ -43,6 +47,18 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
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[] = [];
|
||||
|
||||
@@ -50,6 +66,10 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
args.push("--repository", settings.repository);
|
||||
args.push("--token", settings.token);
|
||||
|
||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
||||
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -59,9 +79,26 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
if (settings.milestone) {
|
||||
args.push("--milestone", settings.milestone);
|
||||
}
|
||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
||||
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
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;
|
||||
}
|
||||
@@ -79,10 +116,6 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
args.push("--targetcommitish", settings.commit);
|
||||
}
|
||||
|
||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
||||
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
|
||||
if (settings.inputFileName) {
|
||||
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
||||
args.push("--inputFilePath", settings.inputFileName);
|
||||
|
||||
@@ -13,6 +13,8 @@ module.exports = (env) => {
|
||||
'gitreleasemanager/setup': path.resolve(__dirname, 'src/tasks/gitreleasemanager/setup.ts'),
|
||||
'gitreleasemanager/create': path.resolve(__dirname, 'src/tasks/gitreleasemanager/create.ts'),
|
||||
'gitreleasemanager/discard': path.resolve(__dirname, 'src/tasks/gitreleasemanager/discard.ts'),
|
||||
'gitreleasemanager/close': path.resolve(__dirname, 'src/tasks/gitreleasemanager/close.ts'),
|
||||
'gitreleasemanager/open': path.resolve(__dirname, 'src/tasks/gitreleasemanager/open.ts'),
|
||||
},
|
||||
target: 'node',
|
||||
mode: mode,
|
||||
@@ -32,6 +34,10 @@ module.exports = (env) => {
|
||||
filename: '[name]/bundle.js',
|
||||
path: path.resolve(__dirname, `dist/${agent}`),
|
||||
},
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/agent\/mock\/build-agent/,
|
||||
@@ -42,16 +48,10 @@ module.exports = (env) => {
|
||||
test: /bundle.js/,
|
||||
rules: [{
|
||||
search: /__webpack_require__\(.*\)\(resourceFile\)/,
|
||||
replace: 'require(resourceFile)'
|
||||
}, {
|
||||
search: /call\(this, \"\/\"\)\)/gi,
|
||||
replace: "call(this, __dirname))"
|
||||
replace: '_loadResJson(resourceFile)'
|
||||
}, {
|
||||
search: /let pkg.*'package.json'\)\);/,
|
||||
replace: ''
|
||||
}, {
|
||||
search: /let userAgent = 'vsts-task-installer\/' \+ pkg.version;/,
|
||||
replace: "let userAgent = 'vsts-task-installer'"
|
||||
replace: 'let pkg = { version: "1.2.3" };'
|
||||
}]
|
||||
}])
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user