Set up F-Droid server in the fdroid_nightly CI to generate metadata…
#28
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish fdroid nightly build | |
| # This workflow is triggered on a schedule or when specific tags are pushed. | |
| # It runs every Monday at 12:00 UTC and also when the 'fdroid_nightly' tag is pushed. | |
| on: | |
| push: | |
| tags: | |
| - 'fdroid_nightly' # fdroid_nightly Tag | |
| schedule: | |
| - cron: '0 12 * * 1' # Runs every Monday at 12:00 | |
| jobs: | |
| nightly: | |
| name: Publish nightly build | |
| runs-on: ubuntu-22.04 | |
| environment: nightly | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Decrypt files | |
| env: | |
| KEYSTORE: ${{ secrets.keystore }} | |
| SSH_KEY: ${{ secrets.ssh_key }} | |
| run: | | |
| echo "$KEYSTORE" | base64 -d > kiwix-android.keystore | |
| echo "$SSH_KEY" | base64 -d > ssh_key | |
| chmod 600 ssh_key | |
| - name: Build nightly APK | |
| env: | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| APK_BUILD: "true" | |
| run: | | |
| ./gradlew assembleNightly | |
| - name: Set date variable | |
| run: echo "DATE=$(echo $(date +%Y-%m-%d))" >> $GITHUB_ENV | |
| - name: Install fdroidserver | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fdroidserver | |
| - name: Prepare F-Droid repo | |
| env: | |
| UNIVERSAL_DEBUG_APK: app/build/outputs/apk/nightly/*universal*.apk | |
| KIWIX_ICON: app/src/main/kiwix_icon-web.png | |
| run: | | |
| mkdir -p fdroid/repo/icons | |
| cp $UNIVERSAL_DEBUG_APK fdroid/repo/ | |
| cp "$KIWIX_ICON" fdroid/repo/icons/icon.png | |
| cd fdroid/repo | |
| fdroid update --create-metadata --nosign | |
| - name: release fdroid nightly to kiwix.download.org | |
| run: | | |
| scp -P 30022 -vrp -i ssh_key -o StrictHostKeyChecking=no fdroid [email protected]:/data/download/fdroid/ |