Skip to content

Commit 1616116

Browse files
Use GitHub releases to download Go versions. (#58)
1 parent 0f551ac commit 1616116

File tree

10 files changed

+5678
-11359
lines changed

10 files changed

+5678
-11359
lines changed

.github/workflows/versions.yml

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,74 @@
1-
name: go-versions
1+
name: Validate 'setup-go'
22
on:
3-
push:
4-
branches:
5-
- master
6-
paths-ignore:
7-
- '**.md'
8-
pull_request:
9-
paths-ignore:
10-
- '**.md'
3+
push:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
schedule:
12+
- cron: 0 0 * * *
13+
1114
jobs:
12-
run:
13-
name: Go
14-
runs-on: ${{ matrix.operating-system }}
15+
local-cache:
16+
name: Setup local-cache version
17+
runs-on: ${{ matrix.os }}
1518
strategy:
19+
fail-fast: false
1620
matrix:
17-
operating-system: [ubuntu-latest, windows-latest, macos-latest]
21+
os: [macos-latest, windows-latest, ubuntu-latest]
22+
go: [1.12, 1.13, 1.14]
1823
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v2
24+
- name: Checkout
25+
uses: actions/checkout@v2
2126

22-
- name: setup-go ^1.13.6
23-
uses: ./
24-
with:
25-
go-version: ^1.13.6
27+
- name: setup-go ${{ matrix.go }}
28+
uses: ./
29+
with:
30+
go-version: ${{ matrix.go }}
2631

27-
- name: validate version
28-
run: go version | grep "go1."
32+
- name: verify go
33+
run: __tests__/verify-go.sh ${{ matrix.go }}
34+
shell: bash
2935

30-
- name: setup-go 1.13
31-
uses: ./
32-
with:
33-
go-version: 1.13
34-
35-
- name: validate version
36-
run: go version | grep "go1.13."
36+
setup-versions-from-manifest:
37+
name: Setup ${{ matrix.go }} ${{ matrix.os }}
38+
runs-on: ${{ matrix.os }}
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: [macos-latest, windows-latest, ubuntu-latest]
43+
go: [1.12.16, 1.13.11, 1.14.3]
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v2
47+
48+
- name: setup-go ${{ matrix.go }}
49+
uses: ./
50+
with:
51+
go-version: ${{ matrix.go }}
52+
53+
- name: verify go
54+
run: __tests__/verify-go.sh ${{ matrix.go }}
55+
shell: bash
3756

38-
- name: setup-go 1.12.9
57+
setup-versions-from-dist:
58+
name: Setup ${{ matrix.go }} ${{ matrix.os }}
59+
runs-on: ${{ matrix.os }}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [macos-latest, windows-latest, ubuntu-latest]
64+
go: [1.7, 1.8.6]
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v2
68+
- name: setup-go ${{ matrix.go }}
3969
uses: ./
4070
with:
41-
go-version: 1.12.9
42-
43-
- name: validate version
44-
run: go version | grep "go1.12.9"
45-
46-
- name: dump env
71+
go-version: ${{ matrix.go }}
72+
- name: verify go
73+
run: __tests__/verify-go.sh ${{ matrix.go }}
4774
shell: bash
48-
run: |
49-
echo $PATH
50-
echo go versions in tool cache:
51-
echo $(ls $RUNNER_TOOL_CACHE/go)

__tests__/data/versions-manifest.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[
2+
{
3+
"version": "1.12.17",
4+
"stable": true,
5+
"release_url": "https://github.com/actions/go-versions/releases/tag/1.12.17-20200616.21",
6+
"files": [
7+
{
8+
"filename": "go-1.12.17-darwin-x64.tar.gz",
9+
"arch": "x64",
10+
"platform": "darwin",
11+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.17-20200616.21/go-1.12.17-darwin-x64.tar.gz"
12+
},
13+
{
14+
"filename": "go-1.12.17-linux-x64.tar.gz",
15+
"arch": "x64",
16+
"platform": "linux",
17+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.17-20200616.21/go-1.12.17-linux-x64.tar.gz"
18+
},
19+
{
20+
"filename": "go-1.12.17-win32-x64.zip",
21+
"arch": "x64",
22+
"platform": "win32",
23+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.17-20200616.21/go-1.12.17-win32-x64.zip"
24+
}
25+
]
26+
},
27+
{
28+
"version": "1.12.16",
29+
"stable": true,
30+
"release_url": "https://github.com/actions/go-versions/releases/tag/1.12.16-20200616.20",
31+
"files": [
32+
{
33+
"filename": "go-1.12.16-darwin-x64.tar.gz",
34+
"arch": "x64",
35+
"platform": "darwin",
36+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.16-20200616.20/go-1.12.16-darwin-x64.tar.gz"
37+
},
38+
{
39+
"filename": "go-1.12.16-linux-x64.tar.gz",
40+
"arch": "x64",
41+
"platform": "linux",
42+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.16-20200616.20/go-1.12.16-linux-x64.tar.gz"
43+
},
44+
{
45+
"filename": "go-1.12.16-win32-x64.zip",
46+
"arch": "x64",
47+
"platform": "win32",
48+
"download_url": "https://github.com/actions/go-versions/releases/download/1.12.16-20200616.20/go-1.12.16-win32-x64.zip"
49+
}
50+
]
51+
},
52+
{
53+
"version": "1.9.7",
54+
"stable": true,
55+
"release_url": "https://github.com/actions/go-versions/releases/tag/1.9.7-20200616.1",
56+
"files": [
57+
{
58+
"filename": "go-1.9.7-darwin-x64.tar.gz",
59+
"arch": "x64",
60+
"platform": "darwin",
61+
"download_url": "https://github.com/actions/go-versions/releases/download/1.9.7/go-1.9.7-darwin-x64.tar.gz"
62+
},
63+
{
64+
"filename": "go-1.9.7-linux-x64.tar.gz",
65+
"arch": "x64",
66+
"platform": "linux",
67+
"download_url": "https://github.com/actions/go-versions/releases/download/1.9.7/go-1.9.7-linux-x64.tar.gz"
68+
},
69+
{
70+
"filename": "go-1.9.7-win32-x64.zip",
71+
"arch": "x64",
72+
"platform": "win32",
73+
"download_url": "https://github.com/actions/go-versions/releases/download/1.9.7/go-1.9.7-win32-x64.zip"
74+
}
75+
]
76+
}
77+
]

0 commit comments

Comments
 (0)