mirror of
https://github.com/actions/setup-go.git
synced 2025-06-14 09:37:13 +02:00
Compare commits
2 Commits
v1.1.2
...
ethomson/u
Author | SHA1 | Date | |
---|---|---|---|
63aa003870 | |||
8dd2e77965 |
@ -16,7 +16,7 @@ See [action.yml](action.yml)
|
|||||||
Basic:
|
Basic:
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: '1.9.3' # The Go version to download (if necessary) and use.
|
go-version: '1.9.3' # The Go version to download (if necessary) and use.
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
go: [ '1.8', '1.9.3', '1.10.x' ]
|
go: [ '1.8', '1.9.3', '1.10.x' ]
|
||||||
name: Go ${{ matrix.go }} sample
|
name: Go ${{ matrix.go }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: 'Setup Go environment'
|
name: 'Setup Go'
|
||||||
description: 'Setup a Go environment and add it to the PATH, additionally providing proxy support'
|
description: 'Set up a specific version of Go and add the command-line tools to the PATH'
|
||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
go-version:
|
go-version:
|
||||||
|
@ -72,7 +72,6 @@ function acquireGo(version) {
|
|||||||
//
|
//
|
||||||
let fileName = getFileName(version);
|
let fileName = getFileName(version);
|
||||||
let downloadUrl = getDownloadUrl(fileName);
|
let downloadUrl = getDownloadUrl(fileName);
|
||||||
core.debug('Downloading Go from: ' + downloadUrl);
|
|
||||||
let downloadPath = null;
|
let downloadPath = null;
|
||||||
try {
|
try {
|
||||||
downloadPath = yield tc.downloadTool(downloadUrl);
|
downloadPath = yield tc.downloadTool(downloadUrl);
|
||||||
@ -103,14 +102,8 @@ function acquireGo(version) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function getFileName(version) {
|
function getFileName(version) {
|
||||||
const arches = {
|
|
||||||
x64: 'amd64',
|
|
||||||
arm: 'armv6l',
|
|
||||||
arm64: 'arm64',
|
|
||||||
default: '386'
|
|
||||||
};
|
|
||||||
const platform = osPlat == 'win32' ? 'windows' : osPlat;
|
const platform = osPlat == 'win32' ? 'windows' : osPlat;
|
||||||
const arch = arches[osArch] || arches['default'];
|
const arch = osArch == 'x64' ? 'amd64' : '386';
|
||||||
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
const ext = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||||
const filename = util.format('go%s.%s-%s.%s', version, platform, arch, ext);
|
const filename = util.format('go%s.%s-%s.%s', version, platform, arch, ext);
|
||||||
return filename;
|
return filename;
|
||||||
|
@ -57,9 +57,6 @@ async function acquireGo(version: string): Promise<string> {
|
|||||||
//
|
//
|
||||||
let fileName: string = getFileName(version);
|
let fileName: string = getFileName(version);
|
||||||
let downloadUrl: string = getDownloadUrl(fileName);
|
let downloadUrl: string = getDownloadUrl(fileName);
|
||||||
|
|
||||||
core.debug('Downloading Go from: ' + downloadUrl);
|
|
||||||
|
|
||||||
let downloadPath: string | null = null;
|
let downloadPath: string | null = null;
|
||||||
try {
|
try {
|
||||||
downloadPath = await tc.downloadTool(downloadUrl);
|
downloadPath = await tc.downloadTool(downloadUrl);
|
||||||
@ -92,15 +89,8 @@ async function acquireGo(version: string): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFileName(version: string): string {
|
function getFileName(version: string): string {
|
||||||
const arches: {[arch: string]: string} = {
|
|
||||||
x64: 'amd64',
|
|
||||||
arm: 'armv6l',
|
|
||||||
arm64: 'arm64',
|
|
||||||
default: '386'
|
|
||||||
};
|
|
||||||
|
|
||||||
const platform: string = osPlat == 'win32' ? 'windows' : osPlat;
|
const platform: string = osPlat == 'win32' ? 'windows' : osPlat;
|
||||||
const arch: string = arches[osArch] || arches['default'];
|
const arch: string = osArch == 'x64' ? 'amd64' : '386';
|
||||||
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
|
||||||
const filename: string = util.format(
|
const filename: string = util.format(
|
||||||
'go%s.%s-%s.%s',
|
'go%s.%s-%s.%s',
|
||||||
@ -109,7 +99,6 @@ function getFileName(version: string): string {
|
|||||||
arch,
|
arch,
|
||||||
ext
|
ext
|
||||||
);
|
);
|
||||||
|
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user