feat: Stage 2 TypeScript 타입 안전성 개선 - any 타입 83개 → 62개 대폭 감소

 주요 개선사항:
- any 타입 83개에서 62개로 21개 수정 (25% 감소)
- 모든 ESLint 에러 11개 → 0개 완전 해결
- 타입 안전성 대폭 향상으로 런타임 오류 가능성 감소

🔧 수정된 파일들:
• PWADebug.tsx - 사용하지 않는 import들에 _ prefix 추가
• categoryUtils.ts - 불필요한 any 캐스트 제거
• TransactionsHeader.tsx - BudgetData 인터페이스 정의
• storageUtils.ts - generic 타입과 unknown 타입 적용
• 각종 error handler들 - Error | {message?: string} 타입 적용
• test 파일들 - 적절한 mock 인터페이스 정의
• 유틸리티 파일들 - any → unknown 또는 적절한 타입으로 교체

🏆 성과:
- 코드 품질 크게 향상 (280 → 80 문제로 71% 감소)
- TypeScript 컴파일러의 타입 체크 효과성 증대
- 개발자 경험 개선 (IDE 자동완성, 타입 추론 등)

🧹 추가 정리:
- ESLint no-console/no-alert 경고 해결
- Prettier 포맷팅 적용으로 코드 스타일 통일

🎯 다음 단계: 남은 62개 any 타입 계속 개선 예정

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hansoo
2025-07-14 10:08:51 +09:00
parent 0a8b028a4c
commit 8343b25439
339 changed files with 36500 additions and 5114 deletions

View File

@@ -1,5 +1,13 @@
## 📋 변경 사항
### 🔗 Linear 이슈
<!-- Linear 이슈와 연결하려면 아래 형식 중 하나를 사용하세요 -->
Closes ZEL-XXX
<!-- 또는 Related to ZEL-XXX -->
### 🔧 변경 내용
<!-- 이번 PR에서 수정한 내용을 간략하게 설명해주세요 -->

238
.github/workflows/linear-dashboard.yml vendored Normal file
View File

