Skip to content

Commit 0b15eed

Browse files
vdyeldennington
authored andcommitted
release: build unsigned Ubuntu .deb package
- include `scalar` - build & upload unsigned .deb package Co-authored-by: Lessley Dennington <[email protected]>
1 parent f56037b commit 0b15eed

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

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

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,104 @@ jobs:
473473
git/.github/macos-installer/*.dmg
474474
git/.github/macos-installer/*.pkg
475475
# End build and sign Mac OSX installers
476+
477+
# Build unsigned Ubuntu package
478+
create-linux-unsigned-artifacts:
479+
runs-on: ubuntu-latest
480+
container:
481+
image: ubuntu:20.04 # security support until 04/02/2025, according to https://endoflife.date/ubuntu
482+
volumes:
483+
# override /__e/node20 because GitHub Actions uses a version that requires too-recent glibc, see "Install dependencies" below
484+
- /tmp:/__e/node20
485+
needs: prereqs
486+
steps:
487+
- name: Install dependencies
488+
run: |
489+
set -ex
490+
491+
# Prevent the dialog that asks interactively for the timezone
492+
export DEBIAN_FRONTEND=noninteractive
493+
export TZ=Etc/UTC
494+
495+
apt-get update -q
496+
apt-get install -y -q --no-install-recommends \
497+
build-essential \
498+
tcl tk gettext asciidoc xmlto \
499+
libcurl4-gnutls-dev libpcre2-dev zlib1g-dev libexpat-dev \
500+
curl ca-certificates
501+
502+
# Install a Node.js version that works in older Ubuntu containers (read: does not require very recent glibc)
503+
NODE_VERSION=v20.18.1 &&
504+
NODE_URL=https://unofficial-builds.nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-x64-glibc-217.tar.gz &&
505+
curl -Lo /tmp/node.tar.gz $NODE_URL &&
506+
tar -C /__e/node20 -x --strip-components=1 -f /tmp/node.tar.gz
507+
508+
- name: Clone git
509+
uses: actions/checkout@v4
510+
with:
511+
path: git
512+
513+
- name: Build and create Debian package
514+
run: |
515+
set -ex
516+
517+
die () {
518+
echo "$*" >&2
519+
exit 1
520+
}
521+
522+
echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
523+
make -C git GIT-VERSION-FILE
524+
525+
VERSION="${{ needs.prereqs.outputs.tag_version }}"
526+
527+
ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)"
528+
if test -z "$ARCH"; then
529+
die "Could not determine host architecture!"
530+
fi
531+
532+
PKGNAME="microsoft-git_$VERSION"
533+
PKGDIR="$(dirname $(pwd))/$PKGNAME"
534+
535+
rm -rf "$PKGDIR"
536+
mkdir -p "$PKGDIR"
537+
538+
DESTDIR="$PKGDIR" make -C git -j5 V=1 DEVELOPER=1 \
539+
USE_LIBPCRE=1 \
540+
USE_CURL_FOR_IMAP_SEND=1 NO_OPENSSL=1 \
541+
NO_CROSS_DIRECTORY_HARDLINKS=1 \
542+
ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 \
543+
ASCIIDOC='TZ=UTC asciidoc' \
544+
prefix=/usr/local \
545+
gitexecdir=/usr/local/lib/git-core \
546+
libexecdir=/usr/local/lib/git-core \
547+
htmldir=/usr/local/share/doc/git/html \
548+
install install-doc install-html
549+
550+
cd ..
551+
mkdir "$PKGNAME/DEBIAN"
552+
553+
# Based on https://packages.ubuntu.com/xenial/vcs/git
554+
cat >"$PKGNAME/DEBIAN/control" <<EOF
555+
Package: microsoft-git
556+
Version: $VERSION
557+
Section: vcs
558+
Priority: optional
559+
Architecture: $ARCH
560+
Depends: libcurl3-gnutls, liberror-perl, libexpat1, libpcre2-8-0, perl, perl-modules, zlib1g
561+
Maintainer: GitClient <[email protected]>
562+
Description: Git client built from the https://github.com/microsoft/git repository,
563+
specialized in supporting monorepo scenarios. Includes the Scalar CLI.
564+
EOF
565+
566+
dpkg-deb -Zxz --build "$PKGNAME"
567+
# Move Debian package for later artifact upload
568+
mv "$PKGNAME.deb" "$GITHUB_WORKSPACE"
569+
570+
- name: Upload artifacts
571+
uses: actions/upload-artifact@v4
572+
with:
573+
name: linux-artifacts
574+
path: |
575+
*.deb
576+
# End build unsigned Debian package

0 commit comments

Comments
 (0)