Skip to content

Commit 375e500

Browse files
authored
Merge pull request #292 from Atcha-Project/env/stage
[LIVE] App Store 배포 자동화 파이프라인 구축
2 parents 5da3359 + 012b839 commit 375e500

31 files changed

Lines changed: 1301 additions & 122 deletions

File tree

.github/workflows/ios-cd-live.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow will build a Swift project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3+
4+
name: iOS CD (Live -> App Store)
5+
6+
on:
7+
push:
8+
branches: ["env/live"]
9+
10+
jobs:
11+
deploy-appstore:
12+
runs-on: macos-15
13+
14+
environment: AppStore-Deploy
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Select Xcode
21+
uses: maxim-lobanov/setup-xcode@v1
22+
with:
23+
xcode-version: "latest-stable"
24+
25+
- name: Install iOS SDK (Retry up to 3 times)
26+
run: |
27+
for i in {1..3}; do
28+
echo "Attempt $i to download iOS platform..."
29+
sudo xcodebuild -downloadPlatform iOS && break || {
30+
if [ $i -lt 3 ]; then
31+
echo "Attempt $i failed. Retrying in 10 seconds..."
32+
sleep 10
33+
else
34+
echo "All 3 attempts failed. Moving on (continue-on-error is set)."
35+
exit 1
36+
fi
37+
}
38+
done
39+
40+
- name: Create Real Configs
41+
run: |
42+
echo "${{ secrets.LIVE_CONFIG_CONTENT }}" | base64 --decode > "LiveConfig.xcconfig"
43+
echo "${{ secrets.DEV_CONFIG_CONTENT }}" | base64 --decode > "DevConfig.xcconfig"
44+
echo "${{ secrets.STAGE_CONFIG_CONTENT }}" | base64 --decode > "StageConfig.xcconfig"
45+
echo "${{ secrets.BASE_CONFIG_CONTENT }}" | base64 --decode > "BaseConfig.xcconfig"
46+
47+
- name: Install Fastlane
48+
run: bundle install
49+
50+
- name: Build and Upload to App Store
51+
env:
52+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
53+
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_TOKEN }}
54+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
55+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.ASC_KEY_ID }}
56+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.ASC_KEY_CONTENT }}
57+
GYM_SCHEME: "Atcha-Live"
58+
GYM_CONFIGURATION: "Release"
59+
GYM_EXPORT_METHOD: "app-store"
60+
GYM_XC_ARGS: "PROVISIONING_PROFILE_SPECIFIER='match AppStore com.atcha.iOS' CODE_SIGN_STYLE=Manual"
61+
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120
62+
63+
run: bundle exec fastlane release

.github/workflows/ios-cd-stage.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow will build a Swift project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3+
4+
name: iOS CD (Stage -> TestFlight)
5+
6+
on:
7+
push:
8+
branches: ["env/stage"]
9+
10+
jobs:
11+
deploy-testflight:
12+
runs-on: macos-15
13+
14+
environment: TestFlight-Deploy
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Select Xcode
21+
uses: maxim-lobanov/setup-xcode@v1
22+
with:
23+
xcode-version: "latest-stable"
24+
25+
- name: Install iOS SDK (Retry up to 3 times)
26+
run: |
27+
for i in {1..3}; do
28+
echo "Attempt $i to download iOS platform..."
29+
sudo xcodebuild -downloadPlatform iOS && break || {
30+
if [ $i -lt 3 ]; then
31+
echo "Attempt $i failed. Retrying in 10 seconds..."
32+
sleep 10
33+
else
34+
echo "All 3 attempts failed. Moving on (continue-on-error is set)."
35+
exit 1
36+
fi
37+
}
38+
done
39+
40+
- name: Create Real Configs
41+
run: |
42+
# Xcode가 찾는 경로: /Users/runner/work/Atcha-iOS/Atcha-iOS/StageConfig.xcconfig
43+
# checkout 후 현재 위치가 이미 그 경로이므로 바로 생성
44+
echo "${{ secrets.LIVE_CONFIG_CONTENT }}" | base64 --decode > "LiveConfig.xcconfig"
45+
echo "${{ secrets.DEV_CONFIG_CONTENT }}" | base64 --decode > "DevConfig.xcconfig"
46+
echo "${{ secrets.STAGE_CONFIG_CONTENT }}" | base64 --decode > "StageConfig.xcconfig"
47+
echo "${{ secrets.BASE_CONFIG_CONTENT }}" | base64 --decode > "BaseConfig.xcconfig"
48+
49+
echo "=== 파일 위치 확인 ==="
50+
pwd
51+
ls *.xcconfig
52+
echo "=== StageConfig 내용 ==="
53+
cat StageConfig.xcconfig
54+
55+
- name: Install Fastlane
56+
run: bundle install
57+
58+
- name: Build and Upload to TestFlight
59+
env:
60+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
61+
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_TOKEN }}
62+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
63+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.ASC_KEY_ID }}
64+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.ASC_KEY_CONTENT }}
65+
GYM_SCHEME: "Atcha-Stage"
66+
GYM_CONFIGURATION: "Release"
67+
GYM_EXPORT_METHOD: "app-store"
68+
GYM_XC_ARGS: "PROVISIONING_PROFILE_SPECIFIER='match AppStore com.atcha.iOS' CODE_SIGN_STYLE=Manual"
69+
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120
70+
71+
# Fastfile에 작성된 테플 업로드용 lane 실행 (이름은 설정하신 대로 맞춰주세요)
72+
run: bundle exec fastlane beta

