Chuyển đến nội dung
Skillpedia
Ứng dụng di động33k · #8724

android-cicd

Skill này làm gì

Skill này thiết lập một quy trình lặp lại được, tự build ứng dụng Android và gửi lên Google Play mỗi khi có thay đổi. Skill dành cho developer phát hành ứng dụng Android và muốn không còn phải phát hành thủ công.

Khi nào nên dùng

  • ✓Khi bạn muốn mỗi lần push lên nhánh chính đều tự build và xuất bản ứng dụng Android.
  • ✓Khi ứng dụng của bạn chưa có quy trình build hoặc phát hành tự động.
  • ✓Khi bạn muốn các giai đoạn phát hành Google Play như internal, alpha, beta và production được xử lý tự động.

Liên kết skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/android-cicd/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/android-cicd/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập tự động xuất bản ứng dụng Android của tôi lên Google Play mỗi khi tôi push lên GitHub.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill chạy một trình hướng dẫn thiết lập trong thư mục dự án. Trình hướng dẫn kiểm tra loại ứng dụng, tạo khóa ký, lưu các secret vào GitHub và viết file workflow thực hiện việc xuất bản.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Skill: android-cicd

Purpose

Set up a complete, multi-stage Android CI/CD pipeline that automatically builds and publishes to Google Play via GitHub Actions. Supports TWA (Trusted Web Activity / Bubblewrap), React Native, Flutter, and native Android (Gradle) projects.

When to Use

  • The project has an Android app tracked in a GitHub repository
  • No CI/CD pipeline exists yet for the Android build
  • Goal: automate publishing to Google Play on every push to main and on version tags
  • User wants to avoid manual versionCode bumping

Quick Start

Run the interactive setup wizard from the root of the target project:

npx android-cicd

The wizard handles: framework detection → keystore generation → GitHub Secrets → workflow scaffold.


Prerequisites

Before running the wizard, ensure:

  • Node.js ≥ 18
  • JDK 17 installed with keytool accessible (JAVA_HOME set, or installed via Eclipse Adoptium / Android Studio)
  • gh CLI installed and authenticated (gh auth login)
  • App already created in Google Play Console — at least one manual AAB/APK upload done (required before the API can publish)
  • App enrolled in Play App Signing (Google manages the signing key; you manage the upload key)
  • Google Play Android Developer API enabled in Google Cloud Console
  • Service account JSON key downloaded (see Manual Steps below)

Framework Detection

The wizard auto-detects the framework from the project directory structure:

Condition Detected framework
pubspec.yaml contains flutter: flutter
android/app/build.gradle exists + package.json has react-native dep react-native
android-root-app/build.gradle or twa-manifest.json or .bubblewrap/config.json exists twa
app/build.gradle exists native
android/app/build.gradle exists (fallback) native

The user can override the detected framework during the wizard.


Multi-Stage Pipeline

The scaffolded workflow publishes to different tracks based on the git ref:

Git event Google Play track
Push to main internal
Tag matching v*-alpha (e.g. v1.2-alpha) alpha
Tag matching v*-beta (e.g. v1.2-beta) beta
Tag matching v* (e.g. v1.2.0) production
Manual workflow_dispatch User-selectable (internal / alpha / beta / production)

To release to production:

git tag v1.2.0
git push origin v1.2.0

Auto-Bump versionCode

On every push to main, CI automatically:

  1. Reads the current versionCode from the version file for the detected framework
  2. Increments it by 1
  3. Commits the change with [skip ci] (prevents re-triggering the workflow)
  4. Pushes the commit back to main

Version file by framework:

Framework Version file Field
TWA android-root-app/build.gradle versionCode
React Native android/app/build.gradle versionCode
Flutter pubspec.yaml version: x.y.z+N (the +N build number)
Native app/build.gradle versionCode

For tag-based builds (alpha / beta / production), auto-bump does not run — the tag represents a pinned commit. Increment the version manually before tagging.


Required GitHub Secrets

The wizard sets these automatically via gh secret set:

Secret Description
KEYSTORE_FILE Base64-encoded upload keystore (.jks)
KEYSTORE_PASSWORD Keystore password
KEY_ALIAS Key alias (e.g. upload)
KEY_PASSWORD Key password (usually same as KEYSTORE_PASSWORD)
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON Full JSON content of the service account key

Signing Configuration

TWA / Native Android

Add to your build.gradle (see templates/gradle/signing.gradle):

android {
    signingConfigs {
        release {
            storeFile file("keystore.jks")
            storePassword System.getenv("KEYSTORE_PASSWORD")
            keyAlias System.getenv("KEY_ALIAS")
            keyPassword System.getenv("KEY_PASSWORD")
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            signingConfig signingConfigs.release
        }
    }
}

Never set org.gradle.java.home in gradle.properties — it breaks Linux CI runners.

Flutter

The CI workflow creates android/key.properties at build time (from secrets) and cleans it up after. Your `android/ap

Câu hỏi thường gặp

Tôi có cần xuất bản ứng dụng thủ công trước khi dùng không?

Có. Skill lưu ý cần ít nhất một lần tải lên thủ công lên Play Console trước khi API có thể xuất bản.

Skill hỗ trợ những loại ứng dụng nào?

Skill nhắc đến Trusted Web Activity, React Native, Flutter và dự án Android native.

Tôi cần cài gì trước?

Node.js 18 trở lên, JDK 17, và GitHub CLI đã đăng nhập vào tài khoản của bạn.

Chi tiết

Mô tả gốc của tác giả

Automated Android CI/CD pipeline to Google Play — supports TWA, React Native, Flutter, and native Android. Run npx android-cicd to set up keystore generation, GitHub Secrets, and a multi-stage workflow (internal/alpha/beta/production) with auto-bump versionCode.

repo: davila7/claude-code-templates

Độ phổ biến

Sao GitHub
33k
Vị trí xếp hạng
#8724
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự