@@ -4,40 +4,52 @@ description: 'Install Go Tip toolchain'
4
4
runs :
5
5
using : " composite"
6
6
steps :
7
- - name : Download Go Tip
8
- id : download
9
- shell : bash
10
- run : |
11
- echo Download Go Tip
12
- set -euo pipefail
13
- tip=$(git ls-remote https://github.com/golang/go.git refs/heads/master | awk '{print $1;}')
14
- echo "Go Tip version: ${tip}"
15
- retries=3
16
- wait_time=10
17
- success=false
18
- for ((i=1; i<=retries; i++)); do
19
- url="https://storage.googleapis.com/go-build-snap/go/linux-amd64/${tip}.tar.gz"
20
- if curl -fsSL -o gotip.tar.gz "$url"; then
21
- success=true
22
- break
23
- fi
24
- echo "Failed to download. Retrying in $wait_time seconds..."
25
- sleep $wait_time
26
- done
27
- echo "success=${success}" >> $GITHUB_OUTPUT
7
+ # - name: Download Go Tip
8
+ # id: download
9
+ # shell: bash
10
+ # run: |
11
+ # set -euo pipefail
12
+ # tip=$(git ls-remote https://github.com/golang/go.git refs/heads/master | awk '{print $1;}')
13
+ # echo "Go Tip version: ${tip}"
14
+ # retries=3
15
+ # wait_time=10
16
+ # success=false
17
+ # for ((i=1; i<=retries; i++)); do
18
+ # url="https://storage.googleapis.com/go-build-snap/go/linux-amd64/${tip}.tar.gz"
19
+ # if curl -fsSL -o gotip.tar.gz "$url"; then
20
+ # success=true
21
+ # break
22
+ # fi
23
+ # echo "Failed to download. Retrying in $wait_time seconds..."
24
+ # sleep $wait_time
25
+ # done
26
+ # echo "success=${success}" >> $GITHUB_OUTPUT
28
27
29
- - name : Unpack gotip bundle
30
- if : steps.download.outputs.success == 'true'
28
+ # - name: Unpack gotip bundle
29
+ # if: steps.download.outputs.success == 'true'
30
+ # shell: bash
31
+ # run: |
32
+ # echo Unpack gotip bundle
33
+ # set -euo pipefail
34
+ # echo "Downloaded bundle:"
35
+ # ls -lah gotip.tar.gz
36
+ # export GOROOT="$HOME/sdk/gotip"
37
+ # mkdir -p $GOROOT
38
+ # tar -C $GOROOT -xzf gotip.tar.gz
39
+ # echo "GOROOT=$GOROOT" >> $GITHUB_ENV
40
+
41
+ - name : Download pre-built Go tip from grafana/gotip repo
42
+ id : download
31
43
shell : bash
32
44
run : |
33
- echo Unpack gotip bundle
34
- set -euo pipefail
35
- echo "Downloaded bundle:"
36
- ls -lah gotip.tar.gz
45
+ gh release download ubuntu-latest --repo grafana/gotip --pattern 'go*.zip'
46
+ unzip go.zip -d $HOME/sdk
37
47
export GOROOT="$HOME/sdk/gotip"
38
- mkdir -p $GOROOT
39
- tar -C $GOROOT -xzf gotip.tar.gz
40
48
echo "GOROOT=$GOROOT" >> $GITHUB_ENV
49
+ # echo "GOPATH=$HOME/go" >> "$GITHUB_ENV"
50
+ # echo "$HOME/go/bin" >> "$GITHUB_PATH"
51
+ # echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH"
52
+ echo "success=${success}" >> $GITHUB_OUTPUT
41
53
42
54
# If download failed, we will try to build tip from source.
43
55
# This requires Go toolchain, so install it first.
0 commit comments