chore(release): improve F-Droid release workflow for repo persistence

- Download entire `fdroid/` directory from Hetzner to retain older APKs, repo keystore, and config.yml.
- Add steps to ensure repo signing key and icons during initialization.
- Adjust SCP upload to include the entire `fdroid/` directory for better state continuity.
This commit is contained in:
2026-03-16 22:13:32 +01:00
parent 7a2c1b81de
commit 2a4b14cb43

View File

@@ -132,9 +132,27 @@ jobs:
-mkdir dev/fdroid/repo
SFTP
# Try to download the existing repo/ folder from Hetzner to keep older versions and the keystore.
# Try to download the entire fdroid/ directory from Hetzner to keep
# older APKs, the repo keystore, and config.yml across runs.
# If it fails (first time), initialize a new local repo.
sshpass -p "$PASS" scp -o StrictHostKeyChecking=no -r "$USER@$HOST:dev/fdroid/repo" fdroid/ || (cd fdroid && fdroid init)
sshpass -p "$PASS" scp -o StrictHostKeyChecking=no -r "$USER@$HOST:dev/fdroid/." fdroid/ || (cd fdroid && fdroid init)
- name: Ensure F-Droid repo signing key and icon
run: |
cd fdroid
# Ensure repo icon exists (use app launcher icon)
mkdir -p repo/icons
if [ ! -f repo/icons/icon.png ]; then
cp ../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png repo/icons/icon.png
fi
# If keystore doesn't exist, create the signing key.
# This only runs on the very first deployment; subsequent runs
# download the keystore from Hetzner via the scp step above.
if [ ! -f keystore.p12 ]; then
fdroid update --create-key
fi
- name: Copy new APK to repo
run: |
@@ -162,7 +180,6 @@ jobs:
PASS: ${{ secrets.HETZNER_PASS }}
run: |
set -euo pipefail
REMOTE_REPO_DIR="dev/fdroid/repo"
SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=20"
# Create remote directory tree via SFTP batch (no exec channel needed).
@@ -173,5 +190,6 @@ jobs:
-mkdir dev/fdroid/repo
SFTP
# Upload all files from fdroid/repo into the remote directory.
sshpass -p "$PASS" scp $SSH_OPTS -r fdroid/repo/. "$USER@$HOST:$REMOTE_REPO_DIR/"
# Upload the entire fdroid/ directory (repo + keystore + config)
# so the signing key persists across runs.
sshpass -p "$PASS" scp $SSH_OPTS -r fdroid/. "$USER@$HOST:dev/fdroid/"