1- name : Fdroid Repo Update
1+ name : Nightly F-Droid CI
22
33on :
44 push :
55 branches :
66 - fdroid-repo
77
88jobs :
9- build :
9+ deploy-changes :
10+ name : Deploy Changes
1011 runs-on : ubuntu-latest
1112
1213 steps :
13- # Step 1: Checkout the main branch
14- - name : Checkout Fdroid-repo Branch
15- uses : actions/checkout@v2
16- with :
17- ref : fdroid-repo
18- fetch-depth : 0
19-
14+ # Step 1: Checkout is REQUIRED to access the APKs and repo files
15+ - name : Checkout Code
16+ uses : actions/checkout@v4
2017
21- # Step 2: Setup Java with version 17.x
22- - name : Setup Java
23- uses : actions/setup-java@v1
18+ # Step 2: Java is REQUIRED for keystore operations and apksigner
19+ - uses : actions/setup-java@v4
2420 with :
21+ distribution : " temurin"
2522 java-version : " 17.x"
2623
27- # Step 3: Setup F-Droid (install fdroidserver) and update the repo
28- - name : Fdroid Install
29- uses : subosito/flutter-action@v1
24+ # Step 3: Run F-Droid Update
3025 - name : Run F-Droid Update
3126 env :
3227 FDROID_CONFIG_YML_B64 : ${{ secrets.FDROID_CONFIG_YML }}
@@ -40,15 +35,25 @@ jobs:
4035 sudo apt-get update
4136 sudo apt-get install -y fdroidserver
4237
43- # Run the update command, referencing the files
38+ # Run the update command (updates index.xml based on current APKs)
4439 fdroid update -c
4540
46- # Step 4: Push the updated repo files with amended commit
41+ # Step 4: Push with Zero Bloat (Orphan Branch Strategy)
4742 - name : Push F-Droid updates
4843 run : |
49- git config user.name "github-actions[bot]"
50- git config user.email "github-actions[bot]@users.noreply.github.com"
44+ git config --global user.name "github-actions[bot]"
45+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
46+
47+ # 1. Create a temporary orphan branch (fresh start, no history)
48+ # This keeps the current files (APKs + updated index) but removes the commit history links
49+ git checkout --orphan temp_update_branch
5150
51+ # 2. Add all files currently on disk
5252 git add .
53- git commit -m "chore:${{ github.run_number }} update F-Droid metadata" || echo "No changes to commit"
54- git push origin fdroid-repo
53+
54+ # 3. Create a new 'Initial Commit'
55+ git commit -m "chore: Update F-Droid index ${{ github.run_number }}"
56+
57+ # 4. Force push this new state to overwrite fdroid-repo
58+ # The branch will now have exactly 1 commit total.
59+ git push origin temp_update_branch:fdroid-repo --force
0 commit comments