diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..3beda5f9 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + pull_request: + branches: [ develop ] + push: + branches: [ develop ] + +jobs: + swiftlint: + runs-on: macos-15 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.2' + + - name: Install SwiftLint + run: brew install swiftlint + + - name: Run SwiftLint + run: swiftlint lint --strict diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..02e0e674 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +name: Release to App Store + +on: + push: + branches: [ main ] + +jobs: + release: + runs-on: macos-15 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup XCConfig Files + run: | + echo "${{ secrets.XCCONFIG_BASE64 }}" | base64 --decode | tar -xz + + - name: Setup Firebase Config Files + run: | + mkdir -p Projects/App/Resources/Firebase + echo "${{ secrets.GOOGLE_SERVICE_DEV_INFO }}" > Projects/App/Resources/Firebase/GoogleService-Dev-Info.plist + echo "${{ secrets.GOOGLE_SERVICE_STAGE_INFO }}" > Projects/App/Resources/Firebase/GoogleService-Stage-Info.plist + echo "${{ secrets.GOOGLE_SERVICE_PROD_INFO }}" > Projects/App/Resources/Firebase/GoogleService-Prod-Info.plist + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.2' + + - name: Cache SPM + uses: actions/cache@v4 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + + - name: Install mise + uses: jdx/mise-action@v2 + with: + install: true + + - name: Install Fastlane + run: brew install fastlane + + - name: Generate Xcode project with Tuist + run: | + mise exec -- tuist fetch + mise exec -- tuist generate --xcframeworks + env: + TUIST_CI: "1" + + - name: Run Fastlane Release + run: fastlane release + env: + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} diff --git a/.gitignore b/.gitignore index 563485ec..8b97bdd1 100644 --- a/.gitignore +++ b/.gitignore @@ -72,5 +72,23 @@ Tuist/Dependencies ### Tuist cache ### Tuist/Cache/ +### Secrets (handled via GitHub Secrets in CI) ### XCConfig/ Projects/App/Resources/Firebase/ + +### Fastlane ### +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/.env +test_output/ +*.ipa +*.dSYM.zip +*.mobileprovision + +### Ruby/Bundler ### +.bundle/ +vendor/bundle/ +Gemfile.lock +.claude/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..b5a29771 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "fastlane"] + path = fastlane + url = https://github.com/Team-return/JOBIS_fastlane.git diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..27f40a11 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane", ">= 2.220" diff --git a/Scripts/print-github-secrets.sh b/Scripts/print-github-secrets.sh new file mode 100755 index 00000000..29e7185a --- /dev/null +++ b/Scripts/print-github-secrets.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# GitHub Secrets 설정을 위한 모든 내용 출력 스크립트 +# XCConfig 및 Firebase 설정 파일 내용을 출력 + +echo "=========================================" +echo "GitHub Secrets 설정을 위한 파일 내용" +echo "총 4개의 Secret이 필요합니다" +echo "=========================================" +echo "" + +echo "=== 1. XCCONFIG_BASE64 ===" +echo "이 내용을 전체 복사하여 GitHub Secret 'XCCONFIG_BASE64'에 추가하세요" +echo "---" +tar -czf - XCConfig | base64 +echo "" +echo "" + +echo "=== 2. GOOGLE_SERVICE_DEV_INFO ===" +echo "이 내용을 전체 복사하여 GitHub Secret 'GOOGLE_SERVICE_DEV_INFO'에 추가하세요" +echo "---" +cat Projects/App/Resources/Firebase/GoogleService-Dev-Info.plist +echo "" +echo "" + +echo "=== 3. GOOGLE_SERVICE_STAGE_INFO ===" +echo "이 내용을 전체 복사하여 GitHub Secret 'GOOGLE_SERVICE_STAGE_INFO'에 추가하세요" +echo "---" +cat Projects/App/Resources/Firebase/GoogleService-Stage-Info.plist +echo "" +echo "" + +echo "=== 4. GOOGLE_SERVICE_PROD_INFO ===" +echo "이 내용을 전체 복사하여 GitHub Secret 'GOOGLE_SERVICE_PROD_INFO'에 추가하세요" +echo "---" +cat Projects/App/Resources/Firebase/GoogleService-Prod-Info.plist +echo "" +echo "" + +echo "=========================================" +echo "다음 단계:" +echo "1. GitHub 저장소 → Settings → Secrets and variables → Actions" +echo "2. New repository secret 클릭" +echo "3. 위 4개 내용을 각각 복사하여 추가" +echo " - XCCONFIG_BASE64" +echo " - GOOGLE_SERVICE_DEV_INFO" +echo " - GOOGLE_SERVICE_STAGE_INFO" +echo " - GOOGLE_SERVICE_PROD_INFO" +echo "=========================================" diff --git a/ci_scripts/ci_post_clone.sh b/ci_scripts/ci_post_clone.sh deleted file mode 100755 index 06dba191..00000000 --- a/ci_scripts/ci_post_clone.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -cd ../ -git clone https://github.com/Team-return/JOBIS-v2-XCConfig.git -mv JOBIS-v2-XCConfig/XCConfig/ . - -git clone https://github.com/Team-return/JOBIS-GoogleInfo.git -mv JOBIS-GoogleInfo/FireBase/ Projects/App/Resources/ - -brew install make - -curl https://mise.jdx.dev/install.sh | sh -export PATH="$HOME/.local/bin:$PATH" -eval "$(mise activate bash --shims)" - -mise install tuist@3.40.0 - -tuist version - -make reset - -tuist fetch -TUIST_CI=1 tuist generate diff --git a/fastlane b/fastlane new file mode 160000 index 00000000..f6b9cde6 --- /dev/null +++ b/fastlane @@ -0,0 +1 @@ +Subproject commit f6b9cde6ac2387e453eb1f45cafb85fc5238a3f2