diff options
author | Pierre Ossman <ossman@cendio.se> | 2021-06-07 17:09:15 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2021-06-08 11:17:16 +0200 |
commit | abcabc5a9ee3e34935c03676aa8d9451fe8f47d0 (patch) | |
tree | 748ecc25d680fb51915c5764995fa6e526446592 /.github/containers/focal | |
parent | 8616c0bd67d7c393c30816d1a72edd477514afce (diff) | |
download | tigervnc-abcabc5a9ee3e34935c03676aa8d9451fe8f47d0.tar.gz tigervnc-abcabc5a9ee3e34935c03676aa8d9451fe8f47d0.zip |
Convert CI to GitHub Actions
Travis has unfortunately been severely rate limited by Docker Hub so we
have to switch to GitHub, which has an agreement with Docker to avoid
the rate limiting.
Diffstat (limited to '.github/containers/focal')
-rw-r--r-- | .github/containers/focal/Dockerfile | 13 | ||||
-rwxr-xr-x | .github/containers/focal/build.sh | 55 |
2 files changed, 68 insertions, 0 deletions
diff --git a/.github/containers/focal/Dockerfile b/.github/containers/focal/Dockerfile new file mode 100644 index 00000000..7fea0d10 --- /dev/null +++ b/.github/containers/focal/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:focal + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update +RUN apt-get -y install packaging-dev equivs + +RUN useradd -s /bin/bash -m deb +RUN echo >> /etc/sudoers +RUN echo "deb ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +USER deb +WORKDIR /home/deb diff --git a/.github/containers/focal/build.sh b/.github/containers/focal/build.sh new file mode 100755 index 00000000..3b68e70f --- /dev/null +++ b/.github/containers/focal/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -e +set -x + +## Basic variables + +CURDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) + +DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-focal + +VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') + +## Prepare the build directory + +rm -rf ${CURDIR}/build +mkdir -p ${CURDIR}/build +chmod a+w ${CURDIR}/build +[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/build + +## Copy over the source code + +(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | xz > ${CURDIR}/build/tigervnc_${VERSION}.orig.tar.xz + +## Copy over the packaging files + +cp -r ${DEBDIR}/debian ${CURDIR}/build/debian + +chmod a+x ${CURDIR}/build/debian/rules + +# Assemble a fake changelog entry to get the correct version + +cat - > ${CURDIR}/build/debian/changelog << EOT +tigervnc (${VERSION}-1ubuntu1) UNRELEASED; urgency=low + + * Automated build for TigerVNC + + -- Build bot <tigervncbot@tigervnc.org> $(date -R) + +EOT +cat ${DEBDIR}/debian/changelog >> ${CURDIR}/build/debian/changelog + +## Start the build + +docker run --volume ${CURDIR}/build:/home/deb/build --interactive --rm tigervnc/${DOCKER} \ + bash -c " + tar -C ~/build -axf ~/build/tigervnc_${VERSION}.orig.tar.xz && + cp -a ~/build/debian ~/build/tigervnc-${VERSION}/debian && + mk-build-deps ~/build/tigervnc-${VERSION}/debian/control && + sudo dpkg --unpack ~/tigervnc-build-deps_*.deb && + sudo apt-get update && + sudo apt-get -f install -y && + cd ~/build/tigervnc-${VERSION} && dpkg-buildpackage + " |