added setup for gitreleasemanager
This commit is contained in:
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -35,8 +35,7 @@ jobs:
|
||||
|
||||
. .\dist\azure\update-version.ps1
|
||||
update-manifest .\dist\azure\vss-extension.json -Version $version
|
||||
update-task .\dist\azure\setup-gitversion\task.json -Major $major -Minor $minor
|
||||
update-task .\dist\azure\execute-gitversion\task.json -Major $major -Minor $minor
|
||||
dir .\dist\azure\**\task.json | % { update-task $_ -Major $major -Minor $minor }
|
||||
|
||||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
|
||||
shell: pwsh
|
||||
|
||||
22
dist/azure/execute-gitversion/bundle.js
vendored
22
dist/azure/execute-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
18236
dist/azure/setup-gitreleasemanager/bundle.js
vendored
Normal file
18236
dist/azure/setup-gitreleasemanager/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
dist/azure/setup-gitreleasemanager/icon.png
vendored
Normal file
BIN
dist/azure/setup-gitreleasemanager/icon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
46
dist/azure/setup-gitreleasemanager/lib.json
vendored
Normal file
46
dist/azure/setup-gitreleasemanager/lib.json
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"messages": {
|
||||
"LIB_UnhandledEx": "Unhandled: %s",
|
||||
"LIB_FailOnCode": "Failure return code: %d",
|
||||
"LIB_MkdirFailed": "Unable to create directory '%s'. %s",
|
||||
"LIB_MkdirFailedFileExists": "Unable to create directory '%s'. Conflicting file exists: '%s'",
|
||||
"LIB_MkdirFailedInvalidDriveRoot": "Unable to create directory '%s'. Root directory does not exist: '%s'",
|
||||
"LIB_MkdirFailedInvalidShare": "Unable to create directory '%s'. Unable to verify the directory exists: '%s'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share.",
|
||||
"LIB_MultilineSecret": "Secrets cannot contain multiple lines",
|
||||
"LIB_ProcessError": "There was an error when attempting to execute the process '%s'. This may indicate the process failed to start. Error: %s",
|
||||
"LIB_ProcessExitCode": "The process '%s' failed with exit code %s",
|
||||
"LIB_ProcessStderr": "The process '%s' failed because one or more lines were written to the STDERR stream",
|
||||
"LIB_ReturnCode": "Return code: %d",
|
||||
"LIB_ResourceFileNotExist": "Resource file doesn\\'t exist: %s",
|
||||
"LIB_ResourceFileAlreadySet": "Resource file has already set to: %s",
|
||||
"LIB_ResourceFileNotSet": "Resource file haven\\'t set, can\\'t find loc string for key: %s",
|
||||
"LIB_StdioNotClosed": "The STDIO streams did not close within %s seconds of the exit event from process '%s'. This may indicate a child process inherited the STDIO streams and has not yet exited.",
|
||||
"LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
|
||||
"LIB_WhichNotFound_Win": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.",
|
||||
"LIB_LocStringNotFound": "Can\\'t find loc string for key: %s",
|
||||
"LIB_ParameterIsRequired": "%s not supplied",
|
||||
"LIB_InputRequired": "Input required: %s",
|
||||
"LIB_InvalidPattern": "Invalid pattern: '%s'",
|
||||
"LIB_EndpointNotExist": "Endpoint not present: %s",
|
||||
"LIB_EndpointDataNotExist": "Endpoint data parameter %s not present: %s",
|
||||
"LIB_EndpointAuthNotExist": "Endpoint auth data not present: %s",
|
||||
"LIB_InvalidEndpointAuth": "Invalid endpoint auth: %s",
|
||||
"LIB_InvalidSecureFilesInput": "Invalid secure file input: %s",
|
||||
"LIB_PathNotFound": "Not found %s: %s",
|
||||
"LIB_PathHasNullByte": "Path cannot contain null bytes",
|
||||
"LIB_OperationFailed": "Failed %s: %s",
|
||||
"LIB_UseFirstGlobMatch": "Multiple workspace matches. using first.",
|
||||
"LIB_MergeTestResultNotSupported": "Merging test results from multiple files to one test run is not supported on this version of build agent for OSX/Linux, each test result file will be published as a separate test run in VSO/TFS.",
|
||||
"LIB_PlatformNotSupported": "Platform not supported: %s",
|
||||
"TOOL_LIB_CachingTool": "Caching tool: %s %s %s",
|
||||
"_TOOL_LIB_CachingTool.comment": "This informational log message indicates that a tool, that was just downloaded, is being copied into the cache directory. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_Downloading": "Downloading: %s",
|
||||
"_TOOL_LIB_Downloading.comment": "This information log message indicates that a file is being downloaded. %s represents the URL being downloaded.",
|
||||
"TOOL_LIB_ExtractingArchive": "Extracting archive",
|
||||
"_TOOL_LIB_ExtractingArchive.comment": "This informational log message indicates that an archive file is being extracted. For example, a .zip file, .7z file, or .tar.gz file.",
|
||||
"TOOL_LIB_FoundInCache": "Found tool in cache: %s %s %s",
|
||||
"_TOOL_LIB_FoundInCache.comment": "This informational log message indicates that the request tool is already cached, and does not need to be downloaded again. %s %s %s represent the tool name, version information, and processor architecture.",
|
||||
"TOOL_LIB_PrependPath": "Prepending PATH environment variable with directory: %s",
|
||||
"_TOOL_LIB_PrependPath.comment": "This informational log message indicates that a directory is being prepended to the front of the PATH environment variable. The directories specified by the PATH environment variable are used to resolve the location of command line tools."
|
||||
}
|
||||
}
|
||||
41
dist/azure/setup-gitreleasemanager/task.json
vendored
Normal file
41
dist/azure/setup-gitreleasemanager/task.json
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"id": "e3022448-b00d-4b57-b504-606a0bcf8279",
|
||||
"name": "gitreleasemanager-setup",
|
||||
"friendlyName": "Setup GitReleaseManager Task",
|
||||
"description": "Tool for creating and exporting releases for software applications hosted on GitHub",
|
||||
"author": "GitTools Contributors",
|
||||
"helpMarkDown": "See the [documentation](https://gittools.github.io/GitReleaseManager/docs/) for help",
|
||||
"category": "Build",
|
||||
"demands": [],
|
||||
"version": {
|
||||
"Major": "1",
|
||||
"Minor": "0",
|
||||
"Patch": "0"
|
||||
},
|
||||
"minimumAgentVersion": "2.115.0",
|
||||
"execution": {
|
||||
"Node": {
|
||||
"target": "bundle.js",
|
||||
"argumentFormat": "",
|
||||
"workingDirectory": "."
|
||||
}
|
||||
},
|
||||
"instanceNameFormat": "gitreleasemanager-setup",
|
||||
"inputs": [{
|
||||
"name": "versionSpec",
|
||||
"type": "string",
|
||||
"label": "The version spec",
|
||||
"defaultValue": "",
|
||||
"required": true,
|
||||
"helpMarkDown": "Required version in the form of 0.10.x or exact version like 0.10.2"
|
||||
},
|
||||
{
|
||||
"name": "includePrerelease",
|
||||
"type": "boolean",
|
||||
"label": "Include pre-release versions",
|
||||
"defaultValue": "false",
|
||||
"required": false,
|
||||
"helpMarkDown": "Include pre-release versions when matching a version"
|
||||
}
|
||||
]
|
||||
}
|
||||
22
dist/azure/setup-gitversion/bundle.js
vendored
22
dist/azure/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/azure/vss-extension.json
vendored
16
dist/azure/vss-extension.json
vendored
@@ -11,8 +11,9 @@
|
||||
"id": "Microsoft.VisualStudio.Services"
|
||||
}],
|
||||
"files": [
|
||||
{ "path": "setup-gitversion" },
|
||||
{ "path": "execute-gitversion" },
|
||||
{ "path": "setup-gitversion" }
|
||||
{ "path": "setup-gitreleasemanager" }
|
||||
],
|
||||
"categories": [
|
||||
"Azure Pipelines"
|
||||
@@ -32,10 +33,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"
|
||||
@@ -77,5 +78,14 @@
|
||||
"properties": {
|
||||
"name": "execute-gitversion"
|
||||
}
|
||||
}, {
|
||||
"id": "setup-gitreleasemanager-task",
|
||||
"type": "ms.vss-distributed-task.task",
|
||||
"targets": [
|
||||
"ms.vss-distributed-task.tasks"
|
||||
],
|
||||
"properties": {
|
||||
"name": "setup-gitreleasemanager"
|
||||
}
|
||||
}]
|
||||
}
|
||||
22
dist/github/execute-gitversion/bundle.js
vendored
22
dist/github/execute-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
11933
dist/github/setup-gitreleasemanager/bundle.js
vendored
Normal file
11933
dist/github/setup-gitreleasemanager/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
dist/github/setup-gitversion/bundle.js
vendored
22
dist/github/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
22
dist/mock/execute-gitversion/bundle.js
vendored
22
dist/mock/execute-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
7643
dist/mock/setup-gitreleasemanager/bundle.js
vendored
Normal file
7643
dist/mock/setup-gitreleasemanager/bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
dist/mock/setup-gitversion/bundle.js
vendored
22
dist/mock/setup-gitversion/bundle.js
vendored
File diff suppressed because one or more lines are too long
18
setup-gitreleasemanager/action.yml
Normal file
18
setup-gitreleasemanager/action.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
name: gitreleasemanager-setup
|
||||
description: GitHub Action for creating and exporting releases for software applications hosted on GitHub. Installs the specific version of GitReleaseManager.Tool
|
||||
author: GitTools
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: git-pull-request
|
||||
runs:
|
||||
using: node12
|
||||
main: ../dist/github/setup-gitreleasemanager/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
|
||||
@@ -4,11 +4,20 @@ import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as semver from "semver";
|
||||
import * as http from "typed-rest-client/HttpClient";
|
||||
|
||||
import cmp from "semver-compare";
|
||||
|
||||
import { inject, injectable } from "inversify";
|
||||
|
||||
import { IBuildAgent, IDotnetTool, IExecResult, IGitVersionOptions, IGitVersionTool, IVersionManager } from "./interfaces";
|
||||
import { IBuildAgent,
|
||||
IDotnetTool,
|
||||
IExecResult,
|
||||
IGitReleaseManagerTool,
|
||||
IGitVersionOptions,
|
||||
IGitVersionTool,
|
||||
IVersionManager,
|
||||
} from "./interfaces";
|
||||
|
||||
import { TYPES } from "./types";
|
||||
|
||||
@injectable()
|
||||
@@ -221,6 +230,25 @@ class GitVersionTool implements IGitVersionTool {
|
||||
}
|
||||
}
|
||||
|
||||
@injectable()
|
||||
class GitReleaseManagerTool implements IGitReleaseManagerTool {
|
||||
|
||||
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("GitReleaseManager.Tool", versionSpec, false, includePrerelease);
|
||||
}
|
||||
}
|
||||
|
||||
@injectable()
|
||||
class VersionManager implements IVersionManager {
|
||||
|
||||
@@ -271,6 +299,7 @@ class VersionManager implements IVersionManager {
|
||||
|
||||
export {
|
||||
DotnetTool,
|
||||
GitReleaseManagerTool,
|
||||
GitVersionTool,
|
||||
VersionManager,
|
||||
};
|
||||
|
||||
22
src/core/gitreleasemanager.ts
Normal file
22
src/core/gitreleasemanager.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { IBuildAgent, IGitReleaseManagerTool } from "./interfaces";
|
||||
import { ioc } from "./ioc";
|
||||
import { SetupOptions, TYPES } from "./types";
|
||||
|
||||
const gitReleaseManagerTool = ioc.get<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool);
|
||||
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
|
||||
|
||||
export async function setup() {
|
||||
try {
|
||||
|
||||
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
|
||||
|
||||
const versionSpec = buildAgent.getInput(SetupOptions.versionSpec);
|
||||
const includePrerelease = buildAgent.getBooleanInput(SetupOptions.includePrerelease);
|
||||
|
||||
await gitReleaseManagerTool.install(versionSpec, includePrerelease);
|
||||
|
||||
buildAgent.setSucceeded("GitVersionManager installed successfully", true);
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,10 @@ export interface IGitVersionTool {
|
||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||
run(options: IGitVersionOptions): Promise<IExecResult>;
|
||||
}
|
||||
|
||||
export interface IGitReleaseManagerTool {
|
||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||
}
|
||||
export interface IExecResult {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Container } from "inversify";
|
||||
|
||||
import { BuildAgent } from "../agent/mock/build-agent";
|
||||
import { DotnetTool, GitVersionTool, VersionManager } from "./common";
|
||||
import { IBuildAgent, IDotnetTool, IGitVersionTool, IVersionManager } from "./interfaces";
|
||||
import { DotnetTool, GitReleaseManagerTool, GitVersionTool, VersionManager } from "./common";
|
||||
import { IBuildAgent, IDotnetTool, IGitReleaseManagerTool, IGitVersionTool, IVersionManager } from "./interfaces";
|
||||
import { TYPES } from "./types";
|
||||
|
||||
const ioc = new Container();
|
||||
@@ -11,5 +11,6 @@ ioc.bind<IVersionManager>(TYPES.IVersionManager).to(VersionManager);
|
||||
ioc.bind<IBuildAgent>(TYPES.IBuildAgent).to(BuildAgent);
|
||||
ioc.bind<IDotnetTool>(TYPES.IDotnetTool).to(DotnetTool);
|
||||
ioc.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
||||
ioc.bind<IGitReleaseManagerTool>(TYPES.IGitReleaseManagerTool).to(GitReleaseManagerTool);
|
||||
|
||||
export { ioc };
|
||||
|
||||
@@ -2,6 +2,7 @@ const TYPES = {
|
||||
IBuildAgent: Symbol.for("BuildAgent"),
|
||||
IDotnetTool: Symbol.for("DotnetTool"),
|
||||
IGitVersionTool: Symbol.for("GitVersionTool"),
|
||||
IGitReleaseManagerTool: Symbol.for("GitReleaseManagerTool"),
|
||||
IVersionManager: Symbol.for("VersionManager"),
|
||||
};
|
||||
|
||||
|
||||
4
src/setup-gitreleasemanager.ts
Normal file
4
src/setup-gitreleasemanager.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import "reflect-metadata";
|
||||
import { setup } from "./core/gitreleasemanager";
|
||||
|
||||
setup();
|
||||
@@ -9,6 +9,7 @@ module.exports = (env) => {
|
||||
return {
|
||||
entry: {
|
||||
'setup-gitversion': path.resolve(__dirname, 'src/setup-gitversion.ts'),
|
||||
'setup-gitreleasemanager': path.resolve(__dirname, 'src/setup-gitreleasemanager.ts'),
|
||||
'execute-gitversion': path.resolve(__dirname, 'src/execute-gitversion.ts'),
|
||||
},
|
||||
target: 'node',
|
||||
|
||||
Reference in New Issue
Block a user