Initial commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: App CI/CD | |
on: | |
push: | |
branches: ["main", "develop", "testnet", "lw-*"] | |
pull_request: | |
branches: ["main", "develop", "testnet"] | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
APP_STORE_CONNECT_KEY: ${{ secrets.APPLE_API_KEY }} | |
ACCOUNT_KEY: ${{ secrets.GOOGLE_PLAY_ACCOUNT_JSON }} | |
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
jobs: | |
checks: | |
name: Checks | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Lint | |
run: bun lint | |
continue-on-error: true | |
- name: Prettier | |
run: bun format:check | |
continue-on-error: true | |
- name: TypeScript Compile | |
run: bun compile | |
continue-on-error: true | |
- name: Expo Doctor | |
run: bun doctor | |
continue-on-error: true | |
- name: Bundle JS Code | |
run: bun export | |
continue-on-error: true | |
- name: Check Version Code | |
run: ./scripts/check-version-code.sh | |
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' | |
build-and-deploy-ios: | |
name: Build & Deploy iOS | |
needs: checks | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Git LFS pull | |
run: git lfs pull | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{env.EXPO_TOKEN}} | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Write App Store Connect Key to file | |
run: 'echo "$APP_STORE_CONNECT_KEY" > app-store-connect-key.json' | |
shell: bash | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Build Production iOS App | |
if: github.ref == 'refs/heads/main' | |
run: bun build:ios:production | |
- name: Deploy Production iOS App | |
if: github.ref == 'refs/heads/main' | |
run: bun deploy:ios:production | |
- name: Build Staging iOS App | |
if: github.ref == 'refs/heads/develop' | |
run: bun build:ios:staging | |
- name: Deploy Staging iOS App | |
if: github.ref == 'refs/heads/develop' | |
run: bun deploy:ios:staging | |
- name: Store iOS Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ios-artifact | |
path: ios-binary.ipa | |
build-and-deploy-android: | |
name: Build & Deploy Android | |
needs: checks | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{env.EXPO_TOKEN}} | |
- name: Write Google Service file | |
run: 'echo "$ACCOUNT_KEY" > services-api-key.json' | |
shell: bash | |
- name: Build Production Android App | |
if: github.ref == 'refs/heads/main' | |
run: bun build:android:production | |
- name: Deploy Production Android App | |
if: github.ref == 'refs/heads/main' | |
run: bun deploy:android:production | |
- name: Build Staging Android App | |
if: github.ref == 'refs/heads/develop' | |
run: bun build:android:staging | |
- name: Deploy Staging Android App | |
if: github.ref == 'refs/heads/develop' | |
run: bun deploy:android:staging | |
- name: Store Android Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: android-artifact | |
path: android-binary.aab |