-
Notifications
You must be signed in to change notification settings - Fork 1
added the build part #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d6af7ca
c961865
2f8371b
e5ba98e
dfdfa13
bdf80c7
327dcd0
4dc9b8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,3 +69,38 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: TypeScript type check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npx tsc --noEmit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [lint, format, typecheck] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup pnpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: pnpm/action-setup@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: 10.12.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Ensure EAS CLI available | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm dlx eas-cli@latest --version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build Android APK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: env.EXPO_TOKEN != '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download Android APK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: env.EXPO_TOKEN != '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+92
to
+99
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm dlx eas-cli@latest --version | |
| # No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically | |
| - name: Build Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| run: pnpm dlx eas-cli@6.3.0 --version | |
| # No explicit login needed, Expo CLI uses EXPO_TOKEN env automatically | |
| - name: Build Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@6.3.0 build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@6.3.0 build:download --platform android --profile preview --latest --path ./app.apk |
Copilot
AI
Aug 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact |
Copilot
AI
Aug 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact | |
| if: env.EXPO_TOKEN != '' | |
| if: env.HAS_EXPO_TOKEN == 'true' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.HAS_EXPO_TOKEN == 'true' | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact | |
| if: env.HAS_EXPO_TOKEN == 'true' |
Copilot
AI
Aug 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition 'env.EXPO_TOKEN != ''' is repeated three times. Consider using a job-level condition or extracting this to a reusable condition to reduce duplication.
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact | |
| if: env.EXPO_TOKEN != '' | |
| run: pnpm dlx eas-cli@latest build --platform android --non-interactive --profile preview --clear-cache --wait | |
| - name: Download Android APK | |
| run: pnpm dlx eas-cli@latest build:download --platform android --profile preview --latest --path ./app.apk | |
| # ...existing code... | |
| - name: Upload Android artifact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid --latest; tie download to the build you just triggered
--latest can fetch an unrelated artifact from another commit/branch. The previous diff captures BUILD_ID and downloads that exact build.
🤖 Prompt for AI Agents
.github/workflows/expo-build.yml lines 99-106: the workflow currently uses
`--latest` when running `eas-cli build:download`, which can retrieve an
unrelated artifact; change the command to download the exact build by using the
BUILD_ID captured earlier (e.g., replace `--latest` with `--id ${{ env.BUILD_ID
}}` or the equivalent environment variable you set), keeping the platform,
profile and path flags intact so the download step deterministically fetches the
build you just triggered.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // Inject core-splashscreen dependency to fix Android resource linking errors for Theme.SplashScreen | ||
| // This runs during EAS prebuild and modifies android/app/build.gradle | ||
| const { | ||
| withAppBuildGradle, | ||
| createRunOncePlugin, | ||
| WarningAggregator, | ||
| } = require("@expo/config-plugins"); | ||
|
|
||
| const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")'; | ||
| const EXPO_AGG_LINE = 'implementation(project(":expo"))'; | ||
|
|
||
| function ensureDependency(contents) { | ||
| // If gradle file isn't available during introspection, just return as-is. | ||
| if (typeof contents !== "string") return contents; | ||
| const hasDepsBlock = /dependencies\s*\{/m.test(contents); | ||
| if (!hasDepsBlock) return contents; | ||
|
|
||
| let updated = contents; | ||
| // Ensure the :expo aggregator project is present so expo.* classes resolve | ||
| if (!updated.includes(EXPO_AGG_LINE)) { | ||
| updated = updated.replace( | ||
| /dependencies\s*\{/m, | ||
| (match) => `${match}\n ${EXPO_AGG_LINE}`, | ||
| ); | ||
| } | ||
| // Ensure the splashscreen dependency is present | ||
| if (!updated.includes(DEP_LINE)) { | ||
| updated = updated.replace( | ||
| /dependencies\s*\{/m, | ||
| (match) => `${match}\n ${DEP_LINE}`, | ||
| ); | ||
| } | ||
|
|
||
| return updated; | ||
| } | ||
|
|
||
| const withCoreSplashscreenDependency = (config) => | ||
| withAppBuildGradle(config, (config) => { | ||
| try { | ||
| const updated = ensureDependency(config.modResults?.contents); | ||
| if (typeof updated === "string") { | ||
| config.modResults.contents = updated; | ||
| } else { | ||
| // During introspection (e.g., EAS Read app config) the file may not exist yet. | ||
| WarningAggregator.addWarningAndroid( | ||
| "core-splashscreen", | ||
| "Skipped adding androidx.core:core-splashscreen; app/build.gradle not available during introspection.", | ||
| ); | ||
| } | ||
| } catch (e) { | ||
| WarningAggregator.addWarningAndroid( | ||
| "core-splashscreen", | ||
| `Failed to add androidx.core:core-splashscreen dependency: ${e?.message ?? e}`, | ||
| ); | ||
| } | ||
| return config; | ||
| }); | ||
|
|
||
| // module exp | ||
| module.exports = createRunOncePlugin( | ||
| withCoreSplashscreenDependency, | ||
| "with-core-splashscreen-dependency", | ||
| "1.0.0", | ||
| ); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EAS CLI version is not pinned, using '@latest' which could lead to unexpected behavior if breaking changes are introduced. Consider pinning to a specific version for reproducible builds.