diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6f429b1 --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# Build mobile — environment variables +# Copy to .env.local for local overrides (never commit .env.local) + +# API endpoints (defaults to production; override for local dev) +EXPO_PUBLIC_API_URL=https://build.interactor.com +EXPO_PUBLIC_ACCOUNT_SERVER_URL=https://auth.interactor.com + +# EAS CI token — set in GitHub Actions secrets, never commit +# EXPO_ACCESS_TOKEN=eas_... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e185550 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint-typecheck: + name: Lint & Typecheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npm run lint + - run: npm run typecheck + + eas-build-preview: + name: EAS Build (preview) + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + needs: lint-typecheck + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_ACCESS_TOKEN }} + - name: Build preview (iOS + Android) + run: eas build --platform all --profile preview --non-interactive --no-wait diff --git a/.gitignore b/.gitignore index 626da2d..f434da6 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,10 @@ yarn-error.* .env.local .env*.local +# EAS credentials (never commit) +.eas/service-account.json +EXPO_ACCESS_TOKEN + # typescript *.tsbuildinfo diff --git a/app.json b/app.json index 7809a78..6d7b472 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,7 @@ "expo": { "name": "Build", "slug": "product-manager-mobile", + "owner": "interactor", "version": "1.0.0", "orientation": "portrait", "icon": "./assets/icon.png", @@ -43,6 +44,12 @@ ], "experiments": { "typedRoutes": true + }, + "extra": { + "router": {}, + "eas": { + "projectId": "88a146cc-a2b2-48f2-aeea-314c745d4e5a" + } } } } diff --git a/eas.json b/eas.json new file mode 100644 index 0000000..2f4c679 --- /dev/null +++ b/eas.json @@ -0,0 +1,46 @@ +{ + "cli": { + "version": ">= 16.0.0", + "appVersionSource": "local" + }, + "build": { + "development": { + "developmentClient": true, + "distribution": "internal", + "ios": { + "simulator": false + }, + "env": { + "EXPO_PUBLIC_API_URL": "https://build.interactor.com", + "EXPO_PUBLIC_ACCOUNT_SERVER_URL": "https://auth.interactor.com" + } + }, + "preview": { + "distribution": "internal", + "env": { + "EXPO_PUBLIC_API_URL": "https://build.interactor.com", + "EXPO_PUBLIC_ACCOUNT_SERVER_URL": "https://auth.interactor.com" + } + }, + "production": { + "autoIncrement": true, + "env": { + "EXPO_PUBLIC_API_URL": "https://build.interactor.com", + "EXPO_PUBLIC_ACCOUNT_SERVER_URL": "https://auth.interactor.com" + } + } + }, + "submit": { + "production": { + "ios": { + "appleId": "peter@interactor.com", + "ascAppId": "", + "appleTeamId": "" + }, + "android": { + "serviceAccountKeyPath": ".eas/service-account.json", + "track": "internal" + } + } + } +}