diff --git a/dist/setup/index.js b/dist/setup/index.js index 55f89f9f..8f1171e0 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -73483,7 +73483,15 @@ class NightlyNodejs extends base_distribution_1.default { super(nodeInfo); } findVersionInHoostedToolCacheDirectory() { - const localVersionPaths = tc.findAllVersions('node', this.nodeInfo.arch); + const localVersionPaths = tc + .findAllVersions('node', this.nodeInfo.arch) + .filter(i => { + const prerelease = semver_1.default.prerelease(i); + if (!prerelease) { + return false; + } + return prerelease[0].includes('nightly'); + }); const localVersion = this.evaluateVersions(localVersionPaths); const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); return toolPath; @@ -73817,12 +73825,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__nccwpck_require__(2186)); +const tc = __importStar(__nccwpck_require__(7784)); const semver_1 = __importDefault(__nccwpck_require__(5911)); const base_distribution_1 = __importDefault(__nccwpck_require__(8653)); class CanaryBuild extends base_distribution_1.default { constructor(nodeInfo) { super(nodeInfo); } + findVersionInHoostedToolCacheDirectory() { + const localVersionPaths = tc + .findAllVersions('node', this.nodeInfo.arch) + .filter(i => { + const prerelease = semver_1.default.prerelease(i); + if (!prerelease) { + return false; + } + return prerelease[0].includes('v8-canary'); + }); + const localVersion = this.evaluateVersions(localVersionPaths); + const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + return toolPath; + } getDistributionUrl() { return 'https://nodejs.org/download/v8-canary'; } diff --git a/src/distibutions/nightly/nightly_builds.ts b/src/distibutions/nightly/nightly_builds.ts index 6ea3f80f..d563fe6a 100644 --- a/src/distibutions/nightly/nightly_builds.ts +++ b/src/distibutions/nightly/nightly_builds.ts @@ -12,7 +12,16 @@ export default class NightlyNodejs extends BaseDistribution { } protected findVersionInHoostedToolCacheDirectory(): string { - const localVersionPaths = tc.findAllVersions('node', this.nodeInfo.arch); + const localVersionPaths = tc + .findAllVersions('node', this.nodeInfo.arch) + .filter(i => { + const prerelease = semver.prerelease(i); + if (!prerelease) { + return false; + } + + return prerelease[0].includes('nightly'); + }); const localVersion = this.evaluateVersions(localVersionPaths); const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); diff --git a/src/distibutions/v8-canary/canary_builds.ts b/src/distibutions/v8-canary/canary_builds.ts index d4f3118a..e363bde9 100644 --- a/src/distibutions/v8-canary/canary_builds.ts +++ b/src/distibutions/v8-canary/canary_builds.ts @@ -1,4 +1,5 @@ import * as core from '@actions/core'; +import * as tc from '@actions/tool-cache'; import semver from 'semver'; @@ -10,6 +11,24 @@ export default class CanaryBuild extends BaseDistribution { super(nodeInfo); } + protected findVersionInHoostedToolCacheDirectory(): string { + const localVersionPaths = tc + .findAllVersions('node', this.nodeInfo.arch) + .filter(i => { + const prerelease = semver.prerelease(i); + if (!prerelease) { + return false; + } + + return prerelease[0].includes('v8-canary'); + }); + + const localVersion = this.evaluateVersions(localVersionPaths); + const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + + return toolPath; + } + protected getDistributionUrl(): string { return 'https://nodejs.org/download/v8-canary'; }