-
Notifications
You must be signed in to change notification settings - Fork 0
[#628] Firebase 구성을 staging / prod로 분리한다 #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
af3e292
feat: Firestore database 설정 분리
opficdev b984bfa
feat: 배포 환경별 빌드 설정 분리
opficdev d860499
feat: Firestore database 산출물 검증 추가
opficdev 563a76c
feat: App Store 배포 경로 분리
opficdev 7ef6a53
chore: TestFlight CD 수동 실행으로 정리
opficdev d5f3836
chore: 배포 빌드 번호 규칙 명시
opficdev d1fb356
chore: 배포 환경 조합 검증 추가
opficdev 4f44954
fix: Firebase database 환경변수 우선 적용
opficdev 035475e
refactor: callable database payload 제거
opficdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| name: iOS App Store | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| upload_to_app_store_connect: | ||
| description: Upload to App Store Connect | ||
| required: true | ||
| default: "false" | ||
| type: choice | ||
| options: | ||
| - "false" | ||
| - "true" | ||
|
|
||
| env: | ||
| RUBY_VERSION: "3.2" | ||
| XCODE_VERSION: latest | ||
| APP_STORE_TEAM_ID: ${{ secrets.APP_STORE_TEAM_ID }} | ||
| ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | ||
| ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | ||
| ASC_KEY_PATH: fastlane/AuthKey.p8 | ||
| SPACESHIP_CONNECT_API_IN_HOUSE: "false" | ||
| MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }} | ||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
| MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| appstore: | ||
| runs-on: macos-latest | ||
| timeout-minutes: 45 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Install private config files | ||
| uses: ./.github/actions/install-private-config | ||
| with: | ||
| git_url: ${{ env.MATCH_GIT_URL }} | ||
| git_basic_authorization: ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }} | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| bundler-cache: true | ||
| ruby-version: ${{ env.RUBY_VERSION }} | ||
|
|
||
| - name: Select Xcode | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [ "$XCODE_VERSION" = "latest" ]; then | ||
| XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode*.app' -type d | sort -V | tail -n 1)" | ||
| else | ||
| XCODE_APP="/Applications/Xcode_${XCODE_VERSION}.app" | ||
| if [ ! -d "$XCODE_APP" ]; then | ||
| XCODE_APP="/Applications/Xcode-${XCODE_VERSION}.app" | ||
| fi | ||
| fi | ||
|
|
||
| if [ ! -d "${XCODE_APP:-}" ]; then | ||
| echo "Requested Xcode not found for version: $XCODE_VERSION" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| sudo xcode-select -s "$XCODE_APP/Contents/Developer" | ||
| xcodebuild -version | ||
|
|
||
| - name: Set up Tuist | ||
| uses: jdx/mise-action@v4 | ||
| with: | ||
| install: true | ||
| cache: true | ||
|
|
||
| - name: Generate Xcode workspace with Tuist | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| tuist generate --no-open | ||
|
|
||
| - name: Write App Store Connect API key | ||
| env: | ||
| ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }} | ||
| run: | | ||
| printf '%s' "$ASC_KEY_CONTENT" | base64 -D > "$ASC_KEY_PATH" | ||
|
|
||
| - name: Build for App Store | ||
| run: bundle exec fastlane appstore_build_only | ||
|
|
||
| - name: Upload dSYM to Firebase Crashlytics | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| google_service_info_path="Application/DevLogApp/Sources/Resource/GoogleService-Info.plist" | ||
| dsym_zip_path="$(find fastlane/appstore_build -maxdepth 1 -name '*.dSYM.zip' -print -quit)" | ||
| upload_symbols_path="$(find "$HOME/Library/Developer/Xcode/DerivedData" "$HOME/Library/Developer/Xcode/SourcePackages" "$GITHUB_WORKSPACE" -path '*/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/upload-symbols' -type f -print -quit 2>/dev/null || true)" | ||
|
|
||
| if [ ! -f "$google_service_info_path" ]; then | ||
| echo "Missing GoogleService-Info.plist at $google_service_info_path" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "$dsym_zip_path" ]; then | ||
| echo "Missing dSYM zip in fastlane/appstore_build" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "$upload_symbols_path" ]; then | ||
| echo "Missing Firebase Crashlytics upload-symbols script" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| "$upload_symbols_path" -gsp "$google_service_info_path" -p ios "$dsym_zip_path" | ||
|
|
||
| - name: Upload App Store build log | ||
| if: always() | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: appstore-build-log | ||
| path: ~/Library/Logs/gym/*.log | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Upload App Store dSYM | ||
| if: always() | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: appstore-dsym | ||
| path: fastlane/appstore_build/*.dSYM.zip | ||
| if-no-files-found: warn | ||
|
|
||
| - name: Skip App Store Upload | ||
| if: inputs.upload_to_app_store_connect != 'true' | ||
| run: echo "Skipping App Store upload" | ||
|
|
||
| - name: Upload to App Store Connect | ||
| if: inputs.upload_to_app_store_connect == 'true' | ||
| run: bundle exec fastlane upload_appstore_build |
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
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
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
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
45 changes: 45 additions & 0 deletions
45
Application/DevLogInfra/Sources/Common/FirebaseConfiguration.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // | ||
| // FirebaseConfiguration.swift | ||
| // DevLogInfra | ||
| // | ||
| // Created by opfic on 6/26/26. | ||
| // | ||
|
|
||
| import FirebaseFirestore | ||
| import FirebaseFunctions | ||
| import Foundation | ||
|
|
||
| enum FirebaseConfiguration { | ||
| private enum InfoKey { | ||
| static let databaseID = "FIRESTORE_DATABASE_ID" | ||
| } | ||
|
|
||
| static let defaultDatabaseID = "staging" | ||
|
|
||
| static var databaseID: String { | ||
| let environmentValue = ProcessInfo.processInfo.environment[InfoKey.databaseID]? | ||
| .trimmingCharacters(in: .whitespacesAndNewlines) | ||
| if let environmentValue, !environmentValue.isEmpty { | ||
| return environmentValue | ||
| } | ||
|
|
||
| guard let rawValue = Bundle.main.object(forInfoDictionaryKey: InfoKey.databaseID) as? String else { | ||
| return defaultDatabaseID | ||
| } | ||
|
|
||
| let databaseID = rawValue.trimmingCharacters(in: .whitespacesAndNewlines) | ||
| if databaseID.isEmpty || databaseID.hasPrefix("$(") { | ||
| return defaultDatabaseID | ||
| } | ||
|
|
||
| return databaseID | ||
| } | ||
|
opficdev marked this conversation as resolved.
|
||
|
|
||
| static var firestore: Firestore { | ||
| Firestore.firestore(database: databaseID) | ||
| } | ||
|
|
||
| static var functions: Functions { | ||
| Functions.functions(region: "asia-northeast3") | ||
| } | ||
| } | ||
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.