Skip to content

Commit

Permalink
mobile: Expo EAS CD
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinbhardwaj committed Feb 2, 2024
1 parent 7a98af0 commit c2845a0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CD

on:
push:
branches: [master, test-cd]

jobs:
deploy:
name: EAS Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "20.x"

- name: Install dependencies
run: npm ci && npm test

- name: Setup EAS
uses: expo/expo-github-action@v8
with:
packager: npm
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Set Build Number
env:
RUN_NUMBER: ${{ github.run_number }}
run: |
echo ::set-env name=DAIMO_CD_BUILD_NUM::$(($RUN_NUMBER+105))
- name: Build and publish update ${{ env.DAIMO_CD_BUILD_NUM }}
run: DAIMO_CD_BUILD_NUM=${{ env.DAIMO_CD_BUILD_NUM }} npm run build:prod
working-directory: ./apps/daimo-mobile
10 changes: 7 additions & 3 deletions apps/daimo-mobile/app.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
const IS_DEV = process.env.DAIMO_APP_VARIANT === "dev";
const IS_CANARY = process.env.DAIMO_APP_VARIANT === "canary";

const VERSION = "1.5.2";
const BUILD_NUM = 105;
const VERSION_NUMBER = "1.5.2";

const BUILD_NUM = Number(process.env.DAIMO_CD_BUILD_NUM);
const VERSION_TITLE =
VERSION_NUMBER + (IS_DEV ? " Dev" : "") + (IS_CANARY ? " Canary" : "");

export default {
owner: "daimo",
name: IS_DEV ? "Daimo Dev" : "Daimo",
slug: "daimo",
version: VERSION,
version: VERSION_TITLE,
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
Expand Down
3 changes: 1 addition & 2 deletions apps/daimo-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"build:sim": "eas build -p ios --profile=sim --non-interactive",
"build:dev": "eas build -p ios --profile=dev --non-interactive",
"build:dev-android": "eas build -p android --profile=dev --non-interactive",
"build:prod": "eas build -p ios --profile=prod --auto-submit --non-interactive",
"build:prod-android": "eas build -p android --profile=prod --auto-submit --non-interactive",
"build:prod": "eas build -p all --profile=prod --auto-submit --non-interactive",
"submit:prod": "eas submit --platform ios --profile=prod",
"submit:prod-android": "eas submit --platform android --profile=prod",
"dev": "DAIMO_APP_API_URL=http://`ipconfig getifaddr en0`:3000 expo start --dev-client --clear -i",
Expand Down

0 comments on commit c2845a0

Please sign in to comment.