diff --git a/.github/workflows/validate-install-from-source.yml b/.github/workflows/validate-install-from-source.yml index ff28dc85c..ca57d2daf 100644 --- a/.github/workflows/validate-install-from-source.yml +++ b/.github/workflows/validate-install-from-source.yml @@ -24,6 +24,7 @@ jobs: - image: tgagor/centos-stream - image: redhat/ubi8 - image: alpine + - image: alpine:3.14.10 - image: opensuse/leap - image: opensuse/tumbleweed - image: registry.suse.com/suse/sle15:15.4.27.11.31 diff --git a/src/linux/Packaging.Linux/install-from-source.sh b/src/linux/Packaging.Linux/install-from-source.sh index 751e57f53..be6ea1579 100755 --- a/src/linux/Packaging.Linux/install-from-source.sh +++ b/src/linux/Packaging.Linux/install-from-source.sh @@ -137,6 +137,10 @@ print_unsupported_distro() { echo "See https://gh.io/gcm/linux for details." } +version_at_least() { + [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$1" ] +} + sudo_cmd= # If the user isn't root, we need to use `sudo` for certain commands @@ -189,7 +193,14 @@ case "$distribution" in $sudo_cmd apk update # Install dotnet/GCM dependencies. - install_packages apk add "curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib which bash coreutils gcompat" + # Alpine 3.14 and earlier need libssl1.1, while later versions need libssl3. + if ( version_at_least "3.15" $version ) then + libssl_pkg="libssl3" + else + libssl_pkg="libssl1.1" + fi + + install_packages apk add "curl git icu-libs krb5-libs libgcc libintl $libssl_pkg libstdc++ zlib which bash coreutils gcompat" ensure_dotnet_installed ;;