Skip to content

Commit f744a14

Browse files
committed
fix(ci): use curl for downloads in manylinux glibc217 script
1 parent a52c9a3 commit f744a14

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/scripts/package-client-cpp-manylinux-glibc217.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,24 @@ esac
3737

3838
PACKAGE_CLASSIFIER="${PACKAGE_CLASSIFIER:-${DEFAULT_CLASSIFIER}}"
3939

40+
# manylinux2014 images ship curl but not wget (old CentOS7 path installed wget via yum).
41+
download() {
42+
local url="$1"
43+
local out="$2"
44+
if command -v curl >/dev/null 2>&1; then
45+
curl -fsSL -o "${out}" "${url}"
46+
elif command -v wget >/dev/null 2>&1; then
47+
wget -qL -O "${out}" "${url}"
48+
else
49+
echo "Need curl or wget to download: ${url}" >&2
50+
exit 1
51+
fi
52+
}
53+
4054
CMAKE_VERSION=3.28.4
4155
CMAKE_DIR="/opt/cmake-${CMAKE_VERSION}"
4256
if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then
43-
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" -O /tmp/cmake.tar.gz
57+
download "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" /tmp/cmake.tar.gz
4458
rm -rf "${CMAKE_DIR}"
4559
mkdir -p /opt
4660
tar xf /tmp/cmake.tar.gz -C /opt
@@ -49,7 +63,7 @@ fi
4963

5064
JAVA_HOME=/opt/jdk-17
5165
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
52-
wget -qL -O /tmp/jdk17.tar.gz "https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk"
66+
download "https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk" /tmp/jdk17.tar.gz
5367
rm -rf /opt/jdk-17*
5468
mkdir -p /opt
5569
tar xf /tmp/jdk17.tar.gz -C /opt

0 commit comments

Comments
 (0)