mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 22:40:58 -05:00
Use Go 1.21, refactor Go setup function
This commit is contained in:
parent
1045b2e3a3
commit
ca54077433
1 changed files with 6 additions and 4 deletions
|
@ -10,12 +10,14 @@ DIR=$(mktemp -d)
|
|||
trap "rm -fr $DIR" EXIT
|
||||
|
||||
function dependency_go() {
|
||||
go_version="1.21.0.linux-amd64" # Set the desired Go version here
|
||||
|
||||
if ! which go > /dev/null ; then
|
||||
apt-get update
|
||||
apt-get update
|
||||
apt-get install -y -qq wget tar
|
||||
wget --quiet https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
|
||||
tar zxf go1.20.5.linux-amd64.tar.gz
|
||||
export PATH=$PATH:$(pwd)/go/bin
|
||||
wget --quiet "https://go.dev/dl/go$go_version.tar.gz"
|
||||
tar zxf "go$go_version.tar.gz"
|
||||
export PATH="$PATH:$(pwd)/go/bin"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue