feat: build F-Droid repo in CI

- introduce F-Droid repo in CI/CD

Fixes: #994

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
krille/remove-custom-fonts
TheOneWithTheBraid 3 years ago
parent 972615f91d
commit 195b4a6b04

@ -189,29 +189,26 @@ build_android_appbundle:
only: only:
- main - main
upload-fdroid: fdroid_repo:
image: debian:testing
stage: release stage: release
before_script: before_script:
- "which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )" - apt-get update && apt-get -qy install fdroidserver wget curl jq --no-install-recommends
- "which rsync || (sudo apt-get update -y && sudo apt-get install rsync -y )" - ./scripts/prepare-fdroid.sh
- "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
script: script:
- cd build/android/ - ./scripts/create_fdroid_repos.sh
- export UPDATE_VERSION=$(pcregrep -o1 'version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*' ../../pubspec.yaml) && mv app-release.apk "${UPDATE_VERSION}.apk" artifacts:
- rsync -rav -e ssh ./ fluffy@ssh.fdroid.nordgedanken.dev:/opt/fdroid/fluffychat/repo when: always
- 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"' paths:
needs: ["build_android_apk"] - repo
needs:
- "build_android_debug"
resource_group: playstore_release resource_group: playstore_release
allow_failure: true allow_failure: true
only: only:
- tags - main
upload-fdroid-nightly: upload-fdroid:
stage: release stage: release
before_script: before_script:
- "which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )" - "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 - ssh-keyscan -t rsa ssh.fdroid.nordgedanken.dev >> ~/.ssh/known_hosts
script: script:
- cd build/android/ - 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" - 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-nightly/repo - 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-nightly && source ../fdroidserver-env/bin/activate && fdroid update --verbose && deactivate"' - 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"] needs: ["build_android_apk"]
resource_group: playstore_release resource_group: playstore_release
allow_failure: true allow_failure: true
only: only:
- main - tags
pages: pages:
needs: ["build_web"] needs:
- "build_web"
- "fdroid_repo"
stage: deploy stage: deploy
image: node image: node
script: script:
@ -242,6 +241,7 @@ pages:
- npx tailwindcss -o ./tailwind.css --minify - npx tailwindcss -o ./tailwind.css --minify
- cd .. - cd ..
- mv docs public - mv docs public
- mv repo public
- mv build/web/ public/web/ - mv build/web/ public/web/
artifacts: artifacts:
paths: paths:

@ -5,11 +5,11 @@ are also published on it.
## Add Repository to F-Droid ## 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} {::nomarkdown}
<a href="fdroidrepos://fdroid.fluffychat.im/?fingerprint=8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB" > <a href="fdroidrepos://fluffychat.im/repo/stable/repo/?fingerprint=8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB" >
<img src="qr-code.svg" width="300" height="300"/> <img src="qr-stable.svg" width="300" height="300"/>
</a> </a>
{:/} {:/}
@ -24,7 +24,7 @@ If this still isn't working follow the next steps:
2. Go to the `Settings` Tab in the Bottom bar 2. Go to the `Settings` Tab in the Bottom bar
3. Click the `Repositories` Action 3. Click the `Repositories` Action
4. Click on the plus sign at the top. 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? ## What is the fingerprint?
@ -34,11 +34,11 @@ The fingerprint of the Repository is: `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3
## Add Repository to F-Droid ## 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} {::nomarkdown}
<a href="fdroidrepos://nightly.fdroid.fluffychat.im/?fingerprint=21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D" > <a href="fdroidrepos://fluffychat.im/repo/nightly/repo/?fingerprint=21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D" >
<img src="qr-code-nightly.svg" width="300" height="300"/> <img src="qr-nightly.svg" width="300" height="300"/>
</a> </a>
{:/} {:/}
@ -53,7 +53,7 @@ If this still isn't working follow the next steps:
2. Go to the `Settings` Tab in the Bottom bar 2. Go to the `Settings` Tab in the Bottom bar
3. Click the `Repositories` Action 3. Click the `Repositories` Action
4. Click on the plus sign at the top. 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? ## What is the fingerprint?

@ -551,7 +551,7 @@
href="https://hosted.weblate.org/projects/fluffychat/">Translations</a> href="https://hosted.weblate.org/projects/fluffychat/">Translations</a>
- -
<a class="text-gray-500 no-underline hover:text-purple-800" <a class="text-gray-500 no-underline hover:text-purple-800"
href="https://gitlab.com/famedly/fluffychat/-/blob/main/docs/fdroid_repo.md">FluffyChat Nightly</a> href="https://gitlab.com/famedly/fluffychat/-/blob/main/docs/fdroid_repo.md">FluffyChat F-Droid repository</a>
- -
<a class="text-gray-500 no-underline hover:text-purple-800" <a class="text-gray-500 no-underline hover:text-purple-800"
href="https://liberapay.com/KrilleChritzelius/donate">Donate</a> href="https://liberapay.com/KrilleChritzelius/donate">Donate</a>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 263 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 225 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 82 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 84 KiB

4
fdroid/.gitignore vendored

@ -0,0 +1,4 @@
repo
srclibs
tmp
chat.fluffy.fluffychat

@ -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"

@ -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"

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -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

@ -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

@ -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 ..
Loading…
Cancel
Save