fix go special image (#104)

* fix go special image

* fix go symlink

* try to cleanup space
This commit is contained in:
ChristopherHX
2023-08-15 14:23:06 +02:00
committed by GitHub
parent a6297292be
commit 60cbcc9f33
2 changed files with 14 additions and 6 deletions
+7
View File
@@ -209,6 +209,13 @@ jobs:
- dotnet
- custom
steps:
- name: Cleanup
run: |
docker rmi -f $(docker images -aq) || :
rm -r "$RUNNER_TOOL_CACHE" || :
rm -r "$RUNNER_TOOLSDIRECTORY" || :
rm -r "$AGENT_TOOLSDIRECTORY" || :
shell: bash
- name: Force SLUG to lowercase
uses: actions/github-script@v6
with:
+7 -6
View File
@@ -16,6 +16,7 @@ go_arch() {
esac
}
DEFVER=$(jq -r '.toolcache[] | select(.name == "go") | .default' "/imagegeneration/toolset.json")
for V in $(jq -r '.toolcache[] | select(.name == "go") | .versions[]' "/imagegeneration/toolset.json"); do
printf "\n\t🐋 Installing GO=%s 🐋\t\n" "${V}"
VER=$(jq -r "[.[] | select(.version|test(\"^${V}\"))][0].version" "/tmp/go-toolset.json")
@@ -23,12 +24,12 @@ for V in $(jq -r '.toolcache[] | select(.name == "go") | .versions[]' "/imagegen
mkdir -v -m 0777 -p "$GOPATH"
DL_VER="${VER}"
# hack
# hack (1.21.0 has the 0 in it's url)
# TODO: i hate shell scripts, please can I have powershell on linux and no, python is not a solution, it should die
# TODO: write own thing to get links from go.dev and versions from actions/go-versions, mash it together, ?????, works
if [[ "$(echo ${VER} | cut -d. -f3)" == "0" ]]; then
DL_VER=$(echo "${VER}" | cut -d. -f-2)
fi
#if [[ "$(echo ${VER} | cut -d. -f3)" == "0" ]]; then
# DL_VER=$(echo "${VER}" | cut -d. -f-2)
#fi
wget -qO- "https://golang.org/dl/go${DL_VER}.linux-$(go_arch).tar.gz" | tar -zxf - --strip-components=1 -C "$GOPATH"
# ENVVAR="${V//\./_}"
@@ -40,8 +41,8 @@ for V in $(jq -r '.toolcache[] | select(.name == "go") | .versions[]' "/imagegen
printf "\n\t🐋 Installed GO 🐋\t\n"
"$GOPATH/bin/go" version
if [[ "${V}" == "1.15.*" ]]; then
ln -s "$GOPATH/bin/*" /usr/bin/
if [[ "${V}" == "$DEFVER" ]]; then
ln -s "$GOPATH/bin"/* /usr/bin/
fi
done