semver and channel for cache dir
This commit is contained in:
@@ -32,7 +32,10 @@ export async function getFlutter(
|
||||
version: string,
|
||||
channel: string
|
||||
): Promise<void> {
|
||||
let toolPath = tc.find('Flutter', version);
|
||||
// make semver compatible, eg: 1.7.8+hotfix.4 -> 1.7.8-hotfix.4
|
||||
const semver = version.replace('+', '-');
|
||||
const cleanver = `${semver}-${channel}`;
|
||||
let toolPath = tc.find('Flutter', cleanver);
|
||||
|
||||
if (toolPath) {
|
||||
core.debug(`Tool found in cache ${toolPath}`);
|
||||
@@ -46,7 +49,7 @@ export async function getFlutter(
|
||||
const sdkDir = await extractDownload(sdkFile, tempDir);
|
||||
core.debug(`Flutter sdk extracted to ${sdkDir}`);
|
||||
|
||||
toolPath = await tc.cacheDir(sdkDir, 'Flutter', version);
|
||||
toolPath = await tc.cacheDir(sdkDir, 'Flutter', cleanver);
|
||||
}
|
||||
|
||||
core.exportVariable('FLUTTER_HOME', toolPath);
|
||||
|
||||
Reference in New Issue
Block a user