Commit 42bdcb9

derdilla <82763757+derdilla@users.noreply.github.com>
2025-07-05 06:59:52
Make CI run on F-Droids flutter version (#569)
* Use the flutter version in the apps pubspec.yaml for ci * fix syntax * update flutter version
1 parent 604db83
Changed files (2)
.github
workflows
app
.github/workflows/app-CI.yml
@@ -39,10 +39,21 @@ jobs:
         if: steps.cache-generated.outputs.cache-hit != 'true'
         run: dart run build_runner build
         working-directory: health_data_store
+      - name: Extract Flutter version
+        id: get_version
+        run: |
+          # This is the same function f-droid uses to ensure their builds keep succeeding:
+          # https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.derdilla.bloodPressureApp.yml
+          VERSION=$(sed -n -E "s/.*flutter:\s*'(.*)'/\1/p" app/pubspec.yaml)
+          if [ -z "$VERSION" ]; then
+            echo "Error: Could not find a Flutter version specified in app/pubspec.yaml."
+            exit 1
+          fi
+          echo "version=$VERSION" >> $GITHUB_OUTPUT
       - name: Setup Flutter
         uses: subosito/flutter-action@v2
         with:
-          channel: ${{ matrix.channel }}
+          flutter-version: ${{ steps.get_version.outputs.version }}
           cache: true
       - name: Disable analytics
         run:
app/pubspec.yaml
@@ -8,7 +8,7 @@ version: 1.8.7+49
 
 environment:
   sdk: '>=3.0.2 <4.0.0'
-  flutter: '3.29.2'
+  flutter: '3.32.5'
 
 dependencies:
   collection: ^1.19.1