mirror of
https://github.com/actions/setup-go.git
synced 2025-06-28 07:53:43 +00:00
Change getFileName to do architecture lookups and add arm support
This commit is contained in:
parent
75259a5ae0
commit
0cbaec8e4b
2 changed files with 20 additions and 2 deletions
|
@ -72,6 +72,7 @@ function acquireGo(version) {
|
|||
//
|
||||
let fileName = getFileName(version);
|
||||
let downloadUrl = getDownloadUrl(fileName);
|
||||
core.debug('Downloading Go from: ' + downloadUrl);
|
||||
let downloadPath = null;
|
||||
try {
|
||||
downloadPath = yield tc.downloadTool(downloadUrl);
|
||||
|
@ -102,8 +103,14 @@ function acquireGo(version) {
|
|||
});
|
||||
}
|
||||
function getFileName(version) {
|
||||
const arches = {
|
||||
x64: 'amd64',
|
||||
arm: 'armv6l',
|
||||
arm64: 'arm64',
|
||||
default: '386'
|
||||
};
|
||||
const platform = osPlat == 'win32' ? 'windows' : osPlat;
|
||||
const arch = osArch == 'x64' ? 'amd64' : '386';
|
||||
const arch = arches[osArch] || arches['default'];
|
||||
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||
const filename = util.format('go%s.%s-%s.%s', version, platform, arch, ext);
|
||||
return filename;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue