Skip to content

Commit 73654ae

Browse files
authored
linux: align with dotnet distros (#953)
Update `install-from-source.sh` and `validate-install-from-source.yml` to align with dotnet-supported Linux distributions. Clarify in `README.md` that the dotnet-supported distributions are the only ones for which GCM guarantees support. Link to successful validation workflow: https://github.com/ldennington/git-credential-manager/actions/runs/3415831593
2 parents 53cd95f + ecddd77 commit 73654ae

File tree

3 files changed

+45
-31
lines changed

3 files changed

+45
-31
lines changed

.github/workflows/validate-install-from-source.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,29 @@ jobs:
1515
vector:
1616
- image: ubuntu
1717
- image: debian
18-
- image: linuxmintd/mint20-amd64
1918
- image: fedora
20-
- image: centos
19+
# Centos no longer officially maintains images on Docker Hub. However,
20+
# tgagor is a contributor who pushes updated images weekly, which should
21+
# be sufficient for our validation needs.
22+
- image: tgagor/centos
23+
- image: tgagor/centos-stream
2124
- image: redhat/ubi8
2225
- image: alpine
26+
- image: opensuse/leap
27+
- image: opensuse/tumbleweed
28+
- image: registry.suse.com/suse/sle15:15.4.27.11.31
29+
- image: archlinux
2330
container: ${{matrix.vector.image}}
2431
steps:
32+
- run: |
33+
if [[ ${{matrix.vector.image}} == *"suse"* ]]; then
34+
zypper -n install tar gzip
35+
elif [[ ${{matrix.vector.image}} == *"centos"* ]]; then
36+
dnf install which -y
37+
fi
2538
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
2639
with:
2740
fetch-depth: 0 # Indicate full history so Nerdbank.GitVersioning works.
2841
- run: |
29-
if [ ${{matrix.vector.image}} == "centos" ]; then
30-
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
31-
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
32-
fi
33-
3442
sh "${GITHUB_WORKSPACE}/src/linux/Packaging.Linux/install-from-source.sh" -y
3543
git-credential-manager --help || exit 1

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,8 @@ Proxy support|✓|✓|✓
5050
`arm64` support|best effort|✓|best effort, no packages
5151
`armhf` support|_N/A_|_N/A_|best effort, no packages
5252

53-
(\*) GCM guarantees support for the below Linux distributions. GCM maintainers
54-
also monitor and evaluate issues opened against other distributions to determine
55-
community interest/engagement and whether an emerging platform should become
56-
fully-supported.
57-
58-
- Debian/Ubuntu/Linux Mint
59-
- Fedora/CentOS/RHEL
60-
- Alpine
53+
(\*) GCM guarantees support only for [the Linux distributions that are officially
54+
supported by dotnet][dotnet-distributions].
6155

6256
## Supported Git versions
6357

@@ -122,6 +116,7 @@ When using GitHub logos, please be sure to follow the
122116
[build-status-badge]: https://github.com/GitCredentialManager/git-credential-manager/actions/workflows/continuous-integration.yml/badge.svg
123117
[docs-index]: https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/README.md
124118
[dotnet]: https://dotnet.microsoft.com
119+
[dotnet-distributions]: https://learn.microsoft.com/en-us/dotnet/core/install/linux
125120
[git-credential-helper]: https://git-scm.com/docs/gitcredentials
126121
[gcm]: https://github.com/GitCredentialManager/git-credential-manager
127122
[gcm-coc]: CODE_OF_CONDUCT.md

src/linux/Packaging.Linux/install-from-source.sh

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,23 @@ Git Credential Manager is licensed under the MIT License: https://aka.ms/gcm/lic
4141
done
4242
fi
4343

44-
install_shared_packages() {
44+
install_packages() {
4545
pkg_manager=$1
4646
install_verb=$2
47+
packages=$3
4748

48-
local shared_packages="git curl"
49-
for package in $shared_packages; do
49+
for package in $packages; do
5050
# Ensure we don't stomp on existing installations.
5151
if [ ! -z $(which $package) ]; then
5252
continue
5353
fi
5454

5555
if [ $pkg_manager = apk ]; then
5656
$sudo_cmd $pkg_manager $install_verb $package
57+
elif [ $pkg_manager = zypper ]; then
58+
$sudo_cmd $pkg_manager -n $install_verb $package
59+
elif [ $pkg_manager = pacman ]; then
60+
$sudo_cmd $pkg_manager --noconfirm $install_verb $package
5761
else
5862
$sudo_cmd $pkg_manager $install_verb $package -y
5963
fi
@@ -125,7 +129,7 @@ eval "$(sed -n 's/^VERSION_ID=/version=/p' /etc/os-release | tr -d '"')"
125129
case "$distribution" in
126130
debian | ubuntu)
127131
$sudo_cmd apt update
128-
install_shared_packages apt install
132+
install_packages apt install "curl git"
129133

130134
# Install dotnet packages and dependencies if needed.
131135
if [ -z "$(verify_existing_dotnet_installation)" ]; then
@@ -150,29 +154,36 @@ case "$distribution" in
150154
fi
151155
fi
152156
;;
153-
linuxmint)
154-
$sudo_cmd apt update
155-
install_shared_packages apt install
156-
157-
# Install dotnet packages and dependencies.
158-
$sudo_cmd apt install libc6 libgcc1 libgssapi-krb5-2 libssl1.1 libstdc++6 zlib1g libicu66 -y
159-
ensure_dotnet_installed
160-
;;
161157
fedora | centos | rhel)
162158
$sudo_cmd dnf update -y
163-
install_shared_packages dnf install
164159

165160
# Install dotnet/GCM dependencies.
166-
$sudo_cmd dnf install krb5-libs libicu openssl-libs zlib findutils which bash -y
161+
install_packages dnf install "curl git krb5-libs libicu openssl-libs zlib findutils which bash"
167162

168163
ensure_dotnet_installed
169164
;;
170165
alpine)
171166
$sudo_cmd apk update
172-
install_shared_packages apk add
173167

174168
# Install dotnet/GCM dependencies.
175-
$sudo_cmd apk add icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib which bash coreutils gcompat
169+
install_packages apk add "curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib which bash coreutils gcompat"
170+
171+
ensure_dotnet_installed
172+
;;
173+
sles | opensuse*)
174+
$sudo_cmd zypper -n update
175+
176+
# Install dotnet/GCM dependencies.
177+
install_packages zypper install "curl git find krb5 libicu libopenssl1_1"
178+
179+
ensure_dotnet_installed
180+
;;
181+
arch)
182+
# --noconfirm required when running from container
183+
$sudo_cmd pacman -Syu --noconfirm
184+
185+
# Install dotnet/GCM dependencies.
186+
install_packages pacman -Sy "curl git glibc gcc krb5 icu openssl libc++ zlib"
176187

177188
ensure_dotnet_installed
178189
;;

0 commit comments

Comments
 (0)