Skip to content

Commit 217a028

Browse files
vdyeldennington
authored andcommitted
release: build unsigned Ubuntu .deb package
- include `scalar` - build & upload unsigned .deb package Co-authored-by: Lessley Dennington <ldennington@github.com>
1 parent 5c5a513 commit 217a028

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

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

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,83 @@ jobs:
474474
git/.github/macos-installer/*.dmg
475475
git/.github/macos-installer/*.pkg
476476
# End build and sign Mac OSX installers
477+
478+
# Build unsigned Ubuntu package
479+
create-linux-artifacts:
480+
runs-on: ubuntu-latest
481+
needs: prereqs
482+
steps:
483+
- name: Install git dependencies
484+
run: |
485+
set -ex
486+
sudo apt-get update -q
487+
sudo apt-get install -y -q --no-install-recommends gettext libcurl4-gnutls-dev libpcre3-dev asciidoc xmlto
488+
489+
- name: Clone git
490+
uses: actions/checkout@v4
491+
with:
492+
path: git
493+
494+
- name: Build and create Debian package
495+
run: |
496+
set -ex
497+
498+
die () {
499+
echo "$*" >&2
500+
exit 1
501+
}
502+
503+
echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
504+
make -C git GIT-VERSION-FILE
505+
506+
VERSION="${{ needs.prereqs.outputs.tag_version }}"
507+
508+
ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)"
509+
if test -z "$ARCH"; then
510+
die "Could not determine host architecture!"
511+
fi
512+
513+
PKGNAME="microsoft-git_$VERSION"
514+
PKGDIR="$(dirname $(pwd))/$PKGNAME"
515+
516+
rm -rf "$PKGDIR"
517+
mkdir -p "$PKGDIR"
518+
519+
DESTDIR="$PKGDIR" make -C git -j5 V=1 DEVELOPER=1 \
520+
USE_LIBPCRE=1 \
521+
NO_CROSS_DIRECTORY_HARDLINKS=1 \
522+
ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 \
523+
ASCIIDOC='TZ=UTC asciidoc' \
524+
prefix=/usr/local \
525+
gitexecdir=/usr/local/lib/git-core \
526+
libexecdir=/usr/local/lib/git-core \
527+
htmldir=/usr/local/share/doc/git/html \
528+
install install-doc install-html
529+
530+
cd ..
531+
mkdir "$PKGNAME/DEBIAN"
532+
533+
# Based on https://packages.ubuntu.com/xenial/vcs/git
534+
cat >"$PKGNAME/DEBIAN/control" <<EOF
535+
Package: microsoft-git
536+
Version: $VERSION
537+
Section: vcs
538+
Priority: optional
539+
Architecture: $ARCH
540+
Depends: libcurl3-gnutls, liberror-perl, libexpat1, libpcre2-8-0, perl, perl-modules, zlib1g
541+
Maintainer: GitClient <gitclient@microsoft.com>
542+
Description: Git client built from the https://github.com/microsoft/git repository,
543+
specialized in supporting monorepo scenarios. Includes the Scalar CLI.
544+
EOF
545+
546+
dpkg-deb -Zxz --build "$PKGNAME"
547+
# Move Debian package for later artifact upload
548+
mv "$PKGNAME.deb" "$GITHUB_WORKSPACE"
549+
550+
- name: Upload artifacts
551+
uses: actions/upload-artifact@v4
552+
with:
553+
name: linux-artifacts
554+
path: |
555+
*.deb
556+
# End build unsigned Debian package

0 commit comments

Comments
 (0)