Skip to content

Commit 4c8fd3f

Browse files
authored
[Merge] #185 - Firebase 개발/배포 환경 분리 및 CI/CD 워크플로우 연동
2 parents fca0540 + 84a17d7 commit 4c8fd3f

7 files changed

Lines changed: 214 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,36 @@ jobs:
2929
mkdir -p Neki-iOS/APP/Sources/Resources
3030
echo "${{ secrets.RELEASE_XCCONFIG }}" | base64 --decode > Neki-iOS/APP/Sources/Resources/Release.xcconfig
3131
32-
# 3. SPM 매크로 지문 검증 우회
32+
# 3. 깃허브 Secret에서 Firebase Plist 파일 생성하기
33+
- name: Create Firebase Plist
34+
run: |
35+
mkdir -p Neki-iOS/APP/Sources/Resources/FirebaseConfig/Release
36+
echo "${{ secrets.FIREBASE_PLIST_RELEASE }}" | base64 --decode > Neki-iOS/APP/Sources/Resources/FirebaseConfig/Release/GoogleService-Info.plist
37+
38+
# 4. SPM 매크로 지문 검증 우회
3339
- name: Disable Macro Validation
3440
run: |
3541
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
3642
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidation -bool YES
3743
38-
# 4. SPM 의존성 사전 해결
44+
# 5. SPM 의존성 사전 해결
3945
- name: Resolve SPM Dependencies
4046
run: xcodebuild -resolvePackageDependencies -project ./Neki-iOS.xcodeproj -scheme Neki-iOS
4147

42-
# 5. Match 인증서 저장소 접근을 위한 SSH 세팅
48+
# 6. Match 인증서 저장소 접근을 위한 SSH 세팅
4349
- name: Install SSH key for Match
4450
uses: webfactory/ssh-agent@v0.8.0
4551
with:
4652
ssh-private-key: ${{ secrets.MATCH_SSH_KEY }}
4753

48-
# 6. Ruby 및 Fastlane 세팅 (Gemfile 활용)
54+
# 7. Ruby 및 Fastlane 세팅 (Gemfile 활용)
4955
- name: Setup Ruby and Install Gems
5056
uses: ruby/setup-ruby@v1
5157
with:
5258
ruby-version: '3.2'
5359
bundler-cache: true
5460

55-
# 7. Fastlane 배포 실행
61+
# 8. Fastlane 배포 실행
5662
- name: Run Fastlane Release
5763
run: bundle exec fastlane release
5864
env:
@@ -65,7 +71,7 @@ jobs:
6571
ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }}
6672
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
6773

