From af7dfce36888c0a7ab6afec05ca50c4f12c2f649 Mon Sep 17 00:00:00 2001 From: dimension-drifter Date: Sat, 13 Dec 2025 10:41:17 +0530 Subject: [PATCH] BUG: update workflow configurations for builds --- .github/workflows/build_and_deploy.yml | 31 +++++++++++++++++++--- .github/workflows/run_tests.yml | 11 ++++++-- .github/workflows/store_deploy_android.yml | 20 ++++++++++++-- .gitignore | 2 ++ 4 files changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 48deace9..9cb6ef1e 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -12,8 +12,8 @@ jobs: name: Build Android APK runs-on: ubuntu-latest env: - JAVA_VERSION: 21.0.6 - FLUTTER_VERSION: 3.35.2 + JAVA_VERSION: "21" + FLUTTER_VERSION: "3.27.2" APK_PATH: build/app/outputs/flutter-apk/app-release.apk KEYSTORE_PATH: android/upload-keystore.jks KEY_PROPS_PATH: android/key.properties @@ -37,6 +37,15 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + + - name: Create local.properties + run: | + echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties + echo "flutter.sdk=$FLUTTER_ROOT" >> android/local.properties + echo "flutter.buildMode=release" >> android/local.properties + echo "flutter.versionName=${{ github.ref_name }}" >> android/local.properties + echo "flutter.versionCode=${{ github.run_number }}" >> android/local.properties - name: Decode Android keystore run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }} @@ -70,6 +79,7 @@ jobs: with: name: apk-release path: ${{ env.APK_PATH }} + retention-days: 30 deploy_github_release: name: Deploy to GitHub Release @@ -77,17 +87,32 @@ jobs: needs: build_android permissions: contents: write + env: + APK_PATH: app-release.apk steps: - name: Download APK artifact uses: actions/download-artifact@v4 with: name: apk-release + path: ./ + + - name: Get version from pubspec.yaml + id: version + run: | + VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + echo "version=$VERSION" >> $GITHUB_OUTPUT + if: github.event_name == 'push' - name: Deploy to GitHub Release uses: ncipollo/release-action@v1.14.0 with: allowUpdates: true artifacts: ${{ env.APK_PATH }} - artifactContentType: apk + artifactContentType: application/vnd.android.package-archive generateReleaseNotes: true tag: latest_build + name: Latest Build + body: | + Latest build from ${{ github.ref_name }} branch + Commit: ${{ github.sha }} + Build Number: ${{ github.run_number }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 9ce72106..1f9b8319 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -17,8 +17,8 @@ jobs: runs-on: ubuntu-latest env: # Setup env variables that will be used throughout the workflow - JAVA_VERSION: 21.0.6 - FLUTTER_VERSION: 3.35.2 + JAVA_VERSION: "21" + FLUTTER_VERSION: "3.27.2" steps: # Checkout repository codebase - name: Checkout the code @@ -36,6 +36,13 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + + # Create local.properties file required by Gradle + - name: Create local.properties + run: | + echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties + echo "flutter.sdk=$FLUTTER_ROOT" >> android/local.properties - name: 📦 Install dependencies run: flutter pub get diff --git a/.github/workflows/store_deploy_android.yml b/.github/workflows/store_deploy_android.yml index 9ce27545..c58b215f 100644 --- a/.github/workflows/store_deploy_android.yml +++ b/.github/workflows/store_deploy_android.yml @@ -8,6 +8,7 @@ on: - main - master - deploy-actions + workflow_dispatch: jobs: store_deploy_android: @@ -15,8 +16,8 @@ jobs: runs-on: ubuntu-latest env: # Setup env variables that will be used throughout the workflow - JAVA_VERSION: 21.0.6 - FLUTTER_VERSION: 3.35.2 + JAVA_VERSION: "21" + FLUTTER_VERSION: "3.27.2" AAB_PATH: build/app/outputs/bundle/release/app-release.aab KEYSTORE_PATH: android/upload-keystore.jks KEY_PROPS_PATH: android/key.properties @@ -44,6 +45,19 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + + # Create local.properties file required by Gradle + - name: Create local.properties + run: | + echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties + echo "flutter.sdk=$FLUTTER_ROOT" >> android/local.properties + echo "flutter.buildMode=release" >> android/local.properties + PUBSPEC_VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + VERSION_NAME=$(echo $PUBSPEC_VERSION | cut -d '+' -f 1) + VERSION_CODE=$(echo $PUBSPEC_VERSION | cut -d '+' -f 2) + echo "flutter.versionName=$VERSION_NAME" >> android/local.properties + echo "flutter.versionCode=$VERSION_CODE" >> android/local.properties # Decode Android env variables - name: Decode Android keystore @@ -88,6 +102,7 @@ jobs: with: name: aab-stores path: ${{ env.AAB_PATH }} + retention-days: 30 # Deploy bundle to Google Play internal testing - name: Deploy to Play Store (Internal testing) @@ -97,3 +112,4 @@ jobs: packageName: com.resonate.resonate releaseFiles: ${{ env.AAB_PATH }} track: internal + status: completed diff --git a/.gitignore b/.gitignore index 1defeb28..7bd72d01 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,5 @@ app.*.map.json .vscode/ appwrite ios/Runner/GoogleService-Info.plist +aossie-org-resonate-8a5edab282632443.txt +.github/instructions \ No newline at end of file