From 7f8af0928f6493d06b73fcbdbf83a02490b43a76 Mon Sep 17 00:00:00 2001
From: Nico <nicoalt@posteo.org>
Date: Thu, 20 Jan 2022 13:39:09 +0000
Subject: [PATCH] Build additional .debs for Ubuntu 18.04 and 20.04

---
 .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++----
 README.md      | 18 +++++++++++++-----
 2 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d025d7ecf5..27175c413b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -35,7 +35,7 @@ ktlint:
       when: always
     - when: always
 
-build_jar:
+b_jar:
   stage: build
   script:
     - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
@@ -48,15 +48,43 @@ build_jar:
   rules:
     - if: $CI_PIPELINE_SOURCE == "schedule"
 
-build_deb:
+b_bullseye_deb:
   stage: build
   script:
     - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
     - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 --no-daemon -PbuildType=nightly -x kaptKotlin packageDeb
-    - mv build/compose/binaries/main/deb/*.deb ./briar-desktop.deb
+    - mv build/compose/binaries/main/deb/*.deb ./briar-desktop-debian-bullseye.deb
   artifacts:
     paths:
-      - briar-desktop.deb
+      - briar-desktop-debian-bullseye.deb
+    expire_in: 2 days
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+
+b_20_ubuntu_deb:
+  image: briar/ci-image-android:ubuntu-20
+  stage: build
+  script:
+    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
+    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 --no-daemon -PbuildType=nightly -x kaptKotlin packageDeb
+    - mv build/compose/binaries/main/deb/*.deb ./briar-desktop-ubuntu-20.04.deb
+  artifacts:
+    paths:
+      - briar-desktop-ubuntu-20.04.deb
+    expire_in: 2 days
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+
+b_18_ubuntu_deb:
+  image: briar/ci-image-android:ubuntu-18
+  stage: build
+  script:
+    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
+    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 --no-daemon -PbuildType=nightly -x kaptKotlin packageDeb
+    - mv build/compose/binaries/main/deb/*.deb ./briar-desktop-ubuntu-18.04.deb
+  artifacts:
+    paths:
+      - briar-desktop-ubuntu-18.04.deb
     expire_in: 2 days
   rules:
     - if: $CI_PIPELINE_SOURCE == "schedule"
diff --git a/README.md b/README.md
index 309c3f3215..a07ca2971e 100644
--- a/README.md
+++ b/README.md
@@ -23,11 +23,19 @@ and execute it from the command-line with
 `java -jar briar-desktop.jar`.
 Note that you need at least version 11 of the Java Runtime Environment.
 
-### Self-contained Debian package
-
-For Debian based Linux distributions, a
-[self-contained .deb package](https://code.briarproject.org/briar/briar-desktop/-/jobs/artifacts/main/raw/briar-desktop.deb?job=build_deb)
-is available that ships its own JRE.
+### Self-contained .deb
+
+For Debian- and Ubuntu-based Linux distributions, a set of .deb files is available.
+Depending on which version of Debian/Ubuntu your OS is based on,
+you can choose the right .deb file:
+* [Ubuntu 20.04](https://code.briarproject.org/briar/briar-desktop/-/jobs/artifacts/main/raw/briar-desktop-ubuntu-20.04.deb?job=b_20_ubuntu_deb)
+* [Debian stable (bullseye)](https://code.briarproject.org/briar/briar-desktop/-/jobs/artifacts/main/raw/briar-desktop-debian-bullseye.deb?job=b_bullseye_deb)
+* [Ubuntu 18.04](https://code.briarproject.org/briar/briar-desktop/-/jobs/artifacts/main/raw/briar-desktop-ubuntu-18.04.deb?job=b_18_ubuntu_deb)
+
+Here are some examples of popular distributions and their respective .deb file:
+* Ubuntu 20.04 and compatible: Linux Mint 20.X (Ulyana, Ulyssa, Uma, Una), elementaryOS 6.X (Odin, Jólnir), Trisquel 10 (Nabia)
+* Debian stable (bullseye) and compatible: MX Linux MX-21
+* Ubuntu 18.04 and compatible: Linux Mint 19.X (Tara, Tessa, Tina, Tricia), elementaryOS 5.X (Juno, Hera), Trisquel 9 (Etiona)
 
 ## Developers
 
-- 
GitLab