Created
March 21, 2025 13:28
-
-
Save AndrewDongminYoo/b3d732f1ba84828653e4e2bbae2c1ce6 to your computer and use it in GitHub Desktop.
Fastlane으로 iOS와 Android 릴리즈를 병렬 실행하기
This file contains hidden or 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
| # 이 lane은 루트 디렉토리에 위치한 Fastfile에서 Android와 iOS 앱을 동시에 (병렬로) 빌드 및 릴리즈합니다. | |
| # 각 플랫폼의 릴리즈 과정을 별도의 스레드로 실행하여, 두 작업이 동시에 진행됩니다. | |
| # | |
| # 동작 방식: | |
| # 1. 공통 build_number를 설정합니다. (옵션이 없으면 현재 시간 기반의 번호 사용) | |
| # 2. 새로운 스레드를 생성하여 Android 디렉토리(루트 기준 ../android)에서 fastlane release lane을 실행합니다. | |
| # 3. 또 다른 스레드를 생성하여 iOS 디렉토리(루트 기준 ../ios)에서 fastlane release lane을 실행합니다. | |
| # 4. 두 스레드가 모두 종료될 때까지 기다립니다. | |
| # | |
| # 참고: 이 스크립트는 각각의 플랫폼 디렉토리에서 개별 실행할 때와 동일하게 동작해야 합니다. | |
| desc "Build and release both Android and iOS apps concurrently" | |
| lane :release do |options| | |
| # 공통 빌드 넘버: 옵션이 없으면 현재 시간을 기반으로 생성 (예: '23031614' 형식) | |
| build_number = options[:build_number] || Time.now.strftime("%y%m%d%H") | |
| # Android 릴리즈를 위한 별도 스레드 생성 | |
| android_lane = Thread.new do | |
| # subshell을 사용하여 디렉토리 이동 후 fastlane release 실행 | |
| sh("(cd ../android && fastlane release build_number:#{build_number})") | |
| end | |
| # iOS 릴리즈를 위한 별도 스레드 생성 | |
| ios_lane = Thread.new do | |
| # subshell을 사용하여 디렉토리 이동 후 fastlane release 실행 | |
| sh("(cd ../ios && fastlane release build_number:#{build_number})") | |
| end | |
| # 두 스레드가 모두 종료될 때까지 대기 | |
| [android_lane, ios_lane].each(&:join) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment