split into setup and execute actions

This commit is contained in:
Artur Stolear
2019-11-22 14:16:41 +02:00
parent e047d1df94
commit cfab55b468
7 changed files with 9856 additions and 44 deletions

25
src/github/setup.ts Normal file
View File

@@ -0,0 +1,25 @@
import "reflect-metadata";
import { IBuildAgent, IGitVersionTool } from "../interfaces";
import { TYPES } from "../types";
import { ioc } from "./ioc";
const gitVersionTool = ioc.get<IGitVersionTool>(TYPES.IGitVersionTool);
const buildAgent = ioc.get<IBuildAgent>(TYPES.IBuildAgent);
export async function run() {
try {
const version = "5.1.2";
const includePrerelease = false;
buildAgent.exportVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
await gitVersionTool.install(version, includePrerelease);
buildAgent.setSucceeded("GitVersion installed successfully", true);
} catch (error) {
buildAgent.setFailed(error.message, true);
}
}
run();