You've already forked setup-dotnet
mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-01 03:07:31 +07:00
check failure fix
This commit is contained in:
105
dist/cache-save/index.js
vendored
105
dist/cache-save/index.js
vendored
@ -86644,27 +86644,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.run = void 0;
|
exports.run = run;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
const node_fs_1 = __importDefault(__nccwpck_require__(7561));
|
const node_fs_1 = __importDefault(__nccwpck_require__(7561));
|
||||||
@ -86677,27 +86678,24 @@ process.on('uncaughtException', e => {
|
|||||||
const warningPrefix = '[warning]';
|
const warningPrefix = '[warning]';
|
||||||
core.info(`${warningPrefix}${e.message}`);
|
core.info(`${warningPrefix}${e.message}`);
|
||||||
});
|
});
|
||||||
function run() {
|
async function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
try {
|
||||||
try {
|
if (core.getBooleanInput('cache')) {
|
||||||
if (core.getBooleanInput('cache')) {
|
await cachePackages();
|
||||||
yield cachePackages();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
}
|
||||||
core.setFailed(error.message);
|
catch (error) {
|
||||||
}
|
core.setFailed(error.message);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
exports.run = run;
|
const cachePackages = async () => {
|
||||||
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
||||||
const state = core.getState(constants_1.State.CacheMatchedKey);
|
const state = core.getState(constants_1.State.CacheMatchedKey);
|
||||||
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
||||||
if (!primaryKey) {
|
if (!primaryKey) {
|
||||||
core.info('Primary key was not generated, not saving cache.');
|
core.info('Primary key was not generated, not saving cache.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { 'global-packages': cachePath } = yield (0, cache_utils_1.getNuGetFolderPath)();
|
const { 'global-packages': cachePath } = await (0, cache_utils_1.getNuGetFolderPath)();
|
||||||
if (!node_fs_1.default.existsSync(cachePath)) {
|
if (!node_fs_1.default.existsSync(cachePath)) {
|
||||||
throw new Error(`Cache folder path is retrieved for .NET CLI but doesn't exist on disk: ${cachePath}`);
|
throw new Error(`Cache folder path is retrieved for .NET CLI but doesn't exist on disk: ${cachePath}`);
|
||||||
}
|
}
|
||||||
@ -86705,12 +86703,12 @@ const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
|
|||||||
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cacheId = yield cache.saveCache([cachePath], primaryKey);
|
const cacheId = await cache.saveCache([cachePath], primaryKey);
|
||||||
if (cacheId == -1) {
|
if (cacheId == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.info(`Cache saved with the key: ${primaryKey}`);
|
core.info(`Cache saved with the key: ${primaryKey}`);
|
||||||
});
|
};
|
||||||
run();
|
run();
|
||||||
|
|
||||||
|
|
||||||
@ -86737,24 +86735,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.isCacheFeatureAvailable = exports.getNuGetFolderPath = void 0;
|
exports.getNuGetFolderPath = void 0;
|
||||||
|
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const exec = __importStar(__nccwpck_require__(1514));
|
const exec = __importStar(__nccwpck_require__(1514));
|
||||||
@ -86784,8 +86784,8 @@ const constants_1 = __nccwpck_require__(9042);
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* () {
|
const getNuGetFolderPath = async () => {
|
||||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
|
const { stdout, stderr, exitCode } = await exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
throw new Error(!stderr.trim()
|
throw new Error(!stderr.trim()
|
||||||
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
|
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
|
||||||
@ -86806,7 +86806,7 @@ const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
};
|
||||||
exports.getNuGetFolderPath = getNuGetFolderPath;
|
exports.getNuGetFolderPath = getNuGetFolderPath;
|
||||||
function isCacheFeatureAvailable() {
|
function isCacheFeatureAvailable() {
|
||||||
if (cache.isFeatureAvailable()) {
|
if (cache.isFeatureAvailable()) {
|
||||||
@ -86819,7 +86819,6 @@ function isCacheFeatureAvailable() {
|
|||||||
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
|
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
|
||||||
/**
|
/**
|
||||||
* Returns this action runs on GitHub Enterprise Server or not.
|
* Returns this action runs on GitHub Enterprise Server or not.
|
||||||
*/
|
*/
|
||||||
|
528
dist/setup/index.js
vendored
528
dist/setup/index.js
vendored
@ -98959,15 +98959,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
|
return ownKeys(o);
|
||||||
|
};
|
||||||
|
return function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.configAuthentication = void 0;
|
exports.configAuthentication = configAuthentication;
|
||||||
const fs = __importStar(__nccwpck_require__(7147));
|
const fs = __importStar(__nccwpck_require__(7147));
|
||||||
const path = __importStar(__nccwpck_require__(1017));
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
@ -98980,7 +98990,6 @@ function configAuthentication(feedUrl, existingFileLocation = '', processRoot =
|
|||||||
const tempNuGetConfig = path.resolve(processRoot, '../', 'nuget.config');
|
const tempNuGetConfig = path.resolve(processRoot, '../', 'nuget.config');
|
||||||
writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig);
|
writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig);
|
||||||
}
|
}
|
||||||
exports.configAuthentication = configAuthentication;
|
|
||||||
function isValidKey(key) {
|
function isValidKey(key) {
|
||||||
return /^[\w\-.]+$/i.test(key);
|
return /^[\w\-.]+$/i.test(key);
|
||||||
}
|
}
|
||||||
@ -98995,7 +99004,6 @@ function getExistingNugetConfig(processRoot) {
|
|||||||
return defaultConfigName;
|
return defaultConfigName;
|
||||||
}
|
}
|
||||||
function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
||||||
var _a, _b;
|
|
||||||
core.info(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`);
|
core.info(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`);
|
||||||
const sourceKeys = [];
|
const sourceKeys = [];
|
||||||
let owner = core.getInput('owner');
|
let owner = core.getInput('owner');
|
||||||
@ -99017,7 +99025,7 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
|
|||||||
if (typeof json.configuration === 'undefined') {
|
if (typeof json.configuration === 'undefined') {
|
||||||
throw new Error(`The provided NuGet.config seems invalid.`);
|
throw new Error(`The provided NuGet.config seems invalid.`);
|
||||||
}
|
}
|
||||||
if ((_b = (_a = json.configuration) === null || _a === void 0 ? void 0 : _a.packageSources) === null || _b === void 0 ? void 0 : _b.add) {
|
if (json.configuration?.packageSources?.add) {
|
||||||
const packageSources = json.configuration.packageSources.add;
|
const packageSources = json.configuration.packageSources.add;
|
||||||
if (Array.isArray(packageSources)) {
|
if (Array.isArray(packageSources)) {
|
||||||
packageSources.forEach(source => {
|
packageSources.forEach(source => {
|
||||||
@ -99147,22 +99155,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.restoreCache = void 0;
|
exports.restoreCache = void 0;
|
||||||
const promises_1 = __nccwpck_require__(3977);
|
const promises_1 = __nccwpck_require__(3977);
|
||||||
@ -99172,9 +99181,9 @@ const core = __importStar(__nccwpck_require__(2186));
|
|||||||
const glob = __importStar(__nccwpck_require__(8090));
|
const glob = __importStar(__nccwpck_require__(8090));
|
||||||
const cache_utils_1 = __nccwpck_require__(1678);
|
const cache_utils_1 = __nccwpck_require__(1678);
|
||||||
const constants_1 = __nccwpck_require__(9042);
|
const constants_1 = __nccwpck_require__(9042);
|
||||||
const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const restoreCache = async (cacheDependencyPath) => {
|
||||||
const lockFilePath = cacheDependencyPath || (yield findLockFile());
|
const lockFilePath = cacheDependencyPath || (await findLockFile());
|
||||||
const fileHash = yield glob.hashFiles(lockFilePath);
|
const fileHash = await glob.hashFiles(lockFilePath);
|
||||||
if (!fileHash) {
|
if (!fileHash) {
|
||||||
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
|
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
|
||||||
}
|
}
|
||||||
@ -99182,8 +99191,8 @@ const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0,
|
|||||||
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
|
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
|
||||||
core.debug(`primary key is ${primaryKey}`);
|
core.debug(`primary key is ${primaryKey}`);
|
||||||
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
|
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
|
||||||
const { 'global-packages': cachePath } = yield (0, cache_utils_1.getNuGetFolderPath)();
|
const { 'global-packages': cachePath } = await (0, cache_utils_1.getNuGetFolderPath)();
|
||||||
const cacheKey = yield cache.restoreCache([cachePath], primaryKey);
|
const cacheKey = await cache.restoreCache([cachePath], primaryKey);
|
||||||
core.setOutput(constants_1.Outputs.CacheHit, Boolean(cacheKey));
|
core.setOutput(constants_1.Outputs.CacheHit, Boolean(cacheKey));
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
core.info('Dotnet cache is not found');
|
core.info('Dotnet cache is not found');
|
||||||
@ -99191,17 +99200,17 @@ const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0,
|
|||||||
}
|
}
|
||||||
core.saveState(constants_1.State.CacheMatchedKey, cacheKey);
|
core.saveState(constants_1.State.CacheMatchedKey, cacheKey);
|
||||||
core.info(`Cache restored from key: ${cacheKey}`);
|
core.info(`Cache restored from key: ${cacheKey}`);
|
||||||
});
|
};
|
||||||
exports.restoreCache = restoreCache;
|
exports.restoreCache = restoreCache;
|
||||||
const findLockFile = () => __awaiter(void 0, void 0, void 0, function* () {
|
const findLockFile = async () => {
|
||||||
const workspace = process.env.GITHUB_WORKSPACE;
|
const workspace = process.env.GITHUB_WORKSPACE;
|
||||||
const rootContent = yield (0, promises_1.readdir)(workspace);
|
const rootContent = await (0, promises_1.readdir)(workspace);
|
||||||
const lockFile = constants_1.lockFilePatterns.find(item => rootContent.includes(item));
|
const lockFile = constants_1.lockFilePatterns.find(item => rootContent.includes(item));
|
||||||
if (!lockFile) {
|
if (!lockFile) {
|
||||||
throw new Error(`Dependencies lock file is not found in ${workspace}. Supported file patterns: ${constants_1.lockFilePatterns.toString()}`);
|
throw new Error(`Dependencies lock file is not found in ${workspace}. Supported file patterns: ${constants_1.lockFilePatterns.toString()}`);
|
||||||
}
|
}
|
||||||
return (0, node_path_1.join)(workspace, lockFile);
|
return (0, node_path_1.join)(workspace, lockFile);
|
||||||
});
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@ -99227,24 +99236,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.isCacheFeatureAvailable = exports.getNuGetFolderPath = void 0;
|
exports.getNuGetFolderPath = void 0;
|
||||||
|
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
||||||
const cache = __importStar(__nccwpck_require__(7799));
|
const cache = __importStar(__nccwpck_require__(7799));
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const exec = __importStar(__nccwpck_require__(1514));
|
const exec = __importStar(__nccwpck_require__(1514));
|
||||||
@ -99274,8 +99285,8 @@ const constants_1 = __nccwpck_require__(9042);
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* () {
|
const getNuGetFolderPath = async () => {
|
||||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
|
const { stdout, stderr, exitCode } = await exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
throw new Error(!stderr.trim()
|
throw new Error(!stderr.trim()
|
||||||
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
|
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
|
||||||
@ -99296,7 +99307,7 @@ const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
});
|
};
|
||||||
exports.getNuGetFolderPath = getNuGetFolderPath;
|
exports.getNuGetFolderPath = getNuGetFolderPath;
|
||||||
function isCacheFeatureAvailable() {
|
function isCacheFeatureAvailable() {
|
||||||
if (cache.isFeatureAvailable()) {
|
if (cache.isFeatureAvailable()) {
|
||||||
@ -99309,7 +99320,6 @@ function isCacheFeatureAvailable() {
|
|||||||
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
|
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
|
||||||
/**
|
/**
|
||||||
* Returns this action runs on GitHub Enterprise Server or not.
|
* Returns this action runs on GitHub Enterprise Server or not.
|
||||||
*/
|
*/
|
||||||
@ -99374,22 +99384,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -99412,25 +99423,22 @@ class DotnetVersionResolver {
|
|||||||
this.inputVersion = version.trim();
|
this.inputVersion = version.trim();
|
||||||
this.resolvedArgument = { type: '', value: '', qualityFlag: false };
|
this.resolvedArgument = { type: '', value: '', qualityFlag: false };
|
||||||
}
|
}
|
||||||
resolveVersionInput() {
|
async resolveVersionInput() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
if (!semver_1.default.validRange(this.inputVersion) && !this.isLatestPatchSyntax()) {
|
||||||
if (!semver_1.default.validRange(this.inputVersion) && !this.isLatestPatchSyntax()) {
|
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x, A.B.Cxx`);
|
||||||
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x, A.B.Cxx`);
|
}
|
||||||
}
|
if (semver_1.default.valid(this.inputVersion)) {
|
||||||
if (semver_1.default.valid(this.inputVersion)) {
|
this.createVersionArgument();
|
||||||
this.createVersionArgument();
|
}
|
||||||
}
|
else {
|
||||||
else {
|
await this.createChannelArgument();
|
||||||
yield this.createChannelArgument();
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
isNumericTag(versionTag) {
|
isNumericTag(versionTag) {
|
||||||
return /^\d+$/.test(versionTag);
|
return /^\d+$/.test(versionTag);
|
||||||
}
|
}
|
||||||
isLatestPatchSyntax() {
|
isLatestPatchSyntax() {
|
||||||
var _a, _b;
|
const majorTag = this.inputVersion.match(/^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/)?.groups?.majorTag;
|
||||||
const majorTag = (_b = (_a = this.inputVersion.match(/^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.majorTag;
|
|
||||||
if (majorTag &&
|
if (majorTag &&
|
||||||
parseInt(majorTag) < LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG) {
|
parseInt(majorTag) < LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG) {
|
||||||
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! The A.B.Cxx syntax is available since the .NET 5.0 release.`);
|
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! The A.B.Cxx syntax is available since the .NET 5.0 release.`);
|
||||||
@ -99441,62 +99449,56 @@ class DotnetVersionResolver {
|
|||||||
this.resolvedArgument.type = 'version';
|
this.resolvedArgument.type = 'version';
|
||||||
this.resolvedArgument.value = this.inputVersion;
|
this.resolvedArgument.value = this.inputVersion;
|
||||||
}
|
}
|
||||||
createChannelArgument() {
|
async createChannelArgument() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
this.resolvedArgument.type = 'channel';
|
||||||
this.resolvedArgument.type = 'channel';
|
const [major, minor] = this.inputVersion.split('.');
|
||||||
const [major, minor] = this.inputVersion.split('.');
|
if (this.isLatestPatchSyntax()) {
|
||||||
if (this.isLatestPatchSyntax()) {
|
this.resolvedArgument.value = this.inputVersion;
|
||||||
this.resolvedArgument.value = this.inputVersion;
|
}
|
||||||
}
|
else if (this.isNumericTag(major) && this.isNumericTag(minor)) {
|
||||||
else if (this.isNumericTag(major) && this.isNumericTag(minor)) {
|
this.resolvedArgument.value = `${major}.${minor}`;
|
||||||
this.resolvedArgument.value = `${major}.${minor}`;
|
}
|
||||||
}
|
else if (this.isNumericTag(major)) {
|
||||||
else if (this.isNumericTag(major)) {
|
this.resolvedArgument.value = await this.getLatestByMajorTag(major);
|
||||||
this.resolvedArgument.value = yield this.getLatestByMajorTag(major);
|
}
|
||||||
}
|
else {
|
||||||
else {
|
// If "dotnet-version" is specified as *, x or X resolve latest version of .NET explicitly from LTS channel. The version argument will default to "latest" by install-dotnet script.
|
||||||
// If "dotnet-version" is specified as *, x or X resolve latest version of .NET explicitly from LTS channel. The version argument will default to "latest" by install-dotnet script.
|
this.resolvedArgument.value = 'LTS';
|
||||||
this.resolvedArgument.value = 'LTS';
|
}
|
||||||
}
|
this.resolvedArgument.qualityFlag =
|
||||||
this.resolvedArgument.qualityFlag =
|
parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false;
|
||||||
parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
createDotnetVersion() {
|
async createDotnetVersion() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
await this.resolveVersionInput();
|
||||||
yield this.resolveVersionInput();
|
if (!this.resolvedArgument.type) {
|
||||||
if (!this.resolvedArgument.type) {
|
|
||||||
return this.resolvedArgument;
|
|
||||||
}
|
|
||||||
if (utils_1.IS_WINDOWS) {
|
|
||||||
this.resolvedArgument.type =
|
|
||||||
this.resolvedArgument.type === 'channel' ? '-Channel' : '-Version';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.resolvedArgument.type =
|
|
||||||
this.resolvedArgument.type === 'channel' ? '--channel' : '--version';
|
|
||||||
}
|
|
||||||
return this.resolvedArgument;
|
return this.resolvedArgument;
|
||||||
});
|
}
|
||||||
|
if (utils_1.IS_WINDOWS) {
|
||||||
|
this.resolvedArgument.type =
|
||||||
|
this.resolvedArgument.type === 'channel' ? '-Channel' : '-Version';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.resolvedArgument.type =
|
||||||
|
this.resolvedArgument.type === 'channel' ? '--channel' : '--version';
|
||||||
|
}
|
||||||
|
return this.resolvedArgument;
|
||||||
}
|
}
|
||||||
getLatestByMajorTag(majorTag) {
|
async getLatestByMajorTag(majorTag) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const httpClient = new hc.HttpClient('actions/setup-dotnet', [], {
|
||||||
const httpClient = new hc.HttpClient('actions/setup-dotnet', [], {
|
allowRetries: true,
|
||||||
allowRetries: true,
|
maxRetries: 3
|
||||||
maxRetries: 3
|
|
||||||
});
|
|
||||||
const response = yield httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl);
|
|
||||||
const result = response.result || {};
|
|
||||||
const releasesInfo = result['releases-index'];
|
|
||||||
const releaseInfo = releasesInfo.find(info => {
|
|
||||||
const sdkParts = info['channel-version'].split('.');
|
|
||||||
return sdkParts[0] === majorTag;
|
|
||||||
});
|
|
||||||
if (!releaseInfo) {
|
|
||||||
throw new Error(`Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotnetCoreIndexUrl}`);
|
|
||||||
}
|
|
||||||
return releaseInfo['channel-version'];
|
|
||||||
});
|
});
|
||||||
|
const response = await httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl);
|
||||||
|
const result = response.result || {};
|
||||||
|
const releasesInfo = result['releases-index'];
|
||||||
|
const releaseInfo = releasesInfo.find(info => {
|
||||||
|
const sdkParts = info['channel-version'].split('.');
|
||||||
|
return sdkParts[0] === majorTag;
|
||||||
|
});
|
||||||
|
if (!releaseInfo) {
|
||||||
|
throw new Error(`Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotnetCoreIndexUrl}`);
|
||||||
|
}
|
||||||
|
return releaseInfo['channel-version'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DotnetVersionResolver = DotnetVersionResolver;
|
exports.DotnetVersionResolver = DotnetVersionResolver;
|
||||||
@ -99536,13 +99538,11 @@ class DotnetInstallScript {
|
|||||||
setupScriptBash() {
|
setupScriptBash() {
|
||||||
(0, fs_1.chmodSync)(this.escapedScript, '777');
|
(0, fs_1.chmodSync)(this.escapedScript, '777');
|
||||||
}
|
}
|
||||||
getScriptPath() {
|
async getScriptPath() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
if (utils_1.IS_WINDOWS) {
|
||||||
if (utils_1.IS_WINDOWS) {
|
return (await io.which('pwsh', false)) || io.which('powershell', true);
|
||||||
return (yield io.which('pwsh', false)) || io.which('powershell', true);
|
}
|
||||||
}
|
return io.which(this.escapedScript, true);
|
||||||
return io.which(this.escapedScript, true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
useArguments(...args) {
|
useArguments(...args) {
|
||||||
this.scriptArguments.push(...args);
|
this.scriptArguments.push(...args);
|
||||||
@ -99561,14 +99561,12 @@ class DotnetInstallScript {
|
|||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
execute() {
|
async execute() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const getExecOutputOptions = {
|
||||||
const getExecOutputOptions = {
|
ignoreReturnCode: true,
|
||||||
ignoreReturnCode: true,
|
env: process.env
|
||||||
env: process.env
|
};
|
||||||
};
|
return exec.getExecOutput(`"${await this.getScriptPath()}"`, this.scriptArguments, getExecOutputOptions);
|
||||||
return exec.getExecOutput(`"${yield this.getScriptPath()}"`, this.scriptArguments, getExecOutputOptions);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DotnetInstallScript = DotnetInstallScript;
|
exports.DotnetInstallScript = DotnetInstallScript;
|
||||||
@ -99603,44 +99601,42 @@ class DotnetCoreInstaller {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
this.quality = quality;
|
this.quality = quality;
|
||||||
}
|
}
|
||||||
installDotnet() {
|
async installDotnet() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const versionResolver = new DotnetVersionResolver(this.version);
|
||||||
const versionResolver = new DotnetVersionResolver(this.version);
|
const dotnetVersion = await versionResolver.createDotnetVersion();
|
||||||
const dotnetVersion = yield versionResolver.createDotnetVersion();
|
/**
|
||||||
|
* Install dotnet runitme first in order to get
|
||||||
|
* the latest stable version of dotnet CLI
|
||||||
|
*/
|
||||||
|
const runtimeInstallOutput = await new DotnetInstallScript()
|
||||||
|
// If dotnet CLI is already installed - avoid overwriting it
|
||||||
|
.useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files')
|
||||||
|
// Install only runtime + CLI
|
||||||
|
.useArguments(utils_1.IS_WINDOWS ? '-Runtime' : '--runtime', 'dotnet')
|
||||||
|
// Use latest stable version
|
||||||
|
.useArguments(utils_1.IS_WINDOWS ? '-Channel' : '--channel', 'LTS')
|
||||||
|
.execute();
|
||||||
|
if (runtimeInstallOutput.exitCode) {
|
||||||
/**
|
/**
|
||||||
* Install dotnet runitme first in order to get
|
* dotnetInstallScript will install CLI and runtime even if previous script haven't succeded,
|
||||||
* the latest stable version of dotnet CLI
|
* so at this point it's too early to throw an error
|
||||||
*/
|
*/
|
||||||
const runtimeInstallOutput = yield new DotnetInstallScript()
|
core.warning(`Failed to install dotnet runtime + cli, exit code: ${runtimeInstallOutput.exitCode}. ${runtimeInstallOutput.stderr}`);
|
||||||
// If dotnet CLI is already installed - avoid overwriting it
|
}
|
||||||
.useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files')
|
/**
|
||||||
// Install only runtime + CLI
|
* Install dotnet over the latest version of
|
||||||
.useArguments(utils_1.IS_WINDOWS ? '-Runtime' : '--runtime', 'dotnet')
|
* dotnet CLI
|
||||||
// Use latest stable version
|
*/
|
||||||
.useArguments(utils_1.IS_WINDOWS ? '-Channel' : '--channel', 'LTS')
|
const dotnetInstallOutput = await new DotnetInstallScript()
|
||||||
.execute();
|
// Don't overwrite CLI because it should be already installed
|
||||||
if (runtimeInstallOutput.exitCode) {
|
.useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files')
|
||||||
/**
|
// Use version provided by user
|
||||||
* dotnetInstallScript will install CLI and runtime even if previous script haven't succeded,
|
.useVersion(dotnetVersion, this.quality)
|
||||||
* so at this point it's too early to throw an error
|
.execute();
|
||||||
*/
|
if (dotnetInstallOutput.exitCode) {
|
||||||
core.warning(`Failed to install dotnet runtime + cli, exit code: ${runtimeInstallOutput.exitCode}. ${runtimeInstallOutput.stderr}`);
|
throw new Error(`Failed to install dotnet, exit code: ${dotnetInstallOutput.exitCode}. ${dotnetInstallOutput.stderr}`);
|
||||||
}
|
}
|
||||||
/**
|
return this.parseInstalledVersion(dotnetInstallOutput.stdout);
|
||||||
* Install dotnet over the latest version of
|
|
||||||
* dotnet CLI
|
|
||||||
*/
|
|
||||||
const dotnetInstallOutput = yield new DotnetInstallScript()
|
|
||||||
// Don't overwrite CLI because it should be already installed
|
|
||||||
.useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files')
|
|
||||||
// Use version provided by user
|
|
||||||
.useVersion(dotnetVersion, this.quality)
|
|
||||||
.execute();
|
|
||||||
if (dotnetInstallOutput.exitCode) {
|
|
||||||
throw new Error(`Failed to install dotnet, exit code: ${dotnetInstallOutput.exitCode}. ${dotnetInstallOutput.stderr}`);
|
|
||||||
}
|
|
||||||
return this.parseInstalledVersion(dotnetInstallOutput.stdout);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
parseInstalledVersion(stdout) {
|
parseInstalledVersion(stdout) {
|
||||||
const regex = /(?<version>\d+\.\d+\.\d+[a-z0-9._-]*)/gm;
|
const regex = /(?<version>\d+\.\d+\.\d+[a-z0-9._-]*)/gm;
|
||||||
@ -99681,27 +99677,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|||||||
}) : function(o, v) {
|
}) : function(o, v) {
|
||||||
o["default"] = v;
|
o["default"] = v;
|
||||||
});
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || (function () {
|
||||||
if (mod && mod.__esModule) return mod;
|
var ownKeys = function(o) {
|
||||||
var result = {};
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
var ar = [];
|
||||||
__setModuleDefault(result, mod);
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||||
return result;
|
return ar;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
return ownKeys(o);
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
};
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return function (mod) {
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (mod && mod.__esModule) return mod;
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
var result = {};
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
__setModuleDefault(result, mod);
|
||||||
});
|
return result;
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.run = void 0;
|
exports.run = run;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const installer_1 = __nccwpck_require__(2574);
|
const installer_1 = __nccwpck_require__(2574);
|
||||||
const fs = __importStar(__nccwpck_require__(7147));
|
const fs = __importStar(__nccwpck_require__(7147));
|
||||||
@ -99719,72 +99716,69 @@ const qualityOptions = [
|
|||||||
'preview',
|
'preview',
|
||||||
'ga'
|
'ga'
|
||||||
];
|
];
|
||||||
function run() {
|
async function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
try {
|
||||||
try {
|
//
|
||||||
//
|
// dotnet-version is optional, but needs to be provided for most use cases.
|
||||||
// dotnet-version is optional, but needs to be provided for most use cases.
|
// If supplied, install / use from the tool cache.
|
||||||
// If supplied, install / use from the tool cache.
|
// global-version-file may be specified to point to a specific global.json
|
||||||
// global-version-file may be specified to point to a specific global.json
|
// and will be used to install an additional version.
|
||||||
// and will be used to install an additional version.
|
// If not supplied, look for version in ./global.json.
|
||||||
// If not supplied, look for version in ./global.json.
|
// If a valid version still can't be identified, nothing will be installed.
|
||||||
// If a valid version still can't be identified, nothing will be installed.
|
// Proxy, auth, (etc) are still set up, even if no version is identified
|
||||||
// Proxy, auth, (etc) are still set up, even if no version is identified
|
//
|
||||||
//
|
const versions = core.getMultilineInput('dotnet-version');
|
||||||
const versions = core.getMultilineInput('dotnet-version');
|
const installedDotnetVersions = [];
|
||||||
const installedDotnetVersions = [];
|
const globalJsonFileInput = core.getInput('global-json-file');
|
||||||
const globalJsonFileInput = core.getInput('global-json-file');
|
if (globalJsonFileInput) {
|
||||||
if (globalJsonFileInput) {
|
const globalJsonPath = path_1.default.resolve(process.cwd(), globalJsonFileInput);
|
||||||
const globalJsonPath = path_1.default.resolve(process.cwd(), globalJsonFileInput);
|
if (!fs.existsSync(globalJsonPath)) {
|
||||||
if (!fs.existsSync(globalJsonPath)) {
|
throw new Error(`The specified global.json file '${globalJsonFileInput}' does not exist`);
|
||||||
throw new Error(`The specified global.json file '${globalJsonFileInput}' does not exist`);
|
}
|
||||||
}
|
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
||||||
|
}
|
||||||
|
if (!versions.length) {
|
||||||
|
// Try to fall back to global.json
|
||||||
|
core.debug('No version found, trying to find version from global.json');
|
||||||
|
const globalJsonPath = path_1.default.join(process.cwd(), 'global.json');
|
||||||
|
if (fs.existsSync(globalJsonPath)) {
|
||||||
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
||||||
}
|
}
|
||||||
if (!versions.length) {
|
else {
|
||||||
// Try to fall back to global.json
|
core.info(`The global.json wasn't found in the root directory. No .NET version will be installed.`);
|
||||||
core.debug('No version found, trying to find version from global.json');
|
|
||||||
const globalJsonPath = path_1.default.join(process.cwd(), 'global.json');
|
|
||||||
if (fs.existsSync(globalJsonPath)) {
|
|
||||||
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.info(`The global.json wasn't found in the root directory. No .NET version will be installed.`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (versions.length) {
|
|
||||||
const quality = core.getInput('dotnet-quality');
|
|
||||||
if (quality && !qualityOptions.includes(quality)) {
|
|
||||||
throw new Error(`Value '${quality}' is not supported for the 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`);
|
|
||||||
}
|
|
||||||
let dotnetInstaller;
|
|
||||||
const uniqueVersions = new Set(versions);
|
|
||||||
for (const version of uniqueVersions) {
|
|
||||||
dotnetInstaller = new installer_1.DotnetCoreInstaller(version, quality);
|
|
||||||
const installedVersion = yield dotnetInstaller.installDotnet();
|
|
||||||
installedDotnetVersions.push(installedVersion);
|
|
||||||
}
|
|
||||||
installer_1.DotnetInstallDir.addToPath();
|
|
||||||
}
|
|
||||||
const sourceUrl = core.getInput('source-url');
|
|
||||||
const configFile = core.getInput('config-file');
|
|
||||||
if (sourceUrl) {
|
|
||||||
auth.configAuthentication(sourceUrl, configFile);
|
|
||||||
}
|
|
||||||
outputInstalledVersion(installedDotnetVersions, globalJsonFileInput);
|
|
||||||
if (core.getBooleanInput('cache') && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
|
||||||
yield (0, cache_restore_1.restoreCache)(cacheDependencyPath);
|
|
||||||
}
|
|
||||||
const matchersPath = path_1.default.join(__dirname, '..', '..', '.github');
|
|
||||||
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
if (versions.length) {
|
||||||
core.setFailed(error.message);
|
const quality = core.getInput('dotnet-quality');
|
||||||
|
if (quality && !qualityOptions.includes(quality)) {
|
||||||
|
throw new Error(`Value '${quality}' is not supported for the 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`);
|
||||||
|
}
|
||||||
|
let dotnetInstaller;
|
||||||
|
const uniqueVersions = new Set(versions);
|
||||||
|
for (const version of uniqueVersions) {
|
||||||
|
dotnetInstaller = new installer_1.DotnetCoreInstaller(version, quality);
|
||||||
|
const installedVersion = await dotnetInstaller.installDotnet();
|
||||||
|
installedDotnetVersions.push(installedVersion);
|
||||||
|
}
|
||||||
|
installer_1.DotnetInstallDir.addToPath();
|
||||||
}
|
}
|
||||||
});
|
const sourceUrl = core.getInput('source-url');
|
||||||
|
const configFile = core.getInput('config-file');
|
||||||
|
if (sourceUrl) {
|
||||||
|
auth.configAuthentication(sourceUrl, configFile);
|
||||||
|
}
|
||||||
|
outputInstalledVersion(installedDotnetVersions, globalJsonFileInput);
|
||||||
|
if (core.getBooleanInput('cache') && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
||||||
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
|
await (0, cache_restore_1.restoreCache)(cacheDependencyPath);
|
||||||
|
}
|
||||||
|
const matchersPath = path_1.default.join(__dirname, '..', '..', '.github');
|
||||||
|
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.setFailed(error.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.run = run;
|
|
||||||
function getVersionFromGlobalJson(globalJsonPath) {
|
function getVersionFromGlobalJson(globalJsonPath) {
|
||||||
let version = '';
|
let version = '';
|
||||||
const globalJson = json5_1.default.parse(
|
const globalJson = json5_1.default.parse(
|
||||||
|
1
package-lock.json
generated
1
package-lock.json
generated
@ -5793,6 +5793,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
/* Basic Options */
|
/* Basic Options */
|
||||||
// "incremental": true, /* Enable incremental compilation */
|
// "incremental": true, /* Enable incremental compilation */
|
||||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "es2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6"
|
"es6"
|
||||||
|
Reference in New Issue
Block a user