68-
# 8. 배포 완료 후 서버로 최신 버전 정보 POST 요청
74+
# 9. 배포 완료 후 서버로 최신 버전 정보 POST 요청
6975
- name: Send Version Update to Server
7076
if: success() # 배포가 성공적으로 끝났을 때만 실행
7177
run: |
@@ -75,15 +81,14 @@ jobs:
7581
echo "추출된 최신 버전: $APP_VERSION"
7682
7783
# 추출된 버전을 JSON 바디에 담아서 서버로 POST 요청 (minVersion은 필요시 추후 수정)
78-
curl -X PATCH "${{ secrets.APP_VERSION_API_ADDRESS }}" \
79-
-H "Content-Type: application/json" \
80-
-H "Authorization: Bearer empty_token_just_for_header" \
81-
-d "{
82-
\"minVersion\": \"1.0.0\",
83-
\"currentVersion\": \"$APP_VERSION\"
84-
}"
84+
curl -X PATCH "${{ secrets.APP_VERSION_API_ADDRESS }}" \
85+
-H "Content-Type: application/json" \
86+
-d "{
87+
\"minVersion\": \"1.0.0\",
88+
\"currentVersion\": \"$APP_VERSION\"
89+
}"
8590
86-
# 9. Discord 결과 알림 (성공/실패 여부 전송)
91+
# 10. Discord 결과 알림 (성공/실패 여부 전송)
8792
- name: Send Discord notification
8893
if: always() # 빌드 성공/실패 여부와 상관없이 무조건 실행
8994
run: |
@@ -94,6 +99,6 @@ jobs:
9499
fi
95100
PAYLOAD=$(jq -n --arg content "$STATUS (${{ github.repository }})" '{content: $content}')
96101
curl -H "Content-Type: application/json" \
97-
-X POST \
98-
-d "$PAYLOAD" \
99-
${{ secrets.DISCORD_WEBHOOK_URL }}
102+
-X POST \
103+
-d "$PAYLOAD" \
104+
${{ secrets.DISCORD_WEBHOOK_URL }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,7 @@ iOSInjectionProject/
141141
*.cer
142142
*.p12
143143
*.mobileprovision
144-
*.certSigningRequest
144+
*.certSigningRequest
145+
146+
# Firebase
147+
GoogleService-Info.plist

Neki-iOS.xcodeproj/project.pbxproj

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
5970335E2F2482E1000B8194 /* KakaoSDKCommon in Frameworks */ = {isa = PBXBuildFile; productRef = 5970335D2F2482E1000B8194 /* KakaoSDKCommon */; };
1616
597033602F2482E1000B8194 /* KakaoSDKUser in Frameworks */ = {isa = PBXBuildFile; productRef = 5970335F2F2482E1000B8194 /* KakaoSDKUser */; };
1717
59D1D21B2F168EE800F50EB5 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 59D1D21A2F168EE800F50EB5 /* Kingfisher */; };
18+
6C0C1ACB2F6FD2E30037F650 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0C1ACA2F6FD2E30037F650 /* FirebaseAnalytics */; };
19+
6C0C1ACD2F6FD2E30037F650 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0C1ACC2F6FD2E30037F650 /* FirebaseCrashlytics */; };
20+
6C0C1ACF2F6FD2E30037F650 /* FirebaseInstallations in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0C1ACE2F6FD2E30037F650 /* FirebaseInstallations */; };
1821
6C3B4B8A2F65CA4B008449C1 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C3B4B882F65C9B0008449C1 /* WebKit.framework */; };
1922
6C4D99E52F365E1700E93BF0 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 6C4D99E42F365E1700E93BF0 /* Lottie */; };
2023
/* End PBXBuildFile section */
@@ -46,6 +49,10 @@
4649
6C499D3A2F05594E006BE1DB /* Exceptions for "Neki-iOS" folder in "Neki-iOS" target */ = {
4750
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
4851
membershipExceptions = (
52+
APP/Sources/Resources/FirebaseConfig/Debug/.gitkeep,
53+
"APP/Sources/Resources/FirebaseConfig/Debug/GoogleService-Info.plist",
54+
APP/Sources/Resources/FirebaseConfig/Release/.gitkeep,
55+
"APP/Sources/Resources/FirebaseConfig/Release/GoogleService-Info.plist",
4956
Info.plist,
5057
);
5158
target = 6C4998DC2EF7EF62006BE1DB /* Neki-iOS */;
@@ -85,11 +92,14 @@
8592
59D1D21B2F168EE800F50EB5 /* Kingfisher in Frameworks */,
8693
5970335E2F2482E1000B8194 /* KakaoSDKCommon in Frameworks */,
8794
6C4D99E52F365E1700E93BF0 /* Lottie in Frameworks */,
95+
6C0C1ACF2F6FD2E30037F650 /* FirebaseInstallations in Frameworks */,
8896
592F2C5E2F0508FE00802BB7 /* ComposableArchitecture in Frameworks */,
8997
5970335C2F2482E1000B8194 /* KakaoSDKCertCore in Frameworks */,
98+
6C0C1ACD2F6FD2E30037F650 /* FirebaseCrashlytics in Frameworks */,
9099
597033602F2482E1000B8194 /* KakaoSDKUser in Frameworks */,
91100
592F345C2F0E1F1700802BB7 /* NMapsMap in Frameworks */,
92101
597033582F2482E1000B8194 /* KakaoSDKAuth in Frameworks */,
102+
6C0C1ACB2F6FD2E30037F650 /* FirebaseAnalytics in Frameworks */,
93103
5970335A2F2482E1000B8194 /* KakaoSDKCert in Frameworks */,
94104
);
95105
runOnlyForDeploymentPostprocessing = 0;
@@ -157,6 +167,7 @@
157167
6C4998D92EF7EF62006BE1DB /* Sources */,
158168
6C4998DA2EF7EF62006BE1DB /* Frameworks */,
159169
6C4998DB2EF7EF62006BE1DB /* Resources */,
170+
6C0C1AD92F6FD64B0037F650 /* Copy Firebase Plist */,
160171
);
161172
buildRules = (
162173
);
@@ -176,6 +187,9 @@
176187
5970335D2F2482E1000B8194 /* KakaoSDKCommon */,
177188
5970335F2F2482E1000B8194 /* KakaoSDKUser */,
178189
6C4D99E42F365E1700E93BF0 /* Lottie */,
190+
6C0C1ACA2F6FD2E30037F650 /* FirebaseAnalytics */,
191+
6C0C1ACC2F6FD2E30037F650 /* FirebaseCrashlytics */,
192+
6C0C1ACE2F6FD2E30037F650 /* FirebaseInstallations */,
179193
);
180194
productName = "Neki-iOS";
181195
productReference = 6C4998DD2EF7EF62006BE1DB /* Neki-iOS.app */;
@@ -215,6 +229,7 @@
215229
59D1D2192F168EE800F50EB5 /* XCRemoteSwiftPackageReference "Kingfisher" */,
216230
597033562F2482E1000B8194 /* XCRemoteSwiftPackageReference "kakao-ios-sdk" */,
217231
6C4D99E32F365E1700E93BF0 /* XCRemoteSwiftPackageReference "lottie-ios" */,
232+
6C0C1AC92F6FD2E30037F650 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
218233
);
219234
preferredProjectObjectVersion = 77;
220235
productRefGroup = 6C4998DE2EF7EF62006BE1DB /* Products */;
@@ -244,6 +259,27 @@
244259
};
245260
/* End PBXResourcesBuildPhase section */
246261

