Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -70,24 +79,40 @@ jobs:
with:
name: apk-release
path: ${{ env.APK_PATH }}
retention-days: 30

deploy_github_release:
name: Deploy to GitHub Release
runs-on: ubuntu-latest
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 }}
Comment on lines 84 to +118

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

actions/upload-artifact@v4 actions/download-artifact@v4 nested paths directory structure

💡 Result:

Short answer — how paths/structure work with actions/upload-artifact@v4 and actions/download-artifact@v4:

  • upload-artifact@v4

    • You give path(s) (file, dir, or glob). The action preserves the directory hierarchy relative to the upload root. If you pass multiple paths, the least common ancestor of those paths becomes the artifact root. If a glob contains a wildcard, the hierarchy is preserved only after the first wildcard (matching segments before the first wildcard are stripped). See README. [1]
  • download-artifact@v4

    • By default downloading multiple artifacts creates a subdirectory per artifact under the provided path (e.g., path/Artifact-A/... and path/Artifact-B/...). Use merge-multiple: true to merge contents of multiple artifacts into the same target directory. You can also download a single artifact by name or id to a specified path. v4 artifacts are job-scoped and not cross-compatible with v3/v2. See README and changelog. [2][3]

Examples

  • Upload a whole dir and preserve its tree:
    • upload path: my/dir/ -> artifact will contain my/dir/… relative structure. [1]
  • Upload with a glob that has a wildcard:
    • path/to//dir/.txt → uploaded files flattened to some/dir/foo.txt (segments before first * are removed). [1]
  • Download multiple artifacts into one folder:
    • download with merge-multiple: true and path: out/ → all artifact contents merged into out/. Otherwise each artifact gets its own subfolder. [2]

References

  1. actions/upload-artifact README (v4). [1]
  2. actions/download-artifact README / examples (v4). [2]
  3. GitHub Changelog — Artifacts v4 GA (notes on job-scoped artifacts and v4 incompatibility). [3]

🏁 Script executed:

# Find the build_android job to see how the artifact is uploaded
grep -A 50 "build_android:" .github/workflows/build_and_deploy.yml | head -80

Repository: AOSSIE-Org/Resonate

Length of output: 2058


🏁 Script executed:

# Check if pubspec.yaml is in the repository root
ls -la pubspec.yaml 2>/dev/null && echo "pubspec.yaml exists at root" || echo "pubspec.yaml not found at root"

Repository: AOSSIE-Org/Resonate

Length of output: 152


🏁 Script executed:

# Get the complete build_android job including the upload-artifact step
grep -A 150 "build_android:" .github/workflows/build_and_deploy.yml | grep -B 150 "deploy_github_release:" | head -100

Repository: AOSSIE-Org/Resonate

Length of output: 2721


Deploy job will fail: missing checkout for pubspec.yaml and incorrect APK artifact path.

The deploy_github_release job doesn't checkout the repository, causing the grep pubspec.yaml step to fail. Additionally, when build_android uploads build/app/outputs/flutter-apk/app-release.apk as a single file, download-artifact@v4 preserves the directory structure by default, placing the APK at build/app/outputs/flutter-apk/app-release.apk relative to the download path—not at the root. The APK_PATH: app-release.apk environment variable must be updated to reflect this.

  deploy_github_release:
    name: Deploy to GitHub Release
    runs-on: ubuntu-latest
    needs: build_android
    permissions:
      contents: write
    env:
-      APK_PATH: app-release.apk
+      APK_PATH: build/app/outputs/flutter-apk/app-release.apk
    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
       - name: Download APK artifact
         uses: actions/download-artifact@v4
         with:
           name: apk-release
           path: ./
🤖 Prompt for AI Agents
.github/workflows/build_and_deploy.yml lines 84-118: the deploy job fails
because it never checks out the repo before grepping pubspec.yaml and because
APK_PATH points to app-release.apk at repo root while download-artifact
preserves the original directory structure; add a checkout step (uses:
actions/checkout@v4) before the "Get version from pubspec.yaml" step so
pubspec.yaml is present, and update the env APK_PATH to the correct downloaded
location (build/app/outputs/flutter-apk/app-release.apk) so the release action
attaches the actual APK file.

11 changes: 9 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/store_deploy_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ on:
- main
- master
- deploy-actions
workflow_dispatch:

jobs:
store_deploy_android:
name: android store release
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -97,3 +112,4 @@ jobs:
packageName: com.resonate.resonate
releaseFiles: ${{ env.AAB_PATH }}
track: internal
status: completed
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ app.*.map.json
.vscode/
appwrite
ios/Runner/GoogleService-Info.plist
aossie-org-resonate-8a5edab282632443.txt
.github/instructions
Comment on lines +56 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Prefer a generalized ignore pattern (or add context) for the hash-like TXT file.
Ignoring a single specific filename is likely to go stale; consider ignoring a pattern (or adding a short comment explaining what generates it).

🤖 Prompt for AI Agents
In .gitignore around lines 56-57, the file
aossie-org-resonate-8a5edab282632443.txt is ignored by name which will become
stale; replace it with a generalized pattern such as aossie-org-resonate-*.txt
(or a regex-equivalent pattern) to catch future hash variants, or keep the
specific entry but add a short comment explaining what generates this filename
and why it's safe to ignore.