Skip to content

Instantly share code, notes, and snippets.

@foloinfo
Last active September 28, 2023 17:54
Show Gist options
  • Save foloinfo/58df77ecb1d46332d384188c63130338 to your computer and use it in GitHub Desktop.
Save foloinfo/58df77ecb1d46332d384188c63130338 to your computer and use it in GitHub Desktop.
eas ios build with circle CI setup
version: 2.1
executors:
docker-node:
working_directory: ~/your_app
docker:
- image: cimg/node:16.17.1
mac:
working_directory: ~/your_app
macos:
xcode: 14.0.0
orbs:
node: circleci/node@5.0.3
commands:
install_node:
steps:
- node/install:
node-version: "16.17.1"
install-yarn: true
setup_yarn:
parameters:
cache_on:
default: docker
type: string
steps:
- restore_cache:
key: dependency-cache-{{ .Environment.CACHE_VERSION }}-<< parameters.cache_on >>-{{ checksum "yarn.lock" }}
- run:
name: Set yarn version
command: yarn set version 1.22.19
- run:
name: Yarn Install
command: yarn install
- save_cache:
key: dependency-cache-{{ .Environment.CACHE_VERSION }}-<< parameters.cache_on >>-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
setup_expo:
steps:
- run:
name: Install Expo
command: yarn global add expo-cli
- run:
name: Install EAS
command: yarn global add eas-cli
build_app:
parameters:
profile:
type: string
platform:
default: ios
type: string
steps:
- run:
name: Build Locally
command: >
APP_ENV=<< parameters.profile >> eas build --local
--non-interactive
--output=./app-build
--platform=<< parameters.platform >>
--profile=<< parameters.profile >>
expo_build:
parameters:
profile:
type: string
steps:
- checkout
- install_node
- setup_yarn:
cache_on: 'mac'
- setup_expo
- build_app:
profile: << parameters.profile >>
- store_artifacts:
path: ./app-build
jobs:
test:
executor: docker-node
steps:
- checkout
- setup_yarn
- run:
name: Run Tests
command: node ./node_modules/jest/bin/jest.js -w 2
- store_artifacts:
path: coverage
expo_build_staging:
executor: mac
steps:
- expo_build:
profile: staging
expo_build_production:
executor: mac
steps:
- expo_build:
profile: production
workflows:
version: 2
your_app:
jobs:
- test
- expo_build_staging:
filters:
branches:
only: build/ios/staging
- expo_build_production:
filters:
branches:
only: build/ios/production
@foloinfo
Copy link
Author

This .circleci/config.yml will run the jest specs when you push on any branch.
The eas build will run when you pushed a branch named with build/ios/staging or build/ios/production.

I tried to cache resource from Xcode build but it didn't work.

If anyone know the better solution plz let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment