Merge 5f15162041aa71bf5c137eb0cb698a799331c50c into 87c6e1177627274101056947ed58ce11ef42d658

This commit is contained in:
dependabot[bot] 2025-07-30 19:53:29 +00:00 committed by GitHub
commit 23e8eedbb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 320 additions and 326 deletions

View File

@ -87714,27 +87714,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.run = void 0;
exports.run = run;
const core = __importStar(__nccwpck_require__(2186));
const cache = __importStar(__nccwpck_require__(7799));
const node_fs_1 = __importDefault(__nccwpck_require__(7561));
@ -87747,27 +87748,24 @@ process.on('uncaughtException', e => {
const warningPrefix = '[warning]';
core.info(`${warningPrefix}${e.message}`);
});
function run() {
return __awaiter(this, void 0, void 0, function* () {
async function run() {
try {
if (core.getBooleanInput('cache')) {
yield cachePackages();
await cachePackages();
}
}
catch (error) {
core.setFailed(error.message);
}
});
}
exports.run = run;
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
const cachePackages = async () => {
const state = core.getState(constants_1.State.CacheMatchedKey);
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
if (!primaryKey) {
core.info('Primary key was not generated, not saving cache.');
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)) {
throw new Error(`Cache folder path is retrieved for .NET CLI but doesn't exist on disk: ${cachePath}`);
}
@ -87775,12 +87773,12 @@ const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
return;
}
const cacheId = yield cache.saveCache([cachePath], primaryKey);
const cacheId = await cache.saveCache([cachePath], primaryKey);
if (cacheId == -1) {
return;
}
core.info(`Cache saved with the key: ${primaryKey}`);
});
};
run();
@ -87807,24 +87805,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
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 core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
@ -87854,8 +87854,8 @@ const constants_1 = __nccwpck_require__(9042);
* }
* ```
*/
const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, stderr, exitCode } = yield exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
const getNuGetFolderPath = async () => {
const { stdout, stderr, exitCode } = await exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
if (exitCode) {
throw new Error(!stderr.trim()
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
@ -87876,7 +87876,7 @@ const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* ()
}
}
return result;
});
};
exports.getNuGetFolderPath = getNuGetFolderPath;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
@ -87889,7 +87889,6 @@ function isCacheFeatureAvailable() {
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/**
* Returns this action runs on GitHub Enterprise Server or not.
*/

200
dist/setup/index.js vendored
View File

@ -100029,15 +100029,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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 }));
exports.configAuthentication = void 0;
exports.configAuthentication = configAuthentication;
const fs = __importStar(__nccwpck_require__(7147));
const path = __importStar(__nccwpck_require__(1017));
const core = __importStar(__nccwpck_require__(2186));
@ -100050,7 +100060,6 @@ function configAuthentication(feedUrl, existingFileLocation = '', processRoot =
const tempNuGetConfig = path.resolve(processRoot, '../', 'nuget.config');
writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig);
}
exports.configAuthentication = configAuthentication;
function isValidKey(key) {
return /^[\w\-.]+$/i.test(key);
}
@ -100065,7 +100074,6 @@ function getExistingNugetConfig(processRoot) {
return defaultConfigName;
}
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}`);
const sourceKeys = [];
let owner = core.getInput('owner');
@ -100087,7 +100095,7 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
if (typeof json.configuration === 'undefined') {
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;
if (Array.isArray(packageSources)) {
packageSources.forEach(source => {
@ -100217,22 +100225,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.restoreCache = void 0;
const promises_1 = __nccwpck_require__(3977);
@ -100242,9 +100251,9 @@ const core = __importStar(__nccwpck_require__(2186));
const glob = __importStar(__nccwpck_require__(8090));
const cache_utils_1 = __nccwpck_require__(1678);
const constants_1 = __nccwpck_require__(9042);
const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const lockFilePath = cacheDependencyPath || (yield findLockFile());
const fileHash = yield glob.hashFiles(lockFilePath);
const restoreCache = async (cacheDependencyPath) => {
const lockFilePath = cacheDependencyPath || (await findLockFile());
const fileHash = await glob.hashFiles(lockFilePath);
if (!fileHash) {
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
@ -100252,8 +100261,8 @@ const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0,
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const { 'global-packages': cachePath } = yield (0, cache_utils_1.getNuGetFolderPath)();
const cacheKey = yield cache.restoreCache([cachePath], primaryKey);
const { 'global-packages': cachePath } = await (0, cache_utils_1.getNuGetFolderPath)();
const cacheKey = await cache.restoreCache([cachePath], primaryKey);
core.setOutput(constants_1.Outputs.CacheHit, Boolean(cacheKey));
if (!cacheKey) {
core.info('Dotnet cache is not found');
@ -100261,17 +100270,17 @@ const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0,
}
core.saveState(constants_1.State.CacheMatchedKey, cacheKey);
core.info(`Cache restored from key: ${cacheKey}`);
});
};
exports.restoreCache = restoreCache;
const findLockFile = () => __awaiter(void 0, void 0, void 0, function* () {
const findLockFile = async () => {
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));
if (!lockFile) {
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);
});
};
/***/ }),
@ -100297,24 +100306,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
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 core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514));
@ -100344,8 +100355,8 @@ const constants_1 = __nccwpck_require__(9042);
* }
* ```
*/
const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* () {
const { stdout, stderr, exitCode } = yield exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
const getNuGetFolderPath = async () => {
const { stdout, stderr, exitCode } = await exec.getExecOutput(constants_1.cliCommand, undefined, { ignoreReturnCode: true, silent: true });
if (exitCode) {
throw new Error(!stderr.trim()
? `The '${constants_1.cliCommand}' command failed with exit code: ${exitCode}`
@ -100366,7 +100377,7 @@ const getNuGetFolderPath = () => __awaiter(void 0, void 0, void 0, function* ()
}
}
return result;
});
};
exports.getNuGetFolderPath = getNuGetFolderPath;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
@ -100379,7 +100390,6 @@ function isCacheFeatureAvailable() {
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/**
* Returns this action runs on GitHub Enterprise Server or not.
*/
@ -100444,22 +100454,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
@ -100482,8 +100493,7 @@ class DotnetVersionResolver {
this.inputVersion = version.trim();
this.resolvedArgument = { type: '', value: '', qualityFlag: false };
}
resolveVersionInput() {
return __awaiter(this, void 0, void 0, function* () {
async resolveVersionInput() {
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`);
}
@ -100491,16 +100501,14 @@ class DotnetVersionResolver {
this.createVersionArgument();
}
else {
yield this.createChannelArgument();
await this.createChannelArgument();
}
});
}
isNumericTag(versionTag) {
return /^\d+$/.test(versionTag);
}
isLatestPatchSyntax() {
var _a, _b;
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;
const majorTag = this.inputVersion.match(/^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/)?.groups?.majorTag;
if (majorTag &&
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.`);
@ -100511,8 +100519,7 @@ class DotnetVersionResolver {
this.resolvedArgument.type = 'version';
this.resolvedArgument.value = this.inputVersion;
}
createChannelArgument() {
return __awaiter(this, void 0, void 0, function* () {
async createChannelArgument() {
this.resolvedArgument.type = 'channel';
const [major, minor] = this.inputVersion.split('.');
if (this.isLatestPatchSyntax()) {
@ -100522,7 +100529,7 @@ class DotnetVersionResolver {
this.resolvedArgument.value = `${major}.${minor}`;
}
else if (this.isNumericTag(major)) {
this.resolvedArgument.value = yield this.getLatestByMajorTag(major);
this.resolvedArgument.value = await this.getLatestByMajorTag(major);
}
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.
@ -100530,11 +100537,9 @@ class DotnetVersionResolver {
}
this.resolvedArgument.qualityFlag =
parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false;
});
}
createDotnetVersion() {
return __awaiter(this, void 0, void 0, function* () {
yield this.resolveVersionInput();
async createDotnetVersion() {
await this.resolveVersionInput();
if (!this.resolvedArgument.type) {
return this.resolvedArgument;
}
@ -100547,15 +100552,13 @@ class DotnetVersionResolver {
this.resolvedArgument.type === 'channel' ? '--channel' : '--version';
}
return this.resolvedArgument;
});
}
getLatestByMajorTag(majorTag) {
return __awaiter(this, void 0, void 0, function* () {
async getLatestByMajorTag(majorTag) {
const httpClient = new hc.HttpClient('actions/setup-dotnet', [], {
allowRetries: true,
maxRetries: 3
});
const response = yield httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl);
const response = await httpClient.getJson(DotnetVersionResolver.DotnetCoreIndexUrl);
const result = response.result || {};
const releasesInfo = result['releases-index'];
const releaseInfo = releasesInfo.find(info => {
@ -100566,7 +100569,6 @@ class DotnetVersionResolver {
throw new Error(`Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotnetCoreIndexUrl}`);
}
return releaseInfo['channel-version'];
});
}
}
exports.DotnetVersionResolver = DotnetVersionResolver;
@ -100606,13 +100608,11 @@ class DotnetInstallScript {
setupScriptBash() {
(0, fs_1.chmodSync)(this.escapedScript, '777');
}
getScriptPath() {
return __awaiter(this, void 0, void 0, function* () {
async getScriptPath() {
if (utils_1.IS_WINDOWS) {
return (yield io.which('pwsh', false)) || io.which('powershell', true);
return (await io.which('pwsh', false)) || io.which('powershell', true);
}
return io.which(this.escapedScript, true);
});
}
useArguments(...args) {
this.scriptArguments.push(...args);
@ -100631,14 +100631,12 @@ class DotnetInstallScript {
}
return this;
}
execute() {
return __awaiter(this, void 0, void 0, function* () {
async execute() {
const getExecOutputOptions = {
ignoreReturnCode: true,
env: process.env
};
return exec.getExecOutput(`"${yield this.getScriptPath()}"`, this.scriptArguments, getExecOutputOptions);
});
return exec.getExecOutput(`"${await this.getScriptPath()}"`, this.scriptArguments, getExecOutputOptions);
}
}
exports.DotnetInstallScript = DotnetInstallScript;
@ -100673,15 +100671,14 @@ class DotnetCoreInstaller {
this.version = version;
this.quality = quality;
}
installDotnet() {
return __awaiter(this, void 0, void 0, function* () {
async installDotnet() {
const versionResolver = new DotnetVersionResolver(this.version);
const dotnetVersion = yield versionResolver.createDotnetVersion();
const dotnetVersion = await versionResolver.createDotnetVersion();
/**
* Install dotnet runitme first in order to get
* the latest stable version of dotnet CLI
*/
const runtimeInstallOutput = yield new DotnetInstallScript()
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
@ -100700,7 +100697,7 @@ class DotnetCoreInstaller {
* Install dotnet over the latest version of
* dotnet CLI
*/
const dotnetInstallOutput = yield new DotnetInstallScript()
const dotnetInstallOutput = await 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
@ -100710,7 +100707,6 @@ class DotnetCoreInstaller {
throw new Error(`Failed to install dotnet, exit code: ${dotnetInstallOutput.exitCode}. ${dotnetInstallOutput.stderr}`);
}
return this.parseInstalledVersion(dotnetInstallOutput.stdout);
});
}
parseInstalledVersion(stdout) {
const regex = /(?<version>\d+\.\d+\.\d+[a-z0-9._-]*)/gm;
@ -100751,27 +100747,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.run = void 0;
exports.run = run;
const core = __importStar(__nccwpck_require__(2186));
const installer_1 = __nccwpck_require__(2574);
const fs = __importStar(__nccwpck_require__(7147));
@ -100789,8 +100786,7 @@ const qualityOptions = [
'preview',
'ga'
];
function run() {
return __awaiter(this, void 0, void 0, function* () {
async function run() {
try {
//
// dotnet-version is optional, but needs to be provided for most use cases.
@ -100831,7 +100827,7 @@ function run() {
const uniqueVersions = new Set(versions);
for (const version of uniqueVersions) {
dotnetInstaller = new installer_1.DotnetCoreInstaller(version, quality);
const installedVersion = yield dotnetInstaller.installDotnet();
const installedVersion = await dotnetInstaller.installDotnet();
installedDotnetVersions.push(installedVersion);
}
installer_1.DotnetInstallDir.addToPath();
@ -100844,7 +100840,7 @@ function run() {
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);
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')}`);
@ -100852,9 +100848,7 @@ function run() {
catch (error) {
core.setFailed(error.message);
}
});
}
exports.run = run;
function getVersionFromGlobalJson(globalJsonPath) {
let version = '';
const globalJson = json5_1.default.parse(

9
package-lock.json generated
View File

@ -37,7 +37,7 @@
"jest-each": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2",
"typescript": "^5.8.3",
"wget-improved": "^3.2.1"
}
},
@ -5961,10 +5961,11 @@
}
},
"node_modules/typescript": {
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
"integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"

View File

@ -54,7 +54,7 @@
"jest-each": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2",
"typescript": "^5.8.3",
"wget-improved": "^3.2.1"
},
"jest": {

View File

@ -2,7 +2,7 @@
"compilerOptions": {
/* Basic Options */
// "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'. */
"lib": [
"es6"