Skip to content

Commit

Permalink
added GRM create assets
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Feb 8, 2020
1 parent 274c9b2 commit 0e2e93e
Show file tree
Hide file tree
Showing 19 changed files with 147 additions and 21 deletions.
15 changes: 13 additions & 2 deletions dist/azure/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/azure/gitreleasemanager/create/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,12 @@
"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"
}]
}
15 changes: 13 additions & 2 deletions dist/azure/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/azure/gitversion/execute/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/azure/gitversion/setup/bundle.js

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions dist/github/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions dist/github/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/github/gitversion/execute/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/github/gitversion/setup/bundle.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/mock/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/mock/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/mock/gitversion/execute/bundle.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/mock/gitversion/setup/bundle.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/agent/azure/build-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ 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);
}
Expand Down
7 changes: 7 additions & 0 deletions src/agent/github/build-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ 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";
Expand Down
5 changes: 5 additions & 0 deletions src/agent/mock/build-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class BuildAgent implements IBuildAgent {
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;
Expand Down
1 change: 1 addition & 0 deletions src/core/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ export interface IBuildAgent {

setOutput(name: string, value: string): void;
getInput(input: string, required?: boolean): string;
getListInput(input: string, required?: boolean): string[];
getBooleanInput(input: string, required?: boolean): boolean;
}
3 changes: 3 additions & 0 deletions src/tools/gitreleasemanager/gitreleasemanager-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
if (settings.isPreRelease) {
args.push("--pre");
}
if (settings.assets && settings.assets.length > 0) {
args.push("--assets", settings.assets.join(","));
}

return args;
}
Expand Down
8 changes: 5 additions & 3 deletions src/tools/gitreleasemanager/settings.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { IBuildAgent } from "../../core/models";
import { GitReleaseManagerSettings, CommonFields, CreateFields } from "./models";
import { GitReleaseManagerSettings, CommonFields, CreateFields, GitReleaseManagerCreateSettings } from "./models";

export class Settings {

public static getCreateSettings(buildAgent: IBuildAgent) {
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);
return {
Expand All @@ -19,7 +20,8 @@ export class Settings {
inputFileName,
isPreRelease,
commit,
targetDirectory
targetDirectory,
assets
}
}

Expand Down

0 comments on commit 0e2e93e

Please sign in to comment.