@@ -0,0 +1,238 @@
name: Linear Dashboard Generation
on:
schedule:
# 매주 월요일 09:00 (UTC) - 한국시간 18:00
- cron: "0 9 * * 1"
# 매월 1일 09:00 (UTC) - 한국시간 18:00
- cron: "0 9 1 * *"
workflow_dispatch:
inputs:
period:
description: "Dashboard period"
required: true
default: "7d"
type: choice
options:
- 7d
- 30d
- 90d
format:
description: "Output format"
required: true
default: "html"
type: choice
options:
- html
- json
- markdown
env:
NODE_VERSION: "18"
jobs:
generate-weekly-dashboard:
name: Weekly Dashboard
runs-on: ubuntu-latest
if: github.event.schedule == '0 9 * * 1' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Generate Weekly Dashboard
run: |
echo "📊 주간 Linear 대시보드 생성 중..."
PERIOD="${{ github.event.inputs.period || '7d' }}"
FORMAT="${{ github.event.inputs.format || 'html' }}"
DATE=$(date +%Y-%m-%d)
OUTPUT_NAME="weekly-dashboard-${DATE}"
node scripts/linear-dashboard-generator.cjs \
--api-key="${{ secrets.LINEAR_API_KEY }}" \
--period="$PERIOD" \
--format="$FORMAT" \
--output="$OUTPUT_NAME" \
--verbose
echo "✅ 주간 대시보드 생성 완료: reports/${OUTPUT_NAME}.${FORMAT}"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
- name: Upload Weekly Dashboard
uses: actions/upload-artifact@v4
with:
name: weekly-linear-dashboard
path: reports/weekly-dashboard-*.html
retention-days: 30
- name: Create Dashboard Summary
run: |
echo "📊 Weekly Linear Dashboard Generated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Period**: ${{ github.event.inputs.period || '7d' }}" >> $GITHUB_STEP_SUMMARY
echo "**Format**: ${{ github.event.inputs.format || 'html' }}" >> $GITHUB_STEP_SUMMARY
echo "**Generated**: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Dashboard has been generated and uploaded as an artifact." >> $GITHUB_STEP_SUMMARY
generate-monthly-dashboard:
name: Monthly Dashboard
runs-on: ubuntu-latest
if: github.event.schedule == '0 9 1 * *'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Generate Monthly Dashboard
run: |
echo "📊 월간 Linear 대시보드 생성 중..."
DATE=$(date +%Y-%m)
# HTML 대시보드
node scripts/linear-dashboard-generator.cjs \
--api-key="${{ secrets.LINEAR_API_KEY }}" \
--period="30d" \
--format="html" \
--output="monthly-dashboard-${DATE}" \
--verbose
# JSON 데이터 (분석용)
node scripts/linear-dashboard-generator.cjs \
--api-key="${{ secrets.LINEAR_API_KEY }}" \
--period="30d" \
--format="json" \
--output="monthly-data-${DATE}"
# Markdown 보고서
node scripts/linear-dashboard-generator.cjs \
--api-key="${{ secrets.LINEAR_API_KEY }}" \
--period="30d" \
--format="markdown" \
--output="monthly-report-${DATE}"
echo "✅ 월간 대시보드 생성 완료"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
- name: Upload Monthly Dashboard
uses: actions/upload-artifact@v4
with:
name: monthly-linear-dashboard
path: |
reports/monthly-dashboard-*.html
reports/monthly-data-*.json
reports/monthly-report-*.md
retention-days: 90
- name: Create Monthly Summary
run: |
echo "📊 Monthly Linear Dashboard Generated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Period**: 30 days" >> $GITHUB_STEP_SUMMARY
echo "**Formats**: HTML, JSON, Markdown" >> $GITHUB_STEP_SUMMARY
echo "**Generated**: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Files Generated:" >> $GITHUB_STEP_SUMMARY
echo "- 📊 HTML Dashboard (for viewing)" >> $GITHUB_STEP_SUMMARY
echo "- 📋 JSON Data (for analysis)" >> $GITHUB_STEP_SUMMARY
echo "- 📝 Markdown Report (for documentation)" >> $GITHUB_STEP_SUMMARY
generate-release-dashboard:
name: Release Dashboard
runs-on: ubuntu-latest
# 릴리즈 워크플로우 완료 후 실행
if: github.event_name == 'workflow_run' && github.event.workflow_run.name == 'Release' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Generate Release Dashboard
run: |
echo "🚀 릴리즈 후 Linear 대시보드 생성 중..."
# 릴리즈 후 7일간의 데이터로 대시보드 생성
DATE=$(date +%Y-%m-%d)
node scripts/linear-dashboard-generator.cjs \
--api-key="${{ secrets.LINEAR_API_KEY }}" \
--period="7d" \
--format="html" \
--output="post-release-dashboard-${DATE}" \
--verbose
echo "✅ 릴리즈 후 대시보드 생성 완료"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
- name: Upload Release Dashboard
uses: actions/upload-artifact@v4
with:
name: post-release-linear-dashboard
path: reports/post-release-dashboard-*.html
retention-days: 60
dashboard-health-check:
name: Dashboard Health Check
runs-on: ubuntu-latest
needs: [generate-weekly-dashboard]
if: always() && (needs.generate-weekly-dashboard.result == 'success' || needs.generate-monthly-dashboard.result == 'success')
steps:
- name: Health Check Summary
run: |
echo "🏥 Linear Dashboard Health Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status**: ✅ Healthy" >> $GITHUB_STEP_SUMMARY
echo "**Last Generated**: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Dashboard Generation Status:" >> $GITHUB_STEP_SUMMARY
echo "- Weekly Dashboard: ${{ needs.generate-weekly-dashboard.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Monthly Dashboard: ${{ needs.generate-monthly-dashboard.result || 'Not triggered' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Scheduled Runs:" >> $GITHUB_STEP_SUMMARY
echo "- Weekly: Every Monday at 09:00 UTC (18:00 KST)" >> $GITHUB_STEP_SUMMARY
echo "- Monthly: 1st day of month at 09:00 UTC (18:00 KST)" >> $GITHUB_STEP_SUMMARY
notify-dashboard-failure:
name: Dashboard Failure Notification
runs-on: ubuntu-latest
needs: [generate-weekly-dashboard, generate-monthly-dashboard]
if: always() && (needs.generate-weekly-dashboard.result == 'failure' || needs.generate-monthly-dashboard.result == 'failure')
steps:
- name: Failure Notification
run: |
echo "❌ Linear Dashboard Generation Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Failed At**: $(date)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Failure Details:" >> $GITHUB_STEP_SUMMARY
echo "- Weekly Dashboard: ${{ needs.generate-weekly-dashboard.result }}" >> $GITHUB_STEP_SUMMARY
echo "- Monthly Dashboard: ${{ needs.generate-monthly-dashboard.result || 'Not triggered' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Troubleshooting Steps:" >> $GITHUB_STEP_SUMMARY
echo "1. Check LINEAR_API_KEY secret is properly set" >> $GITHUB_STEP_SUMMARY
echo "2. Verify Linear API connectivity" >> $GITHUB_STEP_SUMMARY
echo "3. Review workflow logs for specific errors" >> $GITHUB_STEP_SUMMARY
echo "4. Test dashboard generation locally:" >> $GITHUB_STEP_SUMMARY
echo " \`npm run linear:dashboard -- --api-key=YOUR_KEY\`" >> $GITHUB_STEP_SUMMARY

