Update Golang provisioning

- replace the linux/install-golang.sh to the unix/install-golang.sh
  for macos and linux provisioning configurations.

NOTE:
The Golang version is updated from 1.22.4 to 1.25.2.

Task-number: QTBUG-140130
Change-Id: Ic5e7a93bcad4d82210bcd5c7f4144153c938a603
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tatiana Borisova
2025-10-09 12:39:07 +02:00
parent 3ff6bed04a
commit 493a11caee
18 changed files with 102 additions and 54 deletions

View File

@@ -1,42 +0,0 @@
#!/usr/bin/env bash
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# shellcheck source=../unix/DownloadURL.sh
source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
# shellcheck source=../unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
# This script will install go 1.22.4
version="1.22.4"
uname_m="$(uname -m)"
case "$uname_m" in
x86_64|amd64)
sha256="ba79d4526102575196273416239cca418a651e049c2b099f3159db85e7bade7d"
pkgname="go$version.linux-amd64.tar.gz"
dirname="go$version.linux-amd64"
;;
arm64|aarch64)
sha256="a8e177c354d2e4a1b61020aca3562e27ea3e8f8247eca3170e3fa1e0c2f9e771"
pkgname="go$version.linux-arm64.tar.gz"
dirname="go$version.linux-arm64"
;;
*) fatal "Unknown architecture in uname: $uname_m" 43 ;;
esac
internalUrl="http://ci-files01-hki.ci.qt.io/input/go/linux/$pkgname"
externalUrl="https://go.dev/dl/$pkgname"
targetFile="$HOME/$pkgname"
DownloadURL "$internalUrl" "$externalUrl" "$sha256" "$targetFile"
echo "Installing Go"
tar -xzf "$targetFile" -C "$HOME"
rm "$targetFile"
installPrefix="/opt/$dirname"
sudo mv "$HOME/go" "$installPrefix"
SetEnvVar "PATH" "$installPrefix/bin:\$PATH"
echo "Go = $version" >> ~/versions.txt

View File

@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# Copyright (C) 2025 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
os="$1"
# shellcheck source=./DownloadURL.sh
source "${BASH_SOURCE%/*}/DownloadURL.sh"
# shellcheck source=./SetEnvVar.sh
source "${BASH_SOURCE%/*}/SetEnvVar.sh"
# This script will install go 1.25.2
version="1.25.2"
if [[ "$os" == "linux" ]]; then
uname_m="$(uname -m)"
case "$uname_m" in
x86_64|amd64)
sha256="a08c8c36946c86890ca46185765da34442ce64aa"
pkgname="go$version.linux-amd64.tar.gz"
dirname="go$version.linux-amd64"
;;
arm64|aarch64)
sha256="13690a4ecac03e6cca6988a6d2ce80bfa938eb7b"
pkgname="go$version.linux-arm64.tar.gz"
dirname="go$version.linux-arm64"
;;
*) fatal "Unknown architecture in uname: $uname_m" ;;
esac
elif [ "$os" == "macos" ]; then
uname_m="$(uname -m)"
case "$uname_m" in
x86_64|amd64)
sha256="eda89df8fd85a49e4046f85340236248a5d2a7cd"
pkgname="go$version.darwin-amd64.tar.gz"
dirname="go$version.darwin-amd64"
;;
arm64|aarch64)
sha256="1745a71d18f9946f7aac9f9528e3227c8132cc08"
pkgname="go$version.darwin-arm64.tar.gz"
dirname="go$version.darwin-arm64"
;;
*) fatal "Unknown architecture in uname: $uname_m" ;;
esac
fi
internalUrl="http://ci-files01-hki.ci.qt.io/input/qtopenapi/go/$pkgname"
externalUrl="https://go.dev/dl/$pkgname"
targetFile="$HOME/$pkgname"
DownloadURL "$internalUrl" "$externalUrl" "$sha256" "$targetFile"
echo "Installing Go"
tar -xzf "$targetFile" -C "$HOME"
rm "$targetFile"
sudo mkdir -p "/opt/golang/"
installPrefix="/opt/golang/$dirname"
sudo mv "$HOME/go" "$installPrefix"
SetEnvVar "PATH" "$installPrefix/bin:$PATH"
echo "Go = $version" >> ~/versions.txt

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
source "${BASH_SOURCE%/*}/../common/linux/install-golang.sh"
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "linux"

View File

@@ -4,4 +4,4 @@
set -ex
brew install go
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "macos"

View File

@@ -4,4 +4,4 @@
set -ex
brew install go
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "macos"

View File

@@ -4,4 +4,4 @@
set -ex
brew install go
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "macos"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "macos"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
source "${BASH_SOURCE%/*}/../common/unix/install-golang.sh" "macos"