mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-09 03:52:22 +02:00
Add support for arm32 go arch (#253)
This commit is contained in:
parent
f279813975
commit
268d8c0ca0
7 changed files with 127 additions and 46 deletions
14
src/main.ts
14
src/main.ts
|
@ -7,6 +7,7 @@ import {restoreCache} from './cache-restore';
|
|||
import {isGhes, isCacheFeatureAvailable} from './cache-utils';
|
||||
import cp from 'child_process';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
|
@ -19,12 +20,23 @@ export async function run() {
|
|||
const cache = core.getBooleanInput('cache');
|
||||
core.info(`Setup go version spec ${versionSpec}`);
|
||||
|
||||
let arch = core.getInput('architecture');
|
||||
|
||||
if (!arch) {
|
||||
arch = os.arch();
|
||||
}
|
||||
|
||||
if (versionSpec) {
|
||||
let token = core.getInput('token');
|
||||
let auth = !token || isGhes() ? undefined : `token ${token}`;
|
||||
|
||||
const checkLatest = core.getBooleanInput('check-latest');
|
||||
const installDir = await installer.getGo(versionSpec, checkLatest, auth);
|
||||
const installDir = await installer.getGo(
|
||||
versionSpec,
|
||||
checkLatest,
|
||||
auth,
|
||||
arch
|
||||
);
|
||||
|
||||
core.addPath(path.join(installDir, 'bin'));
|
||||
core.info('Added go to the path');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue