Expo 기반 CI
https://docs.expo.dev/eas-update/github-actions/
Expo 프로젝트 생성
EXPO_TOKEN 발급
https://github.com/your-username/your-repo-name/settings/secrets/actions
위에서 secret키 등록
풀리퀘 했더니 EAS Update 오류뜸
=> Git Actions 확인
=> publish update 에서 막힘
=> 에러코드 확인
Run eas update --auto
eas update --auto
shell: /usr/bin/bash -e {0}
env:
MSYS: winsymlinks:nativestrict
EXPO_TOKEN: ***
EAS project not configured.
Error: Input is required, but stdin is not readable. Failed to display
prompt: Would you like to automatically create an EAS project for
@github-repo-name?
Error: Process completed with exit code 1.
생각해보니 EAS 라는걸 잘 모름
=>EAS 업데이트는 엑스포 업데이트 라이브러리를 사용하여 프로젝트에 대한 업데이트를 제공하는 호스팅 서비스입니다.
=> EAS Update는 작은 버그를 수정하고 빠른 픽스를 푸시하여 앱 스토어 제출 사이에 스냅을 만듭니다.
최종 사용자의 앱이 앱의 모국어가 아닌 부분(예: JS, 스타일링 및 이미지 변경)을 버그 수정 및 기타 업데이트가 포함된 새로운 업데이트로 교체할 수 있게 함으로써 이를 달성한다.
엑스포 업데이트 라이브러리를 실행하는 모든 앱은 업데이트를 받을 수 있는 기능을 가지고 있다.
EAS 업데이트 사용을 시작하려면 시작 안내서를 계속 진행합니다.
https://docs.expo.dev/eas-update/getting-started/
CLI 와 Project는 이미 만들었으니 3번 configure your app 부터 진행
=> npx expo install expo-updates
=> eas update:configure
=> eas build:configure
=> 일단 android 만
=> Update text 5번째 커밋 #10에서 ESA Update 성공
=> Expo Projects에서 해당 프로젝트탭으로 들어가기
=> https://expo.dev/accounts/jiwoonseo/projects/test-cicd
=> New : GitHub Commit Links 로 github과 연결
앱빌드하기
https://docs.expo.dev/build/setup/
=> eas build --platform android
키생성하라고 뜸
Android application id Learn more: https://expo.fyi/android-package
√ What would you like your Android application id to be? ... com.jiwoonseo.testcicd
✔ Using remote Android credentials (Expo server)
? Generate a new Android Keystore? » (Y/n)
=> Y
기다리면 앱빌드가 되고 Expo 에서 확인 할 수 있다.
CI시 자동 빌드하기
https://docs.expo.dev/build/building-on-ci/
아래코드를 .github/workflows/eas-build.yml에 작성
name: EAS Build
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
name: Install and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
- name: Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
expo-version: 5.x
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Build on EAS
run: eas build --platform all --non-interactive
=> npm으로 빌드하니 오류가 남
=> yarn으로 바꿔줌
=> yarn에서 npm ci와 같은 yarn install --immutable --immutable-cache --check-cache
아래 참고
https://duck-blog.vercel.app/blog/web/npm-ci-do-how-about-yarn
이후에는 자동 앱스토어 업데이트는 eas submit으로 할 수 있다.
=> workflow Build on EAS 에러
=> 에러코드
Run eas build --android --non-interactive
› Error: Unexpected argument: --android
› See more help with --help
Error: Process completed with exit code 2.
다시 eas build --platform all --non-interactive로 원상복구
=> Run eas build --platform all --non-interactive
🤖 Android build
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials ML8upLKLhR (default)
Compressing project files and uploading to EAS Build. Learn more: https://expo.fyi/eas-build-archive
- Uploading to EAS Build (0 / 193 KB)
✔ Uploaded to EAS
🍎 iOS build
✔ Using remote iOS credentials (Expo server)
Distribution Certificate is not validated for non-interactive builds.
Failed to set up credentials.
Error: Credentials are not set up. Run this command again in interactive
mode.
Error: Process completed with exit code 1.
=> ios credentials 는 없기 때문에 ios build시 오류
=> android만 build
=> eas build --platform android
Github Oranization repo에서 Expo CI하기
Expo Organization 만들기
Project owner
Add "owner": "사용할이름" under the "expo" key of app.json for any projects that should be linked to this account. Learn more
자신의 Expo로 생성한 프로젝트내에 app.json에 "expo" property 하위에 Add "owner": "사용할이름" 작성
Bot users만들고 Access tokens 만들기
setting => github secrets => Actions => repositiory secrets에 등록
=> npx expo install expo-updates
=> eas update:configure
=> eas build:configure
=> 일단 android 만
앱빌드
https://docs.expo.dev/build/setup/
=> eas build --platform android
Artizen FE => configure => Github 탭에서 Repo 연결하기
github action에서 build가 안됐었는데 yml파일에 branches를 -master => -main으로 바꿈
main에 pull request시 Expo사이트 내에 project에서 자동빌드 확인.