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:
@@ -132,9 +132,27 @@ jobs:
|
|||||||
-mkdir dev/fdroid/repo
|
-mkdir dev/fdroid/repo
|
||||||
SFTP
|
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.
|
# 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
|
- name: Copy new APK to repo
|
||||||
run: |
|
run: |
|
||||||
@@ -162,7 +180,6 @@ jobs:
|
|||||||
PASS: ${{ secrets.HETZNER_PASS }}
|
PASS: ${{ secrets.HETZNER_PASS }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
REMOTE_REPO_DIR="dev/fdroid/repo"
|
|
||||||
SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=20"
|
SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=20"
|
||||||
|
|
||||||
# Create remote directory tree via SFTP batch (no exec channel needed).
|
# Create remote directory tree via SFTP batch (no exec channel needed).
|
||||||
@@ -173,5 +190,6 @@ jobs:
|
|||||||
-mkdir dev/fdroid/repo
|
-mkdir dev/fdroid/repo
|
||||||
SFTP
|
SFTP
|
||||||
|
|
||||||
# Upload all files from fdroid/repo into the remote directory.
|
# Upload the entire fdroid/ directory (repo + keystore + config)
|
||||||
sshpass -p "$PASS" scp $SSH_OPTS -r fdroid/repo/. "$USER@$HOST:$REMOTE_REPO_DIR/"
|
# so the signing key persists across runs.
|
||||||
|
sshpass -p "$PASS" scp $SSH_OPTS -r fdroid/. "$USER@$HOST:dev/fdroid/"
|
||||||
|
|||||||
Reference in New Issue
Block a user