android-cicd
它能做什么
这个技能设置一条可重复使用的流水线,每次变更时构建 Android 应用并将其发送到 Google Play。适合发布 Android 应用、并希望不再手动发布的开发者。
适用场景
- ✓你希望每次推送到主分支时都构建并发布 Android 应用的时候。
- ✓你的应用还没有自动化构建或发布流水线的时候。
- ✓你希望由系统处理 Google Play 的发布阶段,例如内部测试、alpha、beta 和正式版的时候。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/android-cicd/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请设置我的 Android 应用在每次推送到 GitHub 时自动发布到 Google Play。”
每周 5 个新技能,1 分钟读完。
工作原理
它在你的项目文件夹中运行一个设置向导。向导检查你的应用类型,创建签名密钥,将机密信息存储到 GitHub 中,并编写执行发布的工作流文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
mainand on version tags - User wants to avoid manual
versionCodebumping
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
keytoolaccessible (JAVA_HOMEset, or installed via Eclipse Adoptium / Android Studio) ghCLI 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:
- Reads the current
versionCodefrom the version file for the detected framework - Increments it by 1
- Commits the change with
[skip ci](prevents re-triggering the workflow) - 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.homeingradle.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
常见问题
使用前我需要手动发布应用吗?
需要。这个技能说明,在 API 能够发布之前,至少需要手动上传一次到 Play Console。
它支持哪些应用类型?
这个技能提到了 Trusted Web Activity、React Native、Flutter 和原生 Android 项目。
我需要先安装什么?
Node.js 18 或更新版本、JDK 17,以及已登录你账户的 GitHub CLI。
详情
作者的原始描述
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.
热度
- GitHub 星标
- 33k
- 排名
- #8724
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。