mirror of
https://github.com/actions/setup-go
synced 2024-12-22 14:22:41 +00:00
use real version instead of spec
This commit is contained in:
parent
2e7414f276
commit
89d7939d38
2 changed files with 9 additions and 10 deletions
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
|
@ -63602,19 +63602,18 @@ function run() {
|
||||||
core.debug(`add bin ${added}`);
|
core.debug(`add bin ${added}`);
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
}
|
}
|
||||||
|
let goPath = yield io.which('go');
|
||||||
|
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
||||||
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
||||||
const packageManager = 'default';
|
const packageManager = 'default';
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
let goPath = yield io.which('go');
|
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`);
|
||||||
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`);
|
yield cache_restore_1.restoreCache(goVersion, packageManager, cacheDependencyPath);
|
||||||
yield cache_restore_1.restoreCache(versionSpec, packageManager, cacheDependencyPath);
|
|
||||||
}
|
}
|
||||||
// add problem matchers
|
// add problem matchers
|
||||||
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
||||||
core.info(`##[add-matcher]${matchersPath}`);
|
core.info(`##[add-matcher]${matchersPath}`);
|
||||||
// output the version actually being used
|
// output the version actually being used
|
||||||
let goPath = yield io.which('go');
|
|
||||||
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
|
||||||
core.info(goVersion);
|
core.info(goVersion);
|
||||||
core.setOutput('go-version', parseGoVersion(goVersion));
|
core.setOutput('go-version', parseGoVersion(goVersion));
|
||||||
core.startGroup('go env');
|
core.startGroup('go env');
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -56,12 +56,14 @@ export async function run() {
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let goPath = await io.which('go');
|
||||||
|
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
||||||
|
|
||||||
if (cache && isCacheFeatureAvailable()) {
|
if (cache && isCacheFeatureAvailable()) {
|
||||||
const packageManager = 'default';
|
const packageManager = 'default';
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
let goPath = await io.which('go');
|
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`)
|
||||||
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`)
|
await restoreCache(goVersion, packageManager, cacheDependencyPath);
|
||||||
await restoreCache(versionSpec, packageManager, cacheDependencyPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add problem matchers
|
// add problem matchers
|
||||||
|
@ -69,8 +71,6 @@ export async function run() {
|
||||||
core.info(`##[add-matcher]${matchersPath}`);
|
core.info(`##[add-matcher]${matchersPath}`);
|
||||||
|
|
||||||
// output the version actually being used
|
// output the version actually being used
|
||||||
let goPath = await io.which('go');
|
|
||||||
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
|
||||||
core.info(goVersion);
|
core.info(goVersion);
|
||||||
|
|
||||||
core.setOutput('go-version', parseGoVersion(goVersion));
|
core.setOutput('go-version', parseGoVersion(goVersion));
|
||||||
|
|
Loading…
Reference in a new issue