262+
/* Begin PBXShellScriptBuildPhase section */
263+
6C0C1AD92F6FD64B0037F650 /* Copy Firebase Plist */ = {
264+
isa = PBXShellScriptBuildPhase;
265+
buildActionMask = 2147483647;
266+
files = (
267+
);
268+
inputFileListPaths = (
269+
);
270+
inputPaths = (
271+
);
272+
name = "Copy Firebase Plist";
273+
outputFileListPaths = (
274+
);
275+
outputPaths = (
276+
);
277+
runOnlyForDeploymentPostprocessing = 0;
278+
shellPath = /bin/sh;
279+
shellScript = "# 1. 환경(Debug/Release) 변수 가져오기\nENVIRONMENT=\"${CONFIGURATION}\"\n\n# 2. 올려주신 폴더 구조에 맞춘 정확한 원본 파일 경로\n# (에러 로그를 기반으로 Neki-iOS 하위의 APP 폴더를 가리키도록 설정했습니다)\nSRC_PLIST_PATH=\"${SRCROOT}/Neki-iOS/APP/Sources/Resources/FirebaseConfig/${ENVIRONMENT}/GoogleService-Info.plist\"\n\n# 3. 앱이 빌드되어 완성될 목적지 경로\nDEST_PLIST_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\"\n\n# 4. 파일 복사 실행\necho \"Copying ${ENVIRONMENT} Firebase plist...\"\ncp -r \"${SRC_PLIST_PATH}\" \"${DEST_PLIST_PATH}\"\n";
280+
};
281+
/* End PBXShellScriptBuildPhase section */
282+
247283
/* Begin PBXSourcesBuildPhase section */
248284
6C3B4B782F65C44C008449C1 /* Sources */ = {
249285
isa = PBXSourcesBuildPhase;
@@ -370,7 +406,7 @@
370406
DEVELOPMENT_TEAM = 586LZSS32L;
371407
ENABLE_STRICT_OBJC_MSGSEND = YES;
372408
ENABLE_TESTABILITY = YES;
373-
ENABLE_USER_SCRIPT_SANDBOXING = YES;
409+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
374410
GCC_C_LANGUAGE_STANDARD = gnu17;
375411
GCC_DYNAMIC_NO_PIC = NO;
376412
GCC_NO_COMMON_BLOCKS = YES;
@@ -436,7 +472,7 @@
436472
DEVELOPMENT_TEAM = 586LZSS32L;
437473
ENABLE_NS_ASSERTIONS = NO;
438474
ENABLE_STRICT_OBJC_MSGSEND = YES;
439-
ENABLE_USER_SCRIPT_SANDBOXING = YES;
475+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
440476
GCC_C_LANGUAGE_STANDARD = gnu17;
441477
GCC_NO_COMMON_BLOCKS = YES;
442478
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -624,6 +660,14 @@
624660
minimumVersion = 8.6.2;
625661
};
626662
};
663+
6C0C1AC92F6FD2E30037F650 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
664+
isa = XCRemoteSwiftPackageReference;
665+
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
666+
requirement = {
667+
kind = upToNextMajorVersion;
668+
minimumVersion = 12.11.0;
669+
};
670+
};
627671
6C4D99E32F365E1700E93BF0 /* XCRemoteSwiftPackageReference "lottie-ios" */ = {
628672
isa = XCRemoteSwiftPackageReference;
629673
repositoryURL = "https://github.com/airbnb/lottie-ios";
@@ -675,6 +719,21 @@
675719
package = 59D1D2192F168EE800F50EB5 /* XCRemoteSwiftPackageReference "Kingfisher" */;
676720
productName = Kingfisher;
677721
};
722+
6C0C1ACA2F6FD2E30037F650 /* FirebaseAnalytics */ = {
723+
isa = XCSwiftPackageProductDependency;
724+
package = 6C0C1AC92F6FD2E30037F650 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
725+
productName = FirebaseAnalytics;
726+
};
727+
6C0C1ACC2F6FD2E30037F650 /* FirebaseCrashlytics */ = {
728+
isa = XCSwiftPackageProductDependency;
729+
package = 6C0C1AC92F6FD2E30037F650 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
730+
productName = FirebaseCrashlytics;
731+
};
732+
6C0C1ACE2F6FD2E30037F650 /* FirebaseInstallations */ = {
733+
isa = XCSwiftPackageProductDependency;
734+
package = 6C0C1AC92F6FD2E30037F650 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
735+
productName = FirebaseInstallations;
736+
};
678737
6C4D99E42F365E1700E93BF0 /* Lottie */ = {
679738
isa = XCSwiftPackageProductDependency;
680739
package = 6C4D99E32F365E1700E93BF0 /* XCRemoteSwiftPackageReference "lottie-ios" */;

Neki-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 118 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)