Improved the CI as androguard is not found in fdroid server.
#31
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 fdroid nightly build | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-22.04 | |
| environment: nightly | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - 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: Install F-Droid server and dependencies | |
| run: | | |
| # Install F-Droid server package | |
| sudo apt-get update | |
| sudo apt-get install -y python3 python3-pip fdroidserver | |
| # Install the latest stable version of Androguard via pip | |
| # This is required to correctly parse modern APK resources (resources.arsc) | |
| python3 -m pip install --upgrade androguard | |
| - 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 | |
| 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/ |