diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 690e368a3..f8822c8a5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -189,29 +189,26 @@ build_android_appbundle:
only:
- main
-upload-fdroid:
+fdroid_repo:
+ image: debian:testing
stage: release
before_script:
- - "which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )"
- - "which rsync || (sudo apt-get update -y && sudo apt-get install rsync -y )"
- - "which pcregrep || (sudo apt-get update -y && sudo apt-get install pcregrep -y )"
- - eval $(ssh-agent -s)
- - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- - mkdir -p ~/.ssh
- - chmod 700 ~/.ssh
- - ssh-keyscan -t rsa ssh.fdroid.nordgedanken.dev >> ~/.ssh/known_hosts
+ - apt-get update && apt-get -qy install fdroidserver wget curl jq --no-install-recommends
+ - ./scripts/prepare-fdroid.sh
script:
- - cd build/android/
- - export UPDATE_VERSION=$(pcregrep -o1 'version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*' ../../pubspec.yaml) && mv app-release.apk "${UPDATE_VERSION}.apk"
- - rsync -rav -e ssh ./ fluffy@ssh.fdroid.nordgedanken.dev:/opt/fdroid/fluffychat/repo
- - ssh fluffy@ssh.fdroid.nordgedanken.dev -t '/bin/bash -i -l -c "cd /opt/fdroid/fluffychat && source ../fdroidserver-env/bin/activate && fdroid update --verbose && deactivate"'
- needs: ["build_android_apk"]
+ - ./scripts/create_fdroid_repos.sh
+ artifacts:
+ when: always
+ paths:
+ - repo
+ needs:
+ - "build_android_debug"
resource_group: playstore_release
allow_failure: true
only:
- - tags
+ - main
-upload-fdroid-nightly:
+upload-fdroid:
stage: release
before_script:
- "which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )"
@@ -224,17 +221,19 @@ upload-fdroid-nightly:
- ssh-keyscan -t rsa ssh.fdroid.nordgedanken.dev >> ~/.ssh/known_hosts
script:
- cd build/android/
- - export UPDATE_VERSION=$(pcregrep -o1 'version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*' ../../pubspec.yaml) && mv app-release.apk "${UPDATE_VERSION}_$(date +%s).apk"
- - rsync -rav -e ssh ./ fluffy@ssh.fdroid.nordgedanken.dev:/opt/fdroid/fluffychat-nightly/repo
- - ssh fluffy@ssh.fdroid.nordgedanken.dev -t '/bin/bash -i -l -c "cd /opt/fdroid/fluffychat-nightly && source ../fdroidserver-env/bin/activate && fdroid update --verbose && deactivate"'
+ - export UPDATE_VERSION=$(pcregrep -o1 'version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*' ../../pubspec.yaml) && mv app-release.apk "${UPDATE_VERSION}.apk"
+ - rsync -rav -e ssh ./ fluffy@ssh.fdroid.nordgedanken.dev:/opt/fdroid/fluffychat/repo
+ - ssh fluffy@ssh.fdroid.nordgedanken.dev -t '/bin/bash -i -l -c "cd /opt/fdroid/fluffychat && source ../fdroidserver-env/bin/activate && fdroid update --verbose && deactivate"'
needs: ["build_android_apk"]
resource_group: playstore_release
allow_failure: true
only:
- - main
+ - tags
pages:
- needs: ["build_web"]
+ needs:
+ - "build_web"
+ - "fdroid_repo"
stage: deploy
image: node
script:
@@ -242,6 +241,7 @@ pages:
- npx tailwindcss -o ./tailwind.css --minify
- cd ..
- mv docs public
+ - mv repo public
- mv build/web/ public/web/
artifacts:
paths:
diff --git a/docs/fdroid_repo.md b/docs/fdroid_repo.md
index 45f126798..dc3d4e78f 100644
--- a/docs/fdroid_repo.md
+++ b/docs/fdroid_repo.md
@@ -5,11 +5,11 @@ are also published on it.
## Add Repository to F-Droid
-Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
+Easiest way to add the Repository is to either **scan the QR-Code** or if you are on your phone **directly click it**.
{::nomarkdown}
-
-
+
+
{:/}
@@ -24,7 +24,7 @@ If this still isn't working follow the next steps:
2. Go to the `Settings` Tab in the Bottom bar
3. Click the `Repositories` Action
4. Click on the plus sign at the top.
-5. Fill in `https://fdroid.fluffychat.im` into the top field and `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB` in the bottom field.
+5. Fill in `https://fluffychat.im/repo/stable/repo/` into the top field and `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB` in the bottom field.
## What is the fingerprint?
@@ -34,11 +34,11 @@ The fingerprint of the Repository is: `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3
## Add Repository to F-Droid
-Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
+Easiest way to add the Repository is to either **scan the QR-Code** or if you are on your phone **directly click** it.
{::nomarkdown}
-
-
+
+
{:/}
@@ -53,7 +53,7 @@ If this still isn't working follow the next steps:
2. Go to the `Settings` Tab in the Bottom bar
3. Click the `Repositories` Action
4. Click on the plus sign at the top.
-5. Fill in `https://nightly.fdroid.fluffychat.im` into the top field and `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D` in the bottom field.
+5. Fill in `https://fluffychat.im/repo/nightly/repo/` into the top field and `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D` in the bottom field.
## What is the fingerprint?
diff --git a/docs/index.html b/docs/index.html
index 482110f6e..d1f63be1e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -551,7 +551,7 @@
href="https://hosted.weblate.org/projects/fluffychat/">Translations
-
FluffyChat Nightly
+ href="https://gitlab.com/famedly/fluffychat/-/blob/main/docs/fdroid_repo.md">FluffyChat F-Droid repository
-
Donate
diff --git a/docs/qr-code-nightly.svg b/docs/qr-code-nightly.svg
deleted file mode 100644
index d36a2844b..000000000
--- a/docs/qr-code-nightly.svg
+++ /dev/null
@@ -1,3431 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/docs/qr-code.svg b/docs/qr-code.svg
deleted file mode 100644
index b12c1e587..000000000
--- a/docs/qr-code.svg
+++ /dev/null
@@ -1,2831 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/docs/qr-nightly.svg b/docs/qr-nightly.svg
new file mode 100644
index 000000000..cabc07a4b
--- /dev/null
+++ b/docs/qr-nightly.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/qr-stable.svg b/docs/qr-stable.svg
new file mode 100644
index 000000000..efb41aeaa
--- /dev/null
+++ b/docs/qr-stable.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/fdroid/.gitignore b/fdroid/.gitignore
new file mode 100644
index 000000000..5b807a9c7
--- /dev/null
+++ b/fdroid/.gitignore
@@ -0,0 +1,4 @@
+repo
+srclibs
+tmp
+chat.fluffy.fluffychat
\ No newline at end of file
diff --git a/fdroid/config.nightly.py b/fdroid/config.nightly.py
new file mode 100644
index 000000000..86fe4932c
--- /dev/null
+++ b/fdroid/config.nightly.py
@@ -0,0 +1,13 @@
+repo_url = "https://fluffychat.im/repo/nightly/repo"
+repo_name = "FluffyChat nightly repo"
+repo_icon = "fdroid-icon.png"
+repo_description = """
+FluffyChat nightly repo
+"""
+
+archive_older = 0
+
+local_copy_dir = "/fdroid"
+
+keystore = "key.nightly.jks"
+repo_keyalias = "vmd66783.contaboserver.net"
diff --git a/fdroid/config.stable.py b/fdroid/config.stable.py
new file mode 100644
index 000000000..0e10bdf34
--- /dev/null
+++ b/fdroid/config.stable.py
@@ -0,0 +1,13 @@
+repo_url = "https://fluffychat.im/repo/stable/repo"
+repo_name = "FluffyChat repo"
+repo_icon = "fdroid-icon.png"
+repo_description = """
+FluffyChat repo
+"""
+
+archive_older = 0
+
+local_copy_dir = "/fdroid"
+
+keystore = "key.jks"
+repo_keyalias = "key alias"
diff --git a/fdroid/fdroid-icon.png b/fdroid/fdroid-icon.png
new file mode 100644
index 000000000..0c0d41738
Binary files /dev/null and b/fdroid/fdroid-icon.png differ
diff --git a/fdroid/metadata/chat.fluffy.fluffychat.yml b/fdroid/metadata/chat.fluffy.fluffychat.yml
new file mode 100644
index 000000000..dc86bef7c
--- /dev/null
+++ b/fdroid/metadata/chat.fluffy.fluffychat.yml
@@ -0,0 +1,53 @@
+Categories:
+ - Internet
+ - Phone & SMS
+License: AGPL-3.0-only
+AuthorName: Famedly
+SourceCode: https://gitlab.com/famedly/fluffychat
+IssueTracker: https://gitlab.com/famedly/fluffychat/-/issues
+Translation: https://hosted.weblate.org/projects/fluffychat/
+Changelog: https://gitlab.com/ChristianPauly/fluffychat-flutter/-/blob/main/CHANGELOG.md
+
+AutoName: FluffyChat
+Summary: "Chat with your friends with FluffyChat.\n"
+Description: |
+ FluffyChat is an open, nonprofit and cute matrix messenger app for Ubuntu Touch, Android and iOS.
+
+ Open
+ Opensource and open development where everyone can join.
+
+ Nonprofit
+ FluffyChat is donation funded.
+
+ Cute ♥
+ Cute design and many theme settings including a dark mode.
+
+ One-to-one and groupchats
+ Unlimited groups and direct chats.
+
+ Easy
+ FluffyChat is made as simple to use as possible.
+
+ Free
+ Free to use for everyone without ads.
+
+ Decentralized
+ There is no "FluffyChat server" you are forced to use. Use the server you find trustworthy or host
+ your own.
+
+ Compatible
+ Compatible with Riot, Fractal, Nekho and all matrix messengers.
+
+
+ FluffyChat comes with a dream
+
+ Imagine a world where everyone can choose the messenger they like and is still able to chat with
+ all of their friends.
+ A world where there are no companies spying on you when you send selfies to friends and lovers.
+ And a world where apps are made for fluffyness and not for profit. ♥
+
+RepoType: git
+Repo: https://gitlab.com/famedly/fluffychat.git
+
+AutoUpdateMode: None
+UpdateCheckMode: None
diff --git a/scripts/create_fdroid_repos.sh b/scripts/create_fdroid_repos.sh
new file mode 100755
index 000000000..56bf533d0
--- /dev/null
+++ b/scripts/create_fdroid_repos.sh
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+GITLAB_PROJECT_ID="16112282"
+
+mkdir fdroid/repo
+mkdir repo
+
+git fetch
+
+cd fdroid
+
+# building nightly repo
+
+cp config.nightly.py config.py
+
+PIPELINES="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines\?ref=main\&status=success\&order_by=updated_at | jq '.[].id' | head -n3)"
+
+cp ../build/app/outputs/apk/debug/app-debug.apk repo/fluffychat-latest.apk
+
+for PIPELINE in $PIPELINES
+do
+ JOB="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/$PIPELINE/jobs | jq -r '.[] | select(.name == "build_android_apk").id')"
+ if [ -n $JOB ]; then
+ URI="https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/jobs/$JOB/artifacts/build/android/app-release.apk"
+ FILENAME="fluffychat-$PIPELINE.apk"
+ echo "Downloading $FILENAME from $URI ..."
+ wget --output-document="$FILENAME" "$URI"
+ mv "$FILENAME" repo
+ fi
+done
+
+fdroid update --rename-apks
+mkdir /fdroid && fdroid deploy
+rm -rf /fdroid
+cd .. && mkdir public && mv -v /fdroid repo/nightly
+
+
+# building stable + RC repo
+
+mkdir /fdroid
+
+cd fdroid
+rm -f repo/*.apk
+
+cp config.stable.py config.py
+
+PIPELINES="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines\?scope=tags\&status=success\&order_by=updated_at | jq '.[].id' | head -n3)"
+
+for PIPELINE in $PIPELINES
+do
+ JOB="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/$PIPELINE/jobs | jq -r '.[] | select(.name == "build_android_apk").id')"
+ if [ -n $JOB ]; then
+ URI="https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/jobs/$JOB/artifacts/build/android/app-release.apk"
+ FILENAME="fluffychat-$PIPELINE.apk"
+ echo "Downloading $FILENAME from $URI ..."
+ wget --output-document="$FILENAME" "$URI"
+ mv "$FILENAME" repo
+ fi
+done
+
+fdroid update --rename-apks
+mkdir /fdroid && fdroid deploy
+rm -rf /fdroid/archive
+cd .. && mv -v /fdroid repo/stable
diff --git a/scripts/prepare-fdroid.sh b/scripts/prepare-fdroid.sh
new file mode 100755
index 000000000..f9384b0f0
--- /dev/null
+++ b/scripts/prepare-fdroid.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+cp -r android/fastlane fdroid/metadata/chat.fluffy.fluffychat
+cd fdroid
+echo $FDROID_KEY | base64 --decode --ignore-garbage > key.jks
+echo $FDROID_NIGHTLY_KEY | base64 --decode --ignore-garbage > key.nightly.jks
+echo "keypass=\"${FDROID_KEY_PASS}\"" >> config.stable.py
+echo "keystorepass=\"${FDROID_KEY_PASS}\"" >> config.stable.py
+echo "keypass=\"${FDROID_NIGHTLY_KEY_PASS}\"" >> config.nightly.py
+echo "keystorepass=\"${FDROID_NIGHTLY_KEY_PASS}\"" >> config.nightly.py
+chmod 600 config.stable.py key.jks config.nightly.py key.nightly.jks
+cd ..