diff --git a/.github/workflows/eas-build.yml b/.github/workflows/eas-build.yml new file mode 100644 index 0000000..dcb10c8 --- /dev/null +++ b/.github/workflows/eas-build.yml @@ -0,0 +1,74 @@ +name: EAS Production Build + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + production-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + + - name: Install EAS CLI + run: npm install -g eas-cli + + - name: Submit EAS Build + run: eas build --platform android --profile production --non-interactive --no-wait + env: + EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + + - name: Wait for build to finish and download APK + run: | + BUILD_ID="" + for i in $(seq 1 60); do + BUILD_JSON=$(eas build:list --json --platform android --limit 1 2>/dev/null || echo "") + if [ -n "$BUILD_JSON" ] && [ "$BUILD_JSON" != "[]" ]; then + BUILD_ID=$(echo "$BUILD_JSON" | jq -r '.[0].id // empty') + STATUS=$(echo "$BUILD_JSON" | jq -r '.[0].status // empty') + echo "Build status: $STATUS (attempt $i/60)" + if [ "$STATUS" = "finished" ]; then + echo "Build finished!" + break + elif [ "$STATUS" = "errored" ] || [ "$STATUS" = "cancelled" ]; then + echo "::error::Build $STATUS" + exit 1 + fi + fi + sleep 30 + done + + if [ -z "$BUILD_ID" ]; then + echo "::error::Build did not finish within the timeout period" + exit 1 + fi + + eas build:download "$BUILD_ID" --output app-release.apk + echo "artifact_path=app-release.apk" >> "$GITHUB_ENV" + env: + EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + + - name: Create GitHub Release + run: | + gh release create "${{ github.ref_name }}" \ + --title "Release ${{ github.ref_name }}" \ + --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload APK to Release + run: | + gh release upload "${{ github.ref_name }}" app-release.apk --clobber + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index cef6616..e10e570 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,26 @@ npx expo start --web --- +## 🚢 Release Process + +1. Ensure all changes are merged to `main`. +2. From `main`, run `npm version patch` (or `minor`/`major`) to bump the version and create a tag: + ```bash + git checkout main + git pull + npm version patch # creates v0.x.x locally + git push --tags + ``` +3. Pushing a `v*` tag triggers the [EAS Production Build](.github/workflows/eas-build.yml) workflow: + - Builds the Android APK via EAS Build (`production` profile) + - Creates a GitHub Release with auto-generated release notes + - Attaches the APK as a downloadable release asset +4. Monitor the build at [Actions → EAS Production Build](https://github.com/StepFi-app/StepFi-App/actions/workflows/eas-build.yml). + +> **Note:** The workflow requires the `EXPO_TOKEN` repository secret. Set it in **Settings → Secrets and variables → Actions → New repository secret** using a token from your [Expo access tokens settings](https://expo.dev/accounts/settings/access-tokens). + +--- + ## 🤝 Contributing We welcome React Native and Expo developers of all levels! See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, code style, and the PR process. diff --git a/context/progress-tracker.md b/context/progress-tracker.md index 33e1d01..40c17fa 100644 --- a/context/progress-tracker.md +++ b/context/progress-tracker.md @@ -53,6 +53,11 @@ Build all shared components from scratch using StepFi's dark theme design system - `app/(tabs)/_layout.tsx` — bottom Tabs (pay/invest/settings) with Lucide icons (`CreditCard`, `TrendingUp`, `Settings`), brand-green active tint - `app/(tabs)/pay.tsx`, `app/(tabs)/invest.tsx`, `app/(tabs)/settings.tsx` — placeholders +### CI / CD +- `.github/workflows/eas-build.yml` — automated EAS production build triggered on `v*` tag push; builds Android APK, creates GitHub Release, attaches APK as asset +- `eas.json` — production profile configured with `android.buildType: apk` +- `README.md` — release process documented under 🚢 Release Process + ### Verification - `npx expo export --platform web` — succeeded (2394 modules bundled, exit 0) @@ -92,6 +97,7 @@ Build all shared components from scratch using StepFi's dark theme design system ### Deployment 18. Expo preview build (EAS) 19. Netlify web build +20. EAS automated production build pipeline — GitHub Actions workflow triggered on `v*` tag push, builds APK via `eas build`, attaches to GitHub Release --- diff --git a/eas.json b/eas.json index 9b5ce2c..a23646b 100644 --- a/eas.json +++ b/eas.json @@ -12,7 +12,10 @@ "distribution": "internal" }, "production": { - "autoIncrement": true + "autoIncrement": true, + "android": { + "buildType": "apk" + } } }, "submit": {