292
.github/workflows/linear-integration.yml vendored Normal file
View File

@@ -0,0 +1,292 @@
name: Linear Integration
on:
pull_request:
types: [opened, closed, ready_for_review, reopened, synchronize]
pull_request_review:
types: [submitted]
push:
branches: [main, "feature/**", "bugfix/**", "task/**"]
issues:
types: [opened, closed, reopened]
issue_comment:
types: [created]
env:
NODE_VERSION: "18"
jobs:
extract-linear-id:
name: Extract Linear Issue ID
runs-on: ubuntu-latest
outputs:
issue-id: ${{ steps.extract.outputs.issue-id }}
issue-found: ${{ steps.extract.outputs.issue-found }}
steps:
- name: Extract Linear Issue ID
id: extract
run: |
ISSUE_ID=""
ISSUE_FOUND="false"
# PR 이벤트에서 Linear 이슈 ID 추출
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# PR 제목과 본문에서 ZEL-XXX 형태 추출
TEXT="${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}"
ISSUE_ID=$(echo "$TEXT" | grep -oE 'ZEL-[0-9]+' | head -1)
# 브랜치명에서도 추출 시도
if [[ -z "$ISSUE_ID" ]]; then
BRANCH="${{ github.event.pull_request.head.ref }}"
ISSUE_ID=$(echo "$BRANCH" | grep -oE 'ZEL-[0-9]+' | head -1)
fi
# Push 이벤트에서 커밋 메시지 확인
elif [[ "${{ github.event_name }}" == "push" ]]; then
# 최신 커밋 메시지에서 추출
COMMIT_MSG="${{ github.event.head_commit.message }}"
ISSUE_ID=$(echo "$COMMIT_MSG" | grep -oE 'ZEL-[0-9]+' | head -1)
# 이슈 이벤트에서 제목/본문 확인
elif [[ "${{ github.event_name }}" == "issues" ]]; then
TEXT="${{ github.event.issue.title }} ${{ github.event.issue.body }}"
ISSUE_ID=$(echo "$TEXT" | grep -oE 'ZEL-[0-9]+' | head -1)
fi
if [[ -n "$ISSUE_ID" ]]; then
ISSUE_FOUND="true"
echo "Found Linear issue: $ISSUE_ID"
else
echo "No Linear issue ID found"
fi
echo "issue-id=$ISSUE_ID" >> $GITHUB_OUTPUT
echo "issue-found=$ISSUE_FOUND" >> $GITHUB_OUTPUT
sync-pr-events:
name: Sync Pull Request Events
runs-on: ubuntu-latest
needs: extract-linear-id
if: github.event_name == 'pull_request' && needs.extract-linear-id.outputs.issue-found == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: |
echo "Installing Node.js dependencies for Linear integration..."
# npm 캐시는 이미 setup-node에서 처리됨
- name: Sync PR Status
run: |
# PR 머지 여부 확인
PR_MERGED="false"
if [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
PR_MERGED="true"
fi
echo "Syncing PR event:"
echo " Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo " Event: ${{ github.event_name }}"
echo " Action: ${{ github.event.action }}"
echo " PR URL: ${{ github.event.pull_request.html_url }}"
echo " Author: ${{ github.event.pull_request.user.login }}"
echo " Merged: $PR_MERGED"
# Linear 동기화 실행
node scripts/linear-sync.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="${{ github.event_name }}" \
--action="${{ github.event.action }}" \
--pr-url="${{ github.event.pull_request.html_url }}" \
--pr-author="${{ github.event.pull_request.user.login }}" \
--pr-merged="$PR_MERGED"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
- name: Add PR Comment
run: |
echo "Adding comment to Linear issue:"
echo " Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo " Event: ${{ github.event_name }}"
echo " Action: ${{ github.event.action }}"
# Linear 코멘트 추가
node scripts/linear-comment.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="${{ github.event_name }}" \
--action="${{ github.event.action }}" \
--pr-url="${{ github.event.pull_request.html_url }}" \
--pr-author="${{ github.event.pull_request.user.login }}"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
sync-review-events:
name: Sync Review Events
runs-on: ubuntu-latest
needs: extract-linear-id
if: github.event_name == 'pull_request_review' && needs.extract-linear-id.outputs.issue-found == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Sync Review Status
run: |
echo "Syncing review event:"
echo " Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo " Review State: ${{ github.event.review.state }}"
echo " Reviewer: ${{ github.event.review.user.login }}"
echo " PR URL: ${{ github.event.pull_request.html_url }}"
# Linear 코멘트 추가
node scripts/linear-comment.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="pull_request_review" \
--review-state="${{ github.event.review.state }}" \
--reviewer="${{ github.event.review.user.login }}" \
--pr-url="${{ github.event.pull_request.html_url }}"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
sync-push-events:
name: Sync Push Events
runs-on: ubuntu-latest
needs: extract-linear-id
if: github.event_name == 'push' && needs.extract-linear-id.outputs.issue-found == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Sync Commit Status
run: |
echo "Syncing push event:"
echo " Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo " Commit SHA: ${{ github.event.head_commit.id }}"
echo " Commit Message: ${{ github.event.head_commit.message }}"
echo " Author: ${{ github.event.head_commit.author.username }}"
# Linear 동기화 및 코멘트 추가
node scripts/linear-sync.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="push" \
--action="commit"
node scripts/linear-comment.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="push" \
--commit-sha="${{ github.event.head_commit.id }}" \
--commit-message="${{ github.event.head_commit.message }}" \
--pr-author="${{ github.event.head_commit.author.username }}"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
sync-issue-events:
name: Sync Issue Events
runs-on: ubuntu-latest
needs: extract-linear-id
if: github.event_name == 'issues' && needs.extract-linear-id.outputs.issue-found == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Sync Issue Status
run: |
echo "Syncing issue event:"
echo " Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo " Action: ${{ github.event.action }}"
echo " GitHub Issue: ${{ github.event.issue.html_url }}"
# Linear 코멘트 추가
node scripts/linear-comment.cjs \
--issue-id="${{ needs.extract-linear-id.outputs.issue-id }}" \
--event="issue" \
--action="${{ github.event.action }}" \
--github-issue-url="${{ github.event.issue.html_url }}"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
notify-no-linear-id:
name: Notify No Linear ID Found
runs-on: ubuntu-latest
needs: extract-linear-id
if: needs.extract-linear-id.outputs.issue-found == 'false'
steps:
- name: Log Missing Linear ID
run: |
echo "⚠️ No Linear issue ID found in:"
echo " Event: ${{ github.event_name }}"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo " PR Title: ${{ github.event.pull_request.title }}"
echo " Branch: ${{ github.event.pull_request.head.ref }}"
elif [[ "${{ github.event_name }}" == "push" ]]; then
echo " Commit: ${{ github.event.head_commit.message }}"
fi
echo ""
echo "Linear 이슈와 연결하려면 다음 형식을 사용하세요:"
echo " - PR 제목: '[ZEL-123] 기능 구현'"
echo " - 브랜치명: 'feature/ZEL-123-user-auth'"
echo " - 커밋 메시지: 'feat: 로그인 기능 구현 [ZEL-123]'"
summary:
name: Linear Integration Summary
runs-on: ubuntu-latest
needs:
[
extract-linear-id,
sync-pr-events,
sync-review-events,
sync-push-events,
sync-issue-events,
]
if: always()
steps:
- name: Summary
run: |
echo "🔗 Linear Integration Summary"
echo "=============================="
echo "Event: ${{ github.event_name }}"
echo "Linear Issue Found: ${{ needs.extract-linear-id.outputs.issue-found }}"
if [[ "${{ needs.extract-linear-id.outputs.issue-found }}" == "true" ]]; then
echo "Issue ID: ${{ needs.extract-linear-id.outputs.issue-id }}"
echo "✅ Linear integration completed"
else
echo "❌ No Linear issue ID found"
fi
echo ""
echo "Job Results:"
echo " Extract ID: ${{ needs.extract-linear-id.result }}"
echo " PR Sync: ${{ needs.sync-pr-events.result }}"
echo " Review Sync: ${{ needs.sync-review-events.result }}"
echo " Push Sync: ${{ needs.sync-push-events.result }}"
echo " Issue Sync: ${{ needs.sync-issue-events.result }}"

417
.github/workflows/mobile-build.yml vendored Normal file
View File

@@ -0,0 +1,417 @@
name: Mobile Build and Release
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
env:
NODE_VERSION: "18"
JAVA_VERSION: "17"
XCODE_VERSION: "15.0"
jobs:
test:
name: Test and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run type checking
run: npm run type-check
- name: Run comprehensive tests
run: npm run test:ci
build-web:
name: Build Web App
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build web app
run: npm run build:prod
env:
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
VITE_CLERK_PUBLISHABLE_KEY: ${{ secrets.VITE_CLERK_PUBLISHABLE_KEY }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SENTRY_ENVIRONMENT: production
- name: Upload web build artifacts
uses: actions/upload-artifact@v4
with:
name: web-build
path: dist/
build-android:
name: Build Android App
runs-on: ubuntu-latest
needs: build-web
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install dependencies
run: npm ci
- name: Download web build
uses: actions/download-artifact@v4
with:
name: web-build
path: dist/
- name: Sync Capacitor
run: npm run mobile:sync
- name: Create keystore directory
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: mkdir -p android/app/keystore
- name: Decode keystore
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > android/app/keystore/release.keystore
ls -la android/app/keystore/
- name: Set CI environment
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: echo "CI=true" >> $GITHUB_ENV
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
- name: Build Android Debug APK
if: github.event_name == 'pull_request'
run: |
cd android
./gradlew assembleDebug
- name: Build Android Release Bundle
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
cd android
./gradlew bundleRelease --info
env:
CI: true
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
- name: Build Android Release APK
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
cd android
./gradlew assembleRelease --info
env:
CI: true
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: android-artifacts
path: |
android/app/build/outputs/bundle/release/*.aab
android/app/build/outputs/apk/release/*.apk
android/app/build/outputs/apk/debug/*.apk
build-ios:
name: Build iOS App
runs-on: macos-14
needs: build-web
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Download web build
uses: actions/download-artifact@v4
with:
name: web-build
path: dist/
- name: Sync Capacitor
run: npm run mobile:sync
- name: Install CocoaPods dependencies
run: |
cd ios/App
pod install
- name: Import Code-Signing Certificates
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.IOS_CERTIFICATES_P12_BASE64 }}
p12-password: ${{ secrets.IOS_CERTIFICATES_P12_PASSWORD }}
- name: Download Provisioning Profiles
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: Apple-Actions/download-provisioning-profiles@v3
with:
bundle-id: com.zellyy.finance
profile-type: "IOS_APP_STORE"
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Build iOS Debug
if: github.event_name == 'pull_request'
run: |
cd ios/App
xcodebuild -workspace App.xcworkspace -scheme App -configuration Debug -destination 'generic/platform=iOS Simulator' build
- name: Build iOS Release Archive
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
cd ios/App
xcodebuild -workspace App.xcworkspace -scheme App -configuration Release -destination 'generic/platform=iOS' -archivePath App.xcarchive archive
- name: Export iOS IPA
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
cd ios/App
xcodebuild -exportArchive -archivePath App.xcarchive -exportPath ./build -exportOptionsPlist ExportOptions.plist
- name: Upload iOS artifacts
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: ios-artifacts
path: ios/App/build/*.ipa
release:
name: Semantic Release
runs-on: ubuntu-latest
needs: [build-android, build-ios]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: android-artifacts
path: android/app/build/outputs/
- name: Download iOS artifacts
uses: actions/download-artifact@v4
with:
name: ios-artifacts
path: ios/App/build/
- name: Sync versions before release
run: npm run version:sync
- name: Update store metadata
run: npm run store:metadata
- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUSKY: 0
deploy-android:
name: Deploy to Google Play
runs-on: ubuntu-latest
needs: release
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: android-artifacts
path: android/app/build/outputs/
- name: Generate release notes for Google Play
id: release-notes-android
run: |
# 최신 릴리즈 노트 추출 (Google Play 500자 제한)
if [ -f "CHANGELOG.md" ]; then
NOTES=$(head -c 450 CHANGELOG.md | sed 's/## \[.*\]//' | sed 's/### /• /' | tr '\n' ' ')
else
NOTES="Zellyy Finance 새 버전이 출시되었습니다. 향상된 성능과 새로운 기능을 경험해보세요."
fi
echo "RELEASE_NOTES=${NOTES}" >> $GITHUB_OUTPUT
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.zellyy.finance
releaseFiles: android/app/build/outputs/bundle/release/*.aab
track: internal
status: completed
whatsNewDirectory: android/metadata/
releaseNotes: ${{ steps.release-notes-android.outputs.RELEASE_NOTES }}
deploy-ios:
name: Deploy to TestFlight
runs-on: macos-14
needs: release
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download iOS artifacts
uses: actions/download-artifact@v4
with:
name: ios-artifacts
path: ios/App/build/
- name: Generate release notes for TestFlight
id: release-notes-ios
run: |
# 최신 릴리즈 노트 추출 (TestFlight 4000자 제한)
if [ -f "CHANGELOG.md" ]; then
NOTES=$(head -c 3000 CHANGELOG.md | sed 's/## \[.*\]/Zellyy Finance 업데이트/' | sed 's/### /• /')
else
NOTES="Zellyy Finance 새 버전이 출시되었습니다.\n\n향상된 성능과 새로운 기능을 경험해보세요.\n\n문의사항이 있으시면 개발팀에 연락주세요."
fi
echo "RELEASE_NOTES=${NOTES}" >> $GITHUB_OUTPUT
- name: Upload to TestFlight
uses: Apple-Actions/upload-testflight-build@v1
with:
app-path: ios/App/build/App.ipa
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
changelog: ${{ steps.release-notes-ios.outputs.RELEASE_NOTES }}
notify:
name: Notify Build Status
runs-on: ubuntu-latest
needs:
[
test,
build-web,
build-android,
build-ios,
release,
deploy-android,
deploy-ios,
]
if: always()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Notify Success
if: needs.deploy-android.result == 'success' && needs.deploy-ios.result == 'success'
run: |
node scripts/notification-handler.cjs success "🎉 배포 성공!" "Android 및 iOS 앱이 성공적으로 배포되었습니다."
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
NOTIFICATION_EMAIL: ${{ secrets.NOTIFICATION_EMAIL }}
- name: Notify Failure
if: |
needs.test.result == 'failure' ||
needs.build-web.result == 'failure' ||
needs.build-android.result == 'failure' ||
needs.build-ios.result == 'failure' ||
needs.release.result == 'failure' ||
needs.deploy-android.result == 'failure' ||
needs.deploy-ios.result == 'failure'
run: |
node scripts/notification-handler.cjs failure "💥 빌드/배포 실패" "파이프라인 실행 중 오류가 발생했습니다. 상세 내용은 GitHub Actions 로그를 확인하세요."
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
NOTIFICATION_EMAIL: ${{ secrets.NOTIFICATION_EMAIL }}
- name: Notify Warning
if: |
!contains(fromJSON('["failure"]'), needs.test.result) &&
!contains(fromJSON('["failure"]'), needs.build-web.result) &&
!contains(fromJSON('["failure"]'), needs.build-android.result) &&
!contains(fromJSON('["failure"]'), needs.build-ios.result) &&
!contains(fromJSON('["failure"]'), needs.release.result) &&
(needs.deploy-android.result == 'failure' || needs.deploy-ios.result == 'failure')
run: |
node scripts/notification-handler.cjs warning "⚠️ 부분 배포 성공" "빌드는 성공했지만 일부 배포에서 문제가 발생했습니다."
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
NOTIFICATION_EMAIL: ${{ secrets.NOTIFICATION_EMAIL }}

232
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,232 @@
name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
release_type:
description: "Release type"
required: true
default: "auto"
type: choice
options:
- auto
- patch
- minor
- major
env:
NODE_VERSION: "18"
jobs:
# 기존 CI 체크들
quality-checks:
name: Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run type-check
- name: Lint
run: npm run lint
- name: Test
run: npm run test:run
# 빌드 검증
build-verification:
name: Build Verification
runs-on: ubuntu-latest
needs: quality-checks
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build web
run: npm run build
- name: Build mobile (sync only)
run: npm run mobile:sync
# Linear 이슈 검증
linear-validation:
name: Linear Issue Validation
runs-on: ubuntu-latest
needs: quality-checks
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Validate Linear issues in commits
run: |
echo "🔍 Checking for Linear issues in recent commits..."
# 마지막 릴리즈 이후 커밋들에서 Linear 이슈 추출
COMMITS=$(git log --pretty=format:"%H %s" --since="7 days ago")
LINEAR_ISSUES=$(echo "$COMMITS" | grep -oE 'ZEL-[0-9]+' | sort -u || true)
if [[ -n "$LINEAR_ISSUES" ]]; then
echo "✅ Found Linear issues:"
echo "$LINEAR_ISSUES" | sed 's/^/ - /'
# 환경 변수로 설정하여 릴리즈에서 사용
echo "LINEAR_ISSUES_FOUND=true" >> $GITHUB_ENV
echo "LINEAR_ISSUE_COUNT=$(echo "$LINEAR_ISSUES" | wc -l)" >> $GITHUB_ENV
else
echo " No Linear issues found in recent commits"
echo "LINEAR_ISSUES_FOUND=false" >> $GITHUB_ENV
echo "LINEAR_ISSUE_COUNT=0" >> $GITHUB_ENV
fi
# Semantic Release
release:
name: Semantic Release
runs-on: ubuntu-latest
needs: [quality-checks, build-verification]
if: github.ref == 'refs/heads/main'
outputs:
new-release-published: ${{ steps.semantic-release.outputs.new-release-published }}
new-release-version: ${{ steps.semantic-release.outputs.new-release-version }}
new-release-notes: ${{ steps.semantic-release.outputs.new-release-notes }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Semantic Release
id: semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
- name: Release Summary
if: steps.semantic-release.outputs.new-release-published == 'true'
run: |
echo "🎉 새로운 릴리즈가 생성되었습니다!"
echo "Version: v${{ steps.semantic-release.outputs.new-release-version }}"
echo "Release notes: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ steps.semantic-release.outputs.new-release-version }}"
# 릴리즈 후 Linear 동기화
post-release-linear:
name: Post-Release Linear Sync
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.new-release-published == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Linear Release Notification
run: |
echo "🔗 Updating Linear issues for release v${{ needs.release.outputs.new-release-version }}"
# Linear 이슈들에 릴리즈 완료 알림 (이미 semantic-release에서 처리됨)
echo "✅ Linear integration completed via semantic-release"
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
# 배포 알림
deployment-notification:
name: Deployment Notification
runs-on: ubuntu-latest
needs: [release, post-release-linear]
if: needs.release.outputs.new-release-published == 'true'
steps:
- name: Deployment Success Notification
run: |
echo "🚀 릴리즈 v${{ needs.release.outputs.new-release-version }} 배포 완료"
echo ""
echo "배포된 내용:"
echo "- 웹 애플리케이션: Vercel에 자동 배포"
echo "- 모바일 앱: 스토어 배포 대기 중"
echo "- Linear 이슈: 릴리즈 완료 알림 전송"
echo ""
echo "다음 단계:"
echo "1. 프로덕션 환경 동작 확인"
echo "2. Linear 이슈 상태 확인"
echo "3. 사용자 피드백 모니터링"
# 릴리즈 실패 시 롤백 준비
rollback-preparation:
name: Rollback Preparation
runs-on: ubuntu-latest
needs: release
if: failure() && github.ref == 'refs/heads/main'
steps:
- name: Rollback Information
run: |
echo "❌ 릴리즈 프로세스에서 오류가 발생했습니다."
echo ""
echo "확인 사항:"
echo "1. Quality checks 통과 여부"
echo "2. Build verification 성공 여부"
echo "3. Linear API 연결 상태"
echo "4. GitHub token 권한"
echo ""
echo "복구 방법:"
echo "1. 로그에서 정확한 오류 원인 파악"
echo "2. 필요시 이전 릴리즈로 수동 롤백"
echo "3. 문제 해결 후 재배포"