build: change main script dist path

This commit is contained in:
Nogic 2023-04-30 02:55:57 +00:00
parent 9bc24e1526
commit c2b95dce66
5 changed files with 12 additions and 12 deletions

View File

@ -31,6 +31,6 @@ outputs:
description: 'Contains the installed by action .NET SDK version for reuse.'
runs:
using: 'node16'
main: 'dist/index.js'
main: 'dist/setup/index.js'
post: 'dist/cache-save/index.js'
post-if: success()

View File

@ -70951,11 +70951,10 @@ 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 = () => __awaiter(void 0, void 0, void 0, function* () {
const fileHash = yield glob.hashFiles(constants_1.lockFilePattern);
const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const fileHash = yield glob.hashFiles(cacheDependencyPath || constants_1.lockFilePattern);
if (!fileHash) {
core.warning(`No matches found for glob: ${constants_1.lockFilePattern}`);
return;
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const platform = process.env.RUNNER_OS;
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
@ -71288,7 +71287,7 @@ class DotnetCoreInstaller {
];
const scriptName = utils_1.IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh';
const escapedScript = path_1.default
.join(__dirname, '..', 'externals', scriptName)
.join(__dirname, '../..', 'externals', scriptName)
.replace(/'/g, "''");
let scriptArguments;
let scriptPath = '';
@ -71491,12 +71490,13 @@ function run() {
});
core.setOutput(constants_1.Outputs.DotnetVersion, versionToOutput);
if (core.getBooleanInput('cache') && (0, cache_utils_1.isCacheFeatureAvailable)()) {
yield (0, cache_restore_1.restoreCache)();
const cacheDependencyPath = core.getInput('cache-dependency-path');
yield (0, cache_restore_1.restoreCache)(cacheDependencyPath);
}
else {
core.setOutput(constants_1.Outputs.CacheHit, false);
}
const matchersPath = path_1.default.join(__dirname, '..', '.github');
const matchersPath = path_1.default.join(__dirname, '../..', '.github');
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
}
catch (error) {

View File

@ -3,9 +3,9 @@
"version": "3.0.2",
"private": true,
"description": "setup dotnet action",
"main": "dist/index.js",
"main": "dist/setup/index.js",
"scripts": {
"build": "ncc build src/setup-dotnet.ts && ncc build -o dist/cache-save src/cache-save.ts",
"build": "ncc build -o dist/setup src/setup-dotnet.ts && ncc build -o dist/cache-save src/cache-save.ts",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",

View File

@ -188,7 +188,7 @@ export class DotnetCoreInstaller {
];
const scriptName = IS_WINDOWS ? 'install-dotnet.ps1' : 'install-dotnet.sh';
const escapedScript = path
.join(__dirname, '..', 'externals', scriptName)
.join(__dirname, '../..', 'externals', scriptName)
.replace(/'/g, "''");
let scriptArguments: string[];
let scriptPath = '';

View File

@ -102,7 +102,7 @@ export async function run() {
core.setOutput(Outputs.CacheHit, false);
}
const matchersPath = path.join(__dirname, '..', '.github');
const matchersPath = path.join(__dirname, '../..', '.github');
core.info(`##[add-matcher]${path.join(matchersPath, 'csc.json')}`);
} catch (error) {
core.setFailed(error.message);