Skip to content

nightly update fix check #4

nightly update fix check

nightly update fix check #4

name: Nightly F-Droid CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the main branch
- name: Checkout Main Branch
uses: actions/checkout@v2
with:
fetch-depth: 0
# Step 2: Setup Java with version 17.x
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "17.x"
# Step 3: Setup Flutter with version 3.29.2
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: "3.29.2"
# Step 4: Get dependencies
- name: Get dependencies
run: flutter pub get
# Step 6: Build APK
- name: Build APK
run: flutter build apk --build-number=${{ github.run_number }} --release
# No 'mv' command here yet
# Step 7: Push the APK to the fdroid-repo branch
- name: Configure and push to fdroid-repo
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin fdroid-repo:fdroid-repo
git checkout fdroid-repo
mkdir -p repo
# Don't remove the old APK!
# Copy the new APK with a unique name
mv build/app/outputs/flutter-apk/app-release.apk repo/com.ccextractor.taskwarriorflutter_${{ github.run_number }}.apk
git add repo/
git commit -m "chore: Add new APK from build ${{ github.run_number }}"
# You can push here, or wait until after the fdroid update
# git push origin fdroid-repo
# Step 8: Setup f-droid and run update
- name: Setup F-Droid
uses: subosito/flutter-action@v1 # A common action, but you'll need to install fdroidserver
- name: Run F-Droid Update
env:
FDROID_CONFIG_YML_B64: ${{ secrets.FDROID_CONFIG_YML }}
FDROID_KEYSTORE_P12_B64: ${{ secrets.FDROID_KEYSTORE_P12 }}
run: |
# Decode the secrets into files
echo $FDROID_CONFIG_YML_B64 | base64 --decode > config.yml
echo $FDROID_KEYSTORE_P12_B64 | base64 --decode > keystore.p12
# Install fdroidserver
sudo apt-get update
sudo apt-get install -y fdroidserver
# Run the update command, referencing the files
fdroid update -c
# Step 9: Push the updated repo files
- name: Push F-Droid updates
run: |
git add .
git commit -m "feat: F-Droid repo update n:${{ github.run_number }}"
git push origin fdroid-repo