mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-24 00:21:00 -05:00
Merge pull request 'Use Go 1.21, refactor Go setup function' (#41) from gmem/setup-forgejo:go-version-1.21 into main
Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/41 Reviewed-by: dachary <dachary@noreply.code.forgejo.org>
This commit is contained in:
commit
13b596c720
1 changed files with 6 additions and 4 deletions
|
@ -10,12 +10,14 @@ DIR=$(mktemp -d)
|
||||||
trap "rm -fr $DIR" EXIT
|
trap "rm -fr $DIR" EXIT
|
||||||
|
|
||||||
function dependency_go() {
|
function dependency_go() {
|
||||||
|
go_version="1.21.0.linux-amd64" # Set the desired Go version here
|
||||||
|
|
||||||
if ! which go > /dev/null ; then
|
if ! which go > /dev/null ; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y -qq wget tar
|
apt-get install -y -qq wget tar
|
||||||
wget --quiet https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
|
wget --quiet "https://go.dev/dl/go$go_version.tar.gz"
|
||||||
tar zxf go1.20.5.linux-amd64.tar.gz
|
tar zxf "go$go_version.tar.gz"
|
||||||
export PATH=$PATH:$(pwd)/go/bin
|
export PATH="$PATH:$(pwd)/go/bin"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue