Skip to content

Commit 680bd7b

Browse files
Kobikg78claude
andcommitted
fix: create dummy .env in CI to fix asset bundling failure
The example app declares .env as a Flutter asset (needed for flutter_dotenv), but .env is gitignored and not present in CI. This caused both Android and iOS builds to fail with "No file or variants found for asset: .env". Add a CI step to create a minimal dummy .env before each platform build. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2317776 commit 680bd7b

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,26 @@ jobs:
164164
working-directory: example
165165
run: flutter pub get
166166

167-
# Step 7: Build Android APK (debug mode)
167+
# Step 7: Create dummy .env file for CI (not committed to repo)
168+
- name: 🔑 Create dummy .env for CI build
169+
working-directory: example
170+
run: |
171+
echo "DEV_KEY=dummy_dev_key" > .env
172+
echo "APP_ID=dummy_app_id" >> .env
173+
174+
# Step 8: Build Android APK (debug mode)
168175
# This validates that the plugin integrates correctly with Android
169176
- name: 🔨 Build Android APK (debug)
170177
working-directory: example
171178
run: flutter build apk --debug
172179

173-
# Step 8: Build Android App Bundle (release mode, no signing)
180+
# Step 9: Build Android App Bundle (release mode, no signing)
174181
# App Bundle is the preferred format for Play Store
175182
- name: 🔨 Build Android App Bundle (release)
176183
working-directory: example
177184
run: flutter build appbundle --release
178-
179-
# Step 9: Upload build artifacts (optional)
185+
186+
# Step 10: Upload build artifacts (optional)
180187
# Useful for manual testing or archiving
181188
- name: 📤 Upload APK artifact
182189
if: success()
@@ -239,19 +246,26 @@ jobs:
239246
working-directory: example/ios
240247
run: pod install
241248

242-
# Step 8: Build for iOS Simulator (fastest iOS build)
249+
# Step 8: Create dummy .env file for CI (not committed to repo)
250+
- name: 🔑 Create dummy .env for CI build
251+
working-directory: example
252+
run: |
253+
echo "DEV_KEY=dummy_dev_key" > .env
254+
echo "APP_ID=dummy_app_id" >> .env
255+
256+
# Step 9: Build for iOS Simulator (fastest iOS build)
243257
# Validates that the plugin compiles for iOS
244258
- name: 🔨 Build iOS for Simulator
245259
working-directory: example
246260
run: flutter build ios --simulator --debug
247261

248-
# Step 9: Build iOS IPA without code signing (release mode)
262+
# Step 10: Build iOS IPA without code signing (release mode)
249263
# This validates a full release build without requiring certificates
250264
- name: 🔨 Build iOS IPA (no codesign)
251265
working-directory: example
252266
run: flutter build ipa --release --no-codesign
253-
254-
# Step 10: Upload build artifacts (optional)
267+
268+
# Step 11: Upload build artifacts (optional)
255269
- name: 📤 Upload iOS build artifact
256270
if: success()
257271
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)