Compare commits

..

2 Commits

Author SHA1 Message Date
63aa003870 Update README for semantic versioning 2019-11-08 16:51:08 +00:00
8dd2e77965 Update description 2019-11-08 16:50:57 +00:00
4 changed files with 6 additions and 24 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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;

View File

@ -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;
} }