mcpField
M
mobile-cicd

mobile-cicd

github.com/travisjneumanクラウド・DevOps106147 回インストール1 日前に更新
リポジトリ

mobile-cicd について

iOS と Android のリリースパイプラインを構築するチーム向けの実用スキルです。ビルド、テスト、コード署名、ベータ配布、ストア公開の例とチェック項目を提供します。

主な機能

  1. 01Fastlane の lane 例
  2. 02iOS と Android のコード署名
  3. 03GitHub Actions ワークフロー例
  4. 04Expo EAS のビルドと提出コマンド
  5. 05ベータ配布の選択肢
  6. 06リリースチェックリストと ASO の指針

活用シーン

  1. 01モバイルアプリの CI ワークフロー構築
  2. 02リリース用署名認証情報の管理
  3. 03QA 向けベータビルドの準備
  4. 04アプリストア公開準備の確認

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/travisjneuman/.claude --skill mobile-cicd

インストール後、Claude Code で/mobile-cicdを入力して読み込まれたか確認します。

詳細

モバイル CI/CD スキル

iOS および Android アプリのビルド、テスト、署名、デプロイを自動化するパイプラインです。


Fastlane

iOS Fastfile
# ios/fastlane/Fastfile
default_platform(:ios)

platform :ios do
  desc "Run tests"
  lane :test do
    run_tests(scheme: "MyApp")
  end

  desc "Build and upload to TestFlight"
  lane :beta do
    increment_build_number(xcodeproj: "MyApp.xcodeproj")
    match(type: "appstore", readonly: true)
    build_app(scheme: "MyApp", export_method: "app-store")
    upload_to_testflight(skip_waiting_for_build_processing: true)
    slack(message: "New iOS beta uploaded to TestFlight")
  end

  desc "Deploy to App Store"
  lane :release do
    match(type: "appstore", readonly: true)
    build_app(scheme: "MyApp", export_method: "app-store")
    upload_to_app_store(
      submit_for_review: true,
      automatic_release: false,
      force: true
    )
  end
end
Android Fastfile
# android/fastlane/Fastfile
default_platform(:android)

platform :android do
  desc "Run tests"
  lane :test do
    gradle(task: "test")
  end

  desc "Build and upload to Play Store internal track"
  lane :beta do
    gradle(task: "bundleRelease")
    upload_to_play_store(
      track: "internal",
      aab: "app/build/outputs/bundle/release/app-release.aab"
    )
  end

  desc "Promote to production"
  lane :release do
    upload_to_play_store(
      track: "internal",
      track_promote_to: "production",
      rollout: "0.1" # 10% rollout
    )
  end
end

コード署名

iOS(match)
# Matchfile
git_url("https://github.com/org/certificates.git")
storage_mode("git")
type("appstore")
app_identifier("com.example.myapp")

# Usage
match(type: "development")  # Dev certificates
match(type: "appstore")     # Distribution certificates
Android(Keystore)
# Generate keystore (once)
keytool -genkey -v -keystore release.keystore \
  -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

# Store securely - NEVER commit to git
# Use CI secrets or encrypted storage
// android/app/build.gradle
android {
    signingConfigs {
        release {
            storeFile file(System.getenv("KEYSTORE_PATH") ?: "release.keystore")
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyAlias System.getenv("KEY_ALIAS")
            keyPassword System.getenv("KEY_PASSWORD")
        }
    }
}

GitHub Actions

React Native / Expo
# .github/workflows/mobile-ci.yml
name: Mobile CI/CD
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
      - run: npm test
      - run: npx tsc --noEmit

  build-ios:
    needs: test
    runs-on: macos-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - uses: ruby/setup-ruby@v1
        with: { ruby-version: '3.2' }
      - run: npm ci
      - run: cd ios && bundle install && bundle exec fastlane beta
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}

  build-android:
    needs: test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with: { java-version: '17', distribution: 'temurin' }
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
      - run: cd android && bundle install && bundle exec fastlane beta
        env:
          KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
          KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}

EAS Build(Expo)

// eas.json
{
  "cli": { "version": ">= 12.0.0" },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "ios": { "simulator": false },
      "channel": "preview"
    },
    "production": {
      "channel": "production",
      "autoIncrement": true
    }
  },
  "submit": {
    "production": {
      "ios": { "appleId": "[email protected]", "ascAppId": "1234567890" },
      "android": { "serviceAccountKeyPath": "./google-sa-key.json" }
    }
  }
}
# Build for preview
eas build --profile preview --platform all

# Build for production
eas build --profile production --platform all

# Submit to stores
eas submit --platform ios --latest
eas submit --platform android --latest

# OTA update (no store review)
eas update --branch production --message "Bug fix"

ベータ版の配布

プラットフォームiOSAndroid
ファーストパーティTestFlightPlay Store 内部テストトラック
FirebaseApp DistributionApp Distribution
ExpoEAS 内部配布EAS 内部配布

アプリストア最適化(ASO)

  • タイトル:主要キーワード+ブランド名(iOS は 30 文字、Android は 50 文字)
  • サブタイトル/短い説明:関連キーワード
  • スクリーンショット:主要機能を紹介し、デバイスフレームを使用します
  • キーワード欄(iOS のみ):カンマ区切りで、スペースは入れません
  • バージョンごとにリリースノートを更新します
  • レビューに返信します(ランキングの向上につながります)

リリースチェックリスト

  • 既存の CI チェックがすべて成功している(新しいテストの実行はユーザーから依頼された場合のみ)
  • バージョン番号を更新した
  • ビルド番号を増加した
  • リリースノートを作成した
  • スクリーンショットを更新した(UI に変更がある場合)
  • QA チームによるベータテストを完了した
  • コード署名が有効で、まもなく期限切れにならない
  • プライバシーポリシーの URL が最新である
  • アプリの審査ガイドラインへの準拠を確認した

関連リソース

  • ~/.claude/skills/react-native/SKILL.md - React Native の開発
  • ~/.claude/skills/flutter-development/SKILL.md - Flutter の開発
  • agent-mobile-release-manager スキル - リリース管理のスペシャリスト
  • ~/.claude/docs/reference/workflows/deployment-cicd.md - 一般的な CI/CD パターン

すべてを自動化し、安全に署名して、自信を持ってリリースしましょう。

コメント