mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-13 07:31:12 +00:00
add search in toolcache for canary
This commit is contained in:
parent
9eba46a481
commit
05e1c35e88
3 changed files with 53 additions and 2 deletions
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue