Skip to content

Commit 5b0f528

Browse files
authored
build-git-installers: target an older Ubuntu version (#719)
Currently, we target whatever GitHub Actions use as `ubuntu-latest`; This, however, led to the unintentional requirement in v2.47.2.vfs.0.0 to run Ubuntu 24.04 (up from 22.04 in v2.47.1.vfs.0.1). It is important to target a wider audience, though, especially in light of CVE-2024-52005 which is only addressed in Git for Windows and `microsoft/git`, but not Git. We could now go back to 22.04; This would only be a temporary band-aid, https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/ already announced that 20.04 is phased out very soon, and 22.04 will be next. Let's just use a Docker container instead that targets the oldest Ubuntu LTS that is still maintained in _some_ shape or form. We still verify in `validate-installers` that the resulting binary installs and works on the latest Ubuntu version by virtue of using `runs-on: ubuntu-latest` in _that_ matrix job.
2 parents 594447d + ed8287b commit 5b0f528

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
# Check prerequisites for the workflow
1313
prereqs:
1414
runs-on: ubuntu-latest
15-
environment: release
1615
outputs:
1716
tag_name: ${{ steps.tag.outputs.name }} # The full name of the tag, e.g. v2.32.0.vfs.0.0
1817
tag_version: ${{ steps.tag.outputs.version }} # The version number (without preceding "v"), e.g. 2.32.0.vfs.0.0
@@ -491,16 +490,30 @@ jobs:
491490
# End build and sign Mac OSX installers
492491

493492
# Build and sign Debian package
494-
create-linux-artifacts:
493+
create-linux-unsigned-artifacts:
495494
runs-on: ubuntu-latest
495+
container:
496+
image: ubuntu:16.04 # expanded security maintenance until 04/02/2026, according to https://endoflife.date/ubuntu
497+
volumes:
498+
# override /__e/node20 because GitHub Actions uses a version that requires too-recent glibc, see "Install dependencies" below
499+
- /tmp:/__e/node20
496500
needs: prereqs
497-
environment: release
498501
steps:
499-
- name: Install git dependencies
502+
- name: Install dependencies
500503
run: |
501504
set -ex
502-
sudo apt-get update -q
503-
sudo apt-get install -y -q --no-install-recommends gettext libcurl4-gnutls-dev libpcre3-dev asciidoc xmlto
505+
apt-get update -q
506+
apt-get install -y -q --no-install-recommends \
507+
build-essential \
508+
tcl tk gettext asciidoc xmlto \
509+
libcurl4-gnutls-dev libpcre2-dev zlib1g-dev libexpat-dev \
510+
curl ca-certificates
511+
512+
# Install a Node.js version that works in older Ubuntu containers (read: does not require very recent glibc)
513+
NODE_VERSION=v20.18.1 &&
514+
NODE_URL=https://unofficial-builds.nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-x64-glibc-217.tar.gz &&
515+
curl -Lo /tmp/node.tar.gz $NODE_URL &&
516+
tar -C /__e/node20 -x --strip-components=1 -f /tmp/node.tar.gz
504517
505518
- name: Clone git
506519
uses: actions/checkout@v4
@@ -534,6 +547,7 @@ jobs:
534547
535548
DESTDIR="$PKGDIR" make -C git -j5 V=1 DEVELOPER=1 \
536549
USE_LIBPCRE=1 \
550+
USE_CURL_FOR_IMAP_SEND=1 NO_OPENSSL=1 \
537551
NO_CROSS_DIRECTORY_HARDLINKS=1 \
538552
ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 \
539553
ASCIIDOC='TZ=UTC asciidoc' \
@@ -563,6 +577,18 @@ jobs:
563577
# Move Debian package for later artifact upload
564578
mv "$PKGNAME.deb" "$GITHUB_WORKSPACE"
565579
580+
- name: Upload artifacts
581+
uses: actions/upload-artifact@v4
582+
with:
583+
name: linux-unsigned-artifacts
584+
path: |
585+
*.deb
586+
587+
create-linux-artifacts:
588+
runs-on: ubuntu-latest
589+
needs: [prereqs, create-linux-unsigned-artifacts]
590+
environment: release
591+
steps:
566592
- name: Log into Azure
567593
uses: azure/login@v2
568594
with:
@@ -578,17 +604,12 @@ jobs:
578604
GPG_KEYGRIP_SECRET_NAME: ${{ secrets.GPG_KEYGRIP_SECRET_NAME }}
579605
run: |
580606
# Install debsigs
581-
sudo apt install debsigs
607+
sudo apt-get install -y debsigs
582608
583609
# Download GPG key, passphrase, and keygrip from Azure Key Vault
584-
key=$(az keyvault secret show --name $GPG_KEY_SECRET_NAME --vault-name $AZURE_VAULT --query "value")
585-
passphrase=$(az keyvault secret show --name $GPG_PASSPHRASE_SECRET_NAME --vault-name $AZURE_VAULT --query "value")
586-
keygrip=$(az keyvault secret show --name $GPG_KEYGRIP_SECRET_NAME --vault-name $AZURE_VAULT --query "value")
587-
588-
# Remove quotes from downloaded values
589-
key=$(sed -e 's/^"//' -e 's/"$//' <<<"$key")
590-
passphrase=$(sed -e 's/^"//' -e 's/"$//' <<<"$passphrase")
591-
keygrip=$(sed -e 's/^"//' -e 's/"$//' <<<"$keygrip")
610+
key="$(az keyvault secret show --name "$GPG_KEY_SECRET_NAME" --vault-name "$AZURE_VAULT" --query "value" --output tsv)"
611+
passphrase="$(az keyvault secret show --name "$GPG_PASSPHRASE_SECRET_NAME" --vault-name "$AZURE_VAULT" --query "value" --output tsv)"
612+
keygrip="$(az keyvault secret show --name "$GPG_KEYGRIP_SECRET_NAME" --vault-name "$AZURE_VAULT" --query "value" --output tsv)"
592613
593614
# Import GPG key
594615
echo "$key" | base64 -d | gpg --import --no-tty --batch --yes
@@ -598,6 +619,11 @@ jobs:
598619
gpg-connect-agent RELOADAGENT /bye
599620
/usr/lib/gnupg2/gpg-preset-passphrase --preset "$keygrip" <<<"$passphrase"
600621
622+
- name: Download artifacts
623+
uses: actions/download-artifact@v4
624+
with:
625+
name: linux-unsigned-artifacts
626+
601627
- name: Sign Debian package
602628
run: |
603629
# Sign Debian package

0 commit comments

Comments
 (0)