diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 5e2f25d..cf25adf 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -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: diff --git a/linux/ubuntu/scripts/go.sh b/linux/ubuntu/scripts/go.sh index c6943b3..8013870 100755 --- a/linux/ubuntu/scripts/go.sh +++ b/linux/ubuntu/scripts/go.sh @@ -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