|
|
@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
const core = __importStar(require("@actions/core"));
|
|
|
|
const core = __importStar(require("@actions/core"));
|
|
|
|
const installer = __importStar(require("./installer"));
|
|
|
|
const installer = __importStar(require("./installer"));
|
|
|
|
|
|
|
|
const fs = __importStar(require("fs"));
|
|
|
|
const path = __importStar(require("path"));
|
|
|
|
const path = __importStar(require("path"));
|
|
|
|
function run() {
|
|
|
|
function run() {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
@ -25,7 +26,17 @@ function run() {
|
|
|
|
// Version is optional. If supplied, install / use from the tool cache
|
|
|
|
// Version is optional. If supplied, install / use from the tool cache
|
|
|
|
// If not supplied then task is still used to setup proxy, auth, etc...
|
|
|
|
// If not supplied then task is still used to setup proxy, auth, etc...
|
|
|
|
//
|
|
|
|
//
|
|
|
|
const version = core.getInput('version');
|
|
|
|
let version = core.getInput('version');
|
|
|
|
|
|
|
|
if (!version) {
|
|
|
|
|
|
|
|
// Try to fall back to global.json
|
|
|
|
|
|
|
|
const globalJsonPath = path.join(process.cwd(), 'global.json');
|
|
|
|
|
|
|
|
if (fs.existsSync(globalJsonPath)) {
|
|
|
|
|
|
|
|
const globalJson = JSON.parse(fs.readFileSync(globalJsonPath, { encoding: 'utf8' }));
|
|
|
|
|
|
|
|
if (globalJson.sdk && globalJson.sdk.version) {
|
|
|
|
|
|
|
|
version = globalJson.sdk.version;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (version) {
|
|
|
|
if (version) {
|
|
|
|
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
|
|
|
|
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
|
|
|
|
yield dotnetInstaller.installDotnet();
|
|
|
|
yield dotnetInstaller.installDotnet();
|
|
|
|