Skip to content

Commit 5d27088

Browse files
vdyedscho
authored andcommitted
release: build unsigned Ubuntu .deb package
- include `scalar` - build & upload unsigned .deb package
1 parent b1983ce commit 5d27088

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

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

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,3 +570,81 @@ jobs:
570570
name: osx-dmg
571571
path: git/.github/macos-installer/*.dmg
572572
# End build and sign Mac OSX installers
573+
574+
# Build unsigned Ubuntu package
575+
ubuntu_build:
576+
runs-on: ubuntu-20.04
577+
needs: prereqs
578+
steps:
579+
- name: Install git dependencies
580+
run: |
581+
set -ex
582+
583+
sudo apt-get update -q
584+
sudo apt-get install -y -q --no-install-recommends gettext libcurl4-gnutls-dev libpcre3-dev asciidoc xmlto
585+
- name: Clone git
586+
uses: actions/checkout@v3
587+
with:
588+
path: git
589+
- name: Build and package .deb
590+
run: |
591+
set -ex
592+
593+
die () {
594+
echo "$*" >&2
595+
exit 1
596+
}
597+
598+
echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
599+
make -C git GIT-VERSION-FILE
600+
601+
VERSION="${{ needs.prereqs.outputs.tag_version }}"
602+
603+
ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)"
604+
if test -z "$ARCH"; then
605+
die "Could not determine host architecture!"
606+
fi
607+
608+
PKGNAME="microsoft-git_$VERSION"
609+
PKGDIR="$(dirname $(pwd))/$PKGNAME"
610+
611+
rm -rf "$PKGDIR"
612+
mkdir -p "$PKGDIR"
613+
614+
DESTDIR="$PKGDIR" make -C git -j5 V=1 DEVELOPER=1 \
615+
USE_LIBPCRE=1 \
616+
NO_CROSS_DIRECTORY_HARDLINKS=1 \
617+
ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 \
618+
ASCIIDOC='TZ=UTC asciidoc' \
619+
prefix=/usr/local \
620+
gitexecdir=/usr/local/lib/git-core \
621+
libexecdir=/usr/local/lib/git-core \
622+
htmldir=/usr/local/share/doc/git/html \
623+
install install-doc install-html
624+
625+
cd ..
626+
mkdir "$PKGNAME/DEBIAN"
627+
628+
# Based on https://packages.ubuntu.com/xenial/vcs/git
629+
cat >"$PKGNAME/DEBIAN/control" <<EOF
630+
Package: microsoft-git
631+
Version: $VERSION
632+
Section: vcs
633+
Priority: optional
634+
Architecture: $ARCH
635+
Depends: libcurl3-gnutls, liberror-perl, libexpat1, libpcre2-8-0, perl, perl-modules, zlib1g
636+
Maintainer: Git Fundamentals <git-fundamentals@github.com>
637+
Description: Git client built from the https://github.com/microsoft/git repository,
638+
specialized in supporting monorepo scenarios. Includes the Scalar CLI.
639+
EOF
640+
641+
dpkg-deb --build "$PKGNAME"
642+
643+
mkdir $GITHUB_WORKSPACE/artifacts
644+
mv "$PKGNAME.deb" $GITHUB_WORKSPACE/artifacts/
645+
- name: Publish unsigned .deb package
646+
uses: actions/upload-artifact@v3
647+
with:
648+
name: deb-package-unsigned
649+
path: artifacts/
650+
# End build unsigned Ubuntu package

0 commit comments

Comments
 (0)