6969 - name : Install basic dependencies in container
7070 run : |
7171 apt-get update
72- apt-get install -y curl git unzip xz-utils zip libglu1-mesa file jq cmake ninja-build pkg-config clang
72+ apt-get install -y curl git unzip xz-utils zip libglu1-mesa file jq cmake ninja-build pkg-config clang lld
7373
7474 - name : Checkout repository
7575 uses : actions/checkout@v4
@@ -231,7 +231,7 @@ jobs:
231231
232232 - name : Build signed Android APK
233233 run : |
234- flutter build apk --release -v
234+ flutter build apk --release -v --flavor ${{ github.ref_name }} --dart-define FLUTTER_FLAVOR=${{ github.ref_name }}
235235 echo "Built APKs:"
236236 ls -la build/app/outputs/flutter-apk/
237237 echo "All APK files in build:"
@@ -250,7 +250,21 @@ jobs:
250250 VERSION="$(echo -n "$VERSION" | tr -d '\r')"
251251 mkdir -p "dist/$VERSION"
252252
253- cp build/app/outputs/flutter-apk/app-release.apk "dist/$VERSION/floaty-${VERSION}-android.apk"
253+ APK_FLAVORED="build/app/outputs/flutter-apk/app-${{ github.ref_name }}-release.apk"
254+ APK_DEFAULT="build/app/outputs/flutter-apk/app-release.apk"
255+
256+ if [ -f "$APK_FLAVORED" ]; then
257+ cp "$APK_FLAVORED" "dist/$VERSION/floaty-${VERSION}-android.apk"
258+ echo "Copied flavored APK: $APK_FLAVORED"
259+ elif [ -f "$APK_DEFAULT" ]; then
260+ cp "$APK_DEFAULT" "dist/$VERSION/floaty-${VERSION}-android.apk"
261+ echo "Copied default APK: $APK_DEFAULT"
262+ else
263+ echo "Error: No APK found to copy"
264+ find build -name "*.apk" -type f || true
265+ exit 1
266+ fi
267+
254268 echo "APK prepared:"
255269 ls -la "dist/$VERSION/"
256270
@@ -297,8 +311,26 @@ jobs:
297311 - name : Build and release
298312 run : fastforge release --name ${{ github.ref_name }}macos
299313
314+ - name : Determine iOS flavor
315+ id : ios_flavor
316+ run : |
317+ BRANCH="${{ github.ref_name }}"
318+ if [[ "$BRANCH" == "release" ]]; then
319+ FLAVOR="production"
320+ elif [[ "$BRANCH" == "beta" ]]; then
321+ FLAVOR="beta"
322+ elif [[ "$BRANCH" == "nightly" ]]; then
323+ FLAVOR="nightly"
324+ elif [[ "$BRANCH" == "dev" ]]; then
325+ FLAVOR="development"
326+ else
327+ FLAVOR="nightly"
328+ fi
329+ echo "flavor=$FLAVOR" >> $GITHUB_OUTPUT
330+ echo "Building iOS with flavor: $FLAVOR"
331+
300332 - name : Build iOS app
301- run : flutter build ios --release --no-codesign
333+ run : flutter build ios --release --no-codesign --flavor ${{ steps.ios_flavor.outputs.flavor }} --dart-define FLUTTER_FLAVOR=${{ github.ref_name }}
302334
303335 - name : Get version from pubspec.yaml
304336 id : get_version
0 commit comments