@@ -536,3 +536,104 @@ jobs:
536
536
git/.github/macos-installer/*.dmg
537
537
git/.github/macos-installer/*.pkg
538
538
# End build and sign Mac OSX installers
539
+
540
+ # Build unsigned Ubuntu package
541
+ create-linux-unsigned-artifacts :
542
+ runs-on : ubuntu-latest
543
+ container :
544
+ image : ubuntu:20.04 # security support until 04/02/2025, according to https://endoflife.date/ubuntu
545
+ volumes :
546
+ # override /__e/node20 because GitHub Actions uses a version that requires too-recent glibc, see "Install dependencies" below
547
+ - /tmp:/__e/node20
548
+ needs : prereqs
549
+ steps :
550
+ - name : Install dependencies
551
+ run : |
552
+ set -ex
553
+
554
+ # Prevent the dialog that asks interactively for the timezone
555
+ export DEBIAN_FRONTEND=noninteractive
556
+ export TZ=Etc/UTC
557
+
558
+ apt-get update -q
559
+ apt-get install -y -q --no-install-recommends \
560
+ build-essential \
561
+ tcl tk gettext asciidoc xmlto \
562
+ libcurl4-gnutls-dev libpcre2-dev zlib1g-dev libexpat-dev \
563
+ curl ca-certificates
564
+
565
+ # Install a Node.js version that works in older Ubuntu containers (read: does not require very recent glibc)
566
+ NODE_VERSION=v20.18.1 &&
567
+ NODE_URL=https://unofficial-builds.nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-x64-glibc-217.tar.gz &&
568
+ curl -Lo /tmp/node.tar.gz $NODE_URL &&
569
+ tar -C /__e/node20 -x --strip-components=1 -f /tmp/node.tar.gz
570
+
571
+ - name : Clone git
572
+ uses : actions/checkout@v4
573
+ with :
574
+ path : git
575
+
576
+ - name : Build and create Debian package
577
+ run : |
578
+ set -ex
579
+
580
+ die () {
581
+ echo "$*" >&2
582
+ exit 1
583
+ }
584
+
585
+ echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
586
+ make -C git GIT-VERSION-FILE
587
+
588
+ VERSION="${{ needs.prereqs.outputs.tag_version }}"
589
+
590
+ ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)"
591
+ if test -z "$ARCH"; then
592
+ die "Could not determine host architecture!"
593
+ fi
594
+
595
+ PKGNAME="microsoft-git_$VERSION"
596
+ PKGDIR="$(dirname $(pwd))/$PKGNAME"
597
+
598
+ rm -rf "$PKGDIR"
599
+ mkdir -p "$PKGDIR"
600
+
601
+ DESTDIR="$PKGDIR" make -C git -j5 V=1 DEVELOPER=1 \
602
+ USE_LIBPCRE=1 \
603
+ USE_CURL_FOR_IMAP_SEND=1 NO_OPENSSL=1 \
604
+ NO_CROSS_DIRECTORY_HARDLINKS=1 \
605
+ ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 \
606
+ ASCIIDOC='TZ=UTC asciidoc' \
607
+ prefix=/usr/local \
608
+ gitexecdir=/usr/local/lib/git-core \
609
+ libexecdir=/usr/local/lib/git-core \
610
+ htmldir=/usr/local/share/doc/git/html \
611
+ install install-doc install-html
612
+
613
+ cd ..
614
+ mkdir "$PKGNAME/DEBIAN"
615
+
616
+ # Based on https://packages.ubuntu.com/xenial/vcs/git
617
+ cat >"$PKGNAME/DEBIAN/control" <<EOF
618
+ Package: microsoft-git
619
+ Version: $VERSION
620
+ Section: vcs
621
+ Priority: optional
622
+ Architecture: $ARCH
623
+ Depends: libcurl3-gnutls, liberror-perl, libexpat1, libpcre2-8-0, perl, perl-modules, zlib1g
624
+ Maintainer: GitClient <[email protected] >
625
+ Description: Git client built from the https://github.com/microsoft/git repository,
626
+ specialized in supporting monorepo scenarios. Includes the Scalar CLI.
627
+ EOF
628
+
629
+ dpkg-deb -Zxz --build "$PKGNAME"
630
+ # Move Debian package for later artifact upload
631
+ mv "$PKGNAME.deb" "$GITHUB_WORKSPACE"
632
+
633
+ - name : Upload artifacts
634
+ uses : actions/upload-artifact@v4
635
+ with :
636
+ name : linux-artifacts
637
+ path : |
638
+ *.deb
639
+ # End build unsigned Debian package
0 commit comments