Skip to content

Commit 022e480

Browse files
vdyedscho
authored andcommitted
release: build unsigned Ubuntu .deb package
- include `scalar` - build & upload unsigned .deb package
1 parent 7969824 commit 022e480

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

0 commit comments

Comments
 (0)