.github/workflows/ios_ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This workflow will build a Swift project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3+
4+
name: iOS CI
5+
6+
on:
7+
pull_request:
8+
branches: ["env/dev", "env/stage", "env/live"]
9+
10+
jobs:
11+
build:
12+
runs-on: macos-15
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Select Xcode
17+
uses: maxim-lobanov/setup-xcode@v1
18+
with:
19+
xcode-version: "latest-stable"
20+
21+
- name: Debug toolchain
22+
run: |
23+
xcodebuild -version
24+
xcodebuild -showsdks
25+
xcrun simctl list runtimes
26+
27+
- name: Install iOS SDK
28+
# sudo를 붙여서 확실하게 권한을 주고 실행합니다.
29+
run: sudo xcodebuild -downloadPlatform iOS
30+
31+
- name: Create Dummy Configs
32+
run: |
33+
# 프로젝트 폴더 생성
34+
mkdir -p Atcha-iOS/Atcha-iOS
35+
36+
# 생성할 파일 목록 (BaseConfig 추가!)
37+
CONFIG_FILES=("BaseConfig.xcconfig" "DevConfig.xcconfig" "StageConfig.xcconfig" "LiveConfig.xcconfig")
38+
39+
for FILE in "${CONFIG_FILES[@]}"; do
40+
# 1. 루트 경로
41+
echo "// Dummy Config for CI" > "$FILE"
42+
# 2. 첫 번째 하위 경로
43+
echo "// Dummy Config for CI" > "Atcha-iOS/$FILE"
44+
# 3. 두 번째 하위 경로 (사진에서 본 실제 위치)
45+
echo "// Dummy Config for CI" > "Atcha-iOS/Atcha-iOS/$FILE"
46+
echo "Created $FILE in multiple locations"
47+
done
48+
49+
- name: Build (Any iOS Device)
50+
run: |
51+
xcodebuild \
52+
-project Atcha-iOS.xcodeproj \
53+
-scheme Atcha-Dev \
54+
-configuration Debug \
55+
-destination 'generic/platform=iOS' \
56+
-sdk iphoneos \
57+
IPHONEOS_DEPLOYMENT_TARGET=16.1 \
58+
FRAMEWORK_SEARCH_PATHS="$(inherited) $PWD $PWD/Atcha-iOS $PWD/Atcha-iOS/Atcha-iOS" \
59+
SWIFT_INCLUDE_PATHS="$(inherited) $PWD $PWD/Atcha-iOS $PWD/Atcha-iOS/Atcha-iOS" \
60+
CODE_SIGNING_ALLOWED=NO \
61+
CODE_SIGNING_REQUIRED=NO \
62+
CODE_SIGN_IDENTITY="" \
63+
AD_HOC_CODE_SIGNING_ALLOWED=YES \
64+
clean build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,9 @@ iOSInjectionProject/
109109
# End of https://www.toptal.com/developers/gitignore/api/swift,xcode,cocoapods
110110

111111
*.xcconfig
112+
DevConfig.xcconfig
113+
StageConfig.xcconfig
114+
LiveConfig.xcconfig
115+
BaseConfig.xcconfig
112116

113117
Atcha-iOS/DesignSource/AtchaImage/Icon.xcassets/Onboarding/.DS_Store

0 commit comments

Comments
 (0)