From 41b5bbb226390f8a929ecd06b05e5509b8993eab Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 3 Dec 2023 19:14:54 -0800 Subject: [PATCH] add Launchpad PPA build Could it be this easy? There's no way it's this easy. Signed-off-by: Dirk Hohndel --- .github/workflows/fedora-copr-build.yml | 1 - .github/workflows/ubuntu-launchpad-build.yml | 47 ++++++++++++++++++++ packaging/ubuntu/debian/control | 3 +- packaging/ubuntu/make-package.sh | 7 ++- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ubuntu-launchpad-build.yml diff --git a/.github/workflows/fedora-copr-build.yml b/.github/workflows/fedora-copr-build.yml index 01015b6b3..56381914d 100644 --- a/.github/workflows/fedora-copr-build.yml +++ b/.github/workflows/fedora-copr-build.yml @@ -3,7 +3,6 @@ on: push: branches: - master - - github-action-test pull_request: branches: - master diff --git a/.github/workflows/ubuntu-launchpad-build.yml b/.github/workflows/ubuntu-launchpad-build.yml new file mode 100644 index 000000000..249998e2b --- /dev/null +++ b/.github/workflows/ubuntu-launchpad-build.yml @@ -0,0 +1,47 @@ +name: Ubuntu Launchpad Build +on: + push: + branches: + - master + - github-action-test + pull_request: + branches: + - master + +jobs: + push-to-ppa: + + name: Submit build to Ubuntu Launchpad + runs-on: ubuntu-latest + + steps: + - name: Check out sources + uses: actions/checkout@v1 + + - name: Setup build dependencies + run: | + sudo apt-get update + sudo apt-get install -y devscripts dput gpg debhelper qt5-qmake cmake + + - name: Setup gpg key token for launchpad + env: + GPG_PRIVATE_KEY: ${{ secrets.PPA_SECRET_KEY }} + run: | + echo "$GPG_PRIVATE_KEY" > ~/.key + gpg --import ~/.key + + - name: setup git + run: | + git config --global --add safe.directory /__w/subsurface/subsurface + git config --global --add safe.directory /__w/subsurface/subsurface/libdivecomputer + + - name: Checkout googlemaps + run: | + cd .. + git clone https://github.com/subsurface/googlemaps + + - name: run the launchpad make-package script + run: | + cd .. + bash -x subsurface/packaging/ubuntu/make-package.sh post + diff --git a/packaging/ubuntu/debian/control b/packaging/ubuntu/debian/control index e10eefefa..6099f7c4d 100644 --- a/packaging/ubuntu/debian/control +++ b/packaging/ubuntu/debian/control @@ -1,13 +1,14 @@ Source: subsurface Section: utils Priority: optional -Maintainer: Dirk Hohndel +Maintainer: Subsurface CI Bot Build-Depends: asciidoc, debhelper (>= 9), libgconf2-dev, libtool, libxml2-dev, libxslt-dev, + libgit2-dev, libsoup2.4-dev, pkg-config, txt2html, diff --git a/packaging/ubuntu/make-package.sh b/packaging/ubuntu/make-package.sh index 6ea93eedd..7fb61f71b 100644 --- a/packaging/ubuntu/make-package.sh +++ b/packaging/ubuntu/make-package.sh @@ -5,7 +5,7 @@ # it is included in our source tar file # -if [[ $(pwd | grep "subsurface$") || ! -d subsurface || ! -d subsurface/libdivecomputer ]] ; then +if [[ ! -d subsurface || ! -d subsurface/libdivecomputer ]] ; then echo "Please start this script from the folder ABOVE the subsurface source directory" exit 1; fi @@ -27,6 +27,9 @@ VERSION=$(echo $GITVERSION | sed -e 's/-/./') GITDATE=$(cd subsurface ; git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d) LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD) +export DEBSIGN_PROGRAM="gpg --passphrase-file passphrase_file.txt --batch --no-use-agent" +export DEBSIGN_KEYID="F58109E3" + if [[ "$GITVERSION" = "" ]] ; then SUFFIX=".release" else @@ -65,7 +68,7 @@ echo "preparing the debian directory" # this uses my (Dirk's) email address by default... simply set that variable in your # environment prior to starting the script -test -z $DEBEMAIL && export DEBEMAIL=dirk@hohndel.org +test -z $DEBEMAIL && export DEBEMAIL=dirk@subsurface-divelog.org # copy over the debian files and allow maintaining a release and daily changelog files rm -rf debian