
mobile-cicd
Complete GitHub Actions CI/CD for Capacitor, Expo and React Native apps, with tag-driven App Store and Google Play releases.
- GitHub stars
- 7
Install
/plugin install mobile-cicd@mobile-cicd-skillRun it inside Claude Code after adding the marketplace with /plugin marketplace add Oranamar9/mobile-cicd-skill.
Contents
Discovered from sourceSkills 1
Mobile CI/CD
Turn a Capacitor or Expo / React Native app into one that releases itself: a tag on main ends
in both stores. Detection and rendering are done by bundled scripts, so the output is the same
every time. Your job is the judgment around them: confirming what was detected, merging with
what the project already has, and getting the secrets and store accounts ready.
${CLAUDE_SKILL_DIR} below is the folder that holds this file. If it is not substituted in
your environment, use that folder's path.
What the app gets
| File | What it does |
|---|---|
.github/workflows/ci.yml | Lint, format, types, tests, build on every push and PR to main |
.github/workflows/security.yml | Gitleaks over the whole history, dependency audit, Semgrep; also weekly |
.github/workflows/mobile-release.yml | On a vX.Y.Z tag that is on main: gate, CI and Security again, next build number, then iOS (macOS) and Android (Ubuntu) to production. Building and signing/uploading are separate jobs, so dependency code never sees a store secret |
fastlane/Fastfile, fastlane/Appfile, Gemfile | The build, sign, upload and submit lanes |
.github/mobile-cicd/config.json | Every setting. The source for re-rendering |
.github/mobile-cicd/set-versions.mjs | Writes the version and build number into the app during the build |
.github/mobile-cicd/setup-secrets.sh, check-store-access.mjs | Sets and checks the secrets (the user runs it) |
.github/mobile-cicd/check-workflow-secrets.mjs | Fails CI and the release gate if a workflow edit lets secrets reach dependency code, a command line or a log |
.github/mobile-cicd/README.md | How to release, the production switches, the one-time setup, fixes |
Design decisions already agreed for this pipeline. Explain them if asked, and don't "fix" them:
- Every tag is a production release. No internal or beta tracks. Native builds happen only here, because macOS minutes cost about ten times Linux minutes in private repos.
- The build number is the highest one either store has seen, plus one. Nothing is committed
back to
main, so it works with branch protection and never collides. The version comes from the tag. - iOS submit runs on a Linux job. Waiting 5-30 minutes for Apple's processing on macOS would be expensive.
- Store secrets never meet dependency code. Install scripts, Expo config plugins, CocoaPods
and Gradle plugins all run in the build jobs, which get no store secret. Android is built
with a throwaway key and re-signed with the upload key by
jarsignerinandroid-release, a fresh runner that only runs fastlane and the JDK. Uploads to both stores run in jobs of their own. iOS signs inside Xcode, soios-buildimports the certificate in "Prepare signing", before any dependency code, as a non-extractable key. Every secret goes to the one step that needs it, actions are pinned to commit SHAs, and passwords go through the environment, never on a command line. Don't move a secret into a job-levelenv, or into a build step, to "fix" a failure:check-workflow-secrets.mjswill fail, and it is right to. - Switches at the top of
mobile-release.yml:IOS_SUBMIT_FOR_REVIEW,IOS_AUTOMATIC_RELEASE,ANDROID_ROLLOUT.
Ground rules
- Secret values never pass through you. Don't ask for them. Don't read
.env*files, keystores,.p8,.p12or service-account JSON. Don't put them on a command line. The user runssetup-secrets.shin their own terminal, and it sends values from files and hidden prompts straight togh secret set. Names are fine:--checklists names only, and you may run it. If the user pastes a secret anyway, don't repeat it or write it anywhere. Tell them it is now in the chat log and should be rotated, using the "Rotating" notes in references/secrets.md. - Don't overwrite what the project has. Existing workflows often carry jobs the generic pipeline doesn't know about: database tests, edge functions, local plugin builds, store checks. Render to a scratch folder, diff, and merge with the user's OK.
- Committing, pushing, tagging and creating repos are the user's call. Ask first. Pushing a tag is a production release in both stores.
Workflow
1. Detect
node "${CLAUDE_SKILL_DIR}/scripts/detect.mjs" <repo root>
It prints summary, a draft config, notes.warnings, notes.questions and existing, and
writes nothing.
- Exit code 2 means the stack is unsupported (Flutter, native, Cordova, not a mobile app). Say so plainly. Flutter and native are planned. Stop there.
- The app must be the repo root. Monorepos are not supported yet.
- If
existing.workflowshas CI or release workflows, read them now. Note anything project-specific that must survive.
2. Confirm with the user
Show a short table: framework, package manager, bundle ID, Team ID, package name, Xcode scheme, CI steps, build env file and Firebase files. Then ask only what is open:
- every entry in
notes.questions - any warning that needs a decision, such as two release pipelines or app extensions
- the production defaults: submit for review, go live on approval, Android at 100%. Mention that each is a one-line switch later.
Keep it to one round of questions if you can.
3. Write the config
node "${CLAUDE_SKILL_DIR}/scripts/detect.mjs" <repo root> --write
Then edit .github/mobile-cicd/config.json with the answers. Every field is described in
references/config.md. Things you'll often set by hand:
hooks.afterInstallfor build prerequisites, such as compiling local Capacitor pluginsci.*to point at the project's real commandsrelease.*for the production switchesandroid.reactNativeArchitecturesto speed up React Native builds
4. Render
node "${CLAUDE_SKILL_DIR}/scripts/render.mjs" --root <repo root>
Files that exist and would change are left alone and listed (exit code 3). For those, render
to a scratch folder with --out <tmp dir>, diff each one against the repo, and show the user
what changes. Then write the merged result, usually the generated file plus the project's
extra jobs. Use --force only when the user agrees to replace a file.
The Gemfile is kept if it already has fastlane. If it exists without fastlane, add
gem "fastlane", "~> 2.241" to it. If Ruby and Bundler work locally, run
bundle lock --add-platform x86_64-linux arm64-darwin so CI and Macs resolve the same gems.
5. Check the result
Run the checks that are available:
actionlint(if it isn't installed, offerbrew install actionlintand ask first)ruby -c fastlane/Fastfilebash -n .github/mobile-cicd/setup-secrets.shnode --check .github/mobile-cicd/*.mjsnode .github/mobile-cicd/check-workflow-secrets.mjs, which must pass. Run it again after merging project-specific jobs or steps into the workflows. A secret the project's own build needs (a Sentry token for source maps, say) can go to a build step, but never the store secrets.- the project's own lint and format check, the same commands as
ci.lintandci.format. The generated.mjsfiles carry/* eslint-disable */, and render adds the generated files to.prettierignorewhen the project uses Prettier. Some setups still need a hand edit, such as typed ESLint (parserOptions.project) or a lint step that checks YAML. If so, add.github/mobile-cicd/and the three workflow files to that tool's ignore list. A CI that fails on its own files on day one is the worst first impression this skill can make.
Then read mobile-release.yml once with this app in mind. Check that the prebuild versus
committed steps, the paths and the scheme make sense.
Optionally run set-versions.mjs locally with a test version, look at the diff, then
git checkout -- the touched files.
6. Secrets
First make sure the GitHub CLI is ready. The script itself only reports problems; helping fix them is your job here:
gh --version: if it's missing or older than 2.40, offer to install or upgrade it. On macOS with Homebrew that'sbrew install gh/brew upgrade gh; elsewhere point to https://github.com/cli/cli#installation. Ask before installing anything.gh auth status: if it isn't signed in, ask the user to rungh auth loginin their own terminal. It opens a browser and uses their GitHub account, so it's theirs to do.
Then check what is already set:
bash .github/mobile-cicd/setup-secrets.sh --check
This shows names only. For each missing secret, explain where it comes from, using the matching section of references/secrets.md and only what this user needs. Then give them the command to run in their own terminal:
bash .github/mobile-cicd/setup-secrets.sh # everything
bash .github/mobile-cicd/setup-secrets.sh ios # or one part: env | ios | android | play | firebase
Tell them what it will ask for. If they have no Android upload key, the script creates one,
and they must back up the keystore and its password. Don't run the interactive script
yourself: it needs their files, their passwords and a terminal. When they're done, run
--check again.
7. One-time store setup
Go through references/store-setup.md with the user. The items that block a first release are:
- the first
.aabmust be uploaded by hand - the Google Play closed-testing rule (12 testers for 14 days) for newer personal accounts
- the first iOS version's store listing
- export compliance
8. First release
Offer to commit the files on a branch or PR, following how this repo works. Once they are on
main, the release is:
git tag -a v1.2.3 -m "What's new" && git push origin v1.2.3
gh run watch
For a cautious first run, suggest IOS_SUBMIT_FOR_REVIEW: 'false' (upload only) and a small
ANDROID_ROLLOUT. Raise them once the pipeline has proven itself.
Later changes
To change a setting, edit config.json and render again, diffing first. After a skill update,
render again to pick up template fixes. When a run fails, gh run view --log-failed shows the
failing step. Match it in references/troubleshooting.md.
Sponsors
Details
- Marketplace
- Oranamar9/mobile-cicd-skill
- Category
- Community