Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.
Integrating capwrap-cli into your CI/CD pipeline lets you trigger builds and deploy to the App Store or Google Play automatically on every push, without any manual steps in the dashboard. This is useful for teams that want to ship mobile app updates as part of their standard release workflow.
Never commit your Capwrapper API key to version control. Store it as an encrypted secret in your CI/CD platform and reference it via an environment variable. Anyone with access to your API key can trigger builds and deployments on your account.
For CI/CD use, install capwrap-cli as a dev dependency rather than globally. This pins the CLI version to your project, ensures every pipeline run uses the same version, and avoids global install permission issues in CI environments.
npm install --save-dev capwrap-cli
When capwrap-cli is installed as a dev dependency, run every command with npx capwrap instead of capwrap. The npx prefix resolves the binary from your local node_modules, so no global install is needed.
Add your Capwrapper API key as a secret named CAPWRAP_API_KEY in your CI/CD platform. The examples below reference it as ${{ secrets.CAPWRAP_API_KEY }} (GitHub Actions) and $CAPWRAP_API_KEY (GitLab CI).
Always store API keys as secrets. Never hardcode them in your pipeline configuration or commit them to your repository.
Pin the CLI version using npm install --save-dev capwrap-cli. This prevents unexpected behavior if a new CLI version introduces breaking changes.
Validate your config before building. Add a capwrap validate step before capwrap build create to catch configuration errors early and avoid burning build minutes on a job that will fail.
Check build status before deploying. Use capwrap build status <build-id> to confirm a build completed successfully before triggering a deployment step.
Use environment-specific variables for --url, --name, and --bundle-id so the same pipeline works across staging and production environments without modification.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Capwrapper","colors":{"primary":"#41b0f0","light":"#0c0f10","dark":"#dae3e7"},"logo":{"light":"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png","dark":"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png"},"favicon":"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png","navbar":{"primary":{"type":"github","href":"https://capwrapper.com"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"capwrapper","hasAudioNarration":false,"actualSubdomain":"capwrapper","customDomains":["docs.capwrapper.com"],"gitSource":{"type":"github","owner":"mintlify-community","repo":"docs-capwrapper-9917996b","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21dcdea00fa423a8a63e1f","collectionId":"74f3ec28-91f8-4e41-a152-7a8d58c566a4","schemaVersion":"v2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a21dcdea00fa423a8a63e1f:success","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"Documentation","count":13},{"language":"default","tag":"Developer Tools","count":7},{"language":"default","tag":"CLI","count":4},{"language":"default","tag":"Native Features","count":4},{"language":"default","tag":"REST API","count":3},{"language":"default","tag":"Deployment","count":3},{"language":"default","tag":"Help","count":2},{"language":"default","tag":"Configuration","count":2},{"language":"default","tag":"Get Started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"hello@capwrapper.com","showHelpButton":true}},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cli/ci-cd","slug":"/cli/ci-cd","pageMetadata":{"title":"Automate Builds","description":"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.","href":"/cli/ci-cd"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Integrating `,_jsx(_components.code,{children:`capwrap-cli`}),` into your CI/CD pipeline lets you trigger builds and deploy to the App Store or Google Play automatically on every push, without any manual steps in the dashboard. This is useful for teams that want to ship mobile app updates as part of their standard release workflow.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Never commit your Capwrapper API key to version control. Store it as an encrypted secret in your CI/CD platform and reference it via an environment variable. Anyone with access to your API key can trigger builds and deployments on your account.`})}),`\n`,_jsx(Heading,{level:`2`,id:`install-as-a-dev-dependency`,children:`Install as a dev dependency`}),`\n`,_jsxs(_components.p,{children:[`For CI/CD use, install `,_jsx(_components.code,{children:`capwrap-cli`}),` as a dev dependency rather than globally. This pins the CLI version to your project, ensures every pipeline run uses the same version, and avoids global install permission issues in CI environments.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --save-dev`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` capwrap-cli`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`capwrap-cli`}),` is installed as a dev dependency, run every command with `,_jsx(_components.code,{children:`npx capwrap`}),` instead of `,_jsx(_components.code,{children:`capwrap`}),`. The `,_jsx(_components.code,{children:`npx`}),` prefix resolves the binary from your local `,_jsx(_components.code,{children:`node_modules`}),`, so no global install is needed.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`store-your-api-key-as-a-secret`,children:`Store your API key as a secret`}),`\n`,_jsxs(_components.p,{children:[`Add your Capwrapper API key as a secret named `,_jsx(_components.code,{children:`CAPWRAP_API_KEY`}),` in your CI/CD platform. The examples below reference it as `,_jsx(_components.code,{children:\"${{ secrets.CAPWRAP_API_KEY }}\"}),` (GitHub Actions) and `,_jsx(_components.code,{children:`$CAPWRAP_API_KEY`}),` (GitLab CI).`]}),`\n`,_jsx(Heading,{level:`2`,id:`github-actions-example`,children:`GitHub Actions example`}),`\n`,_jsxs(_components.p,{children:[`The workflow below triggers on every push to `,_jsx(_components.code,{children:`main`}),`, installs `,_jsx(_components.code,{children:`capwrap-cli`}),`, authenticates, and creates an Android build.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Build Android App`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` branches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runs-on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ubuntu-latest`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` steps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/checkout@v3`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Set up Node.js`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/setup-node@v3`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` node-version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'18'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Install capwrap-cli`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`npm install -g capwrap-cli`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Authenticate`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"capwrap auth login --key ${{ secrets.CAPWRAP_API_KEY }}\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Create build`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` capwrap build create \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --url https://myapp.example.com \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --name \"My App\" \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --bundle-id com.example.myapp \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --platform android`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`gitlab-ci-example`,children:`GitLab CI example`}),`\n`,_jsxs(_components.p,{children:[`The equivalent pipeline for GitLab CI. Set `,_jsx(_components.code,{children:`CAPWRAP_API_KEY`}),` as a masked CI/CD variable in your project’s `,_jsx(_components.strong,{children:`Settings > CI/CD > Variables`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`build-android`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` image`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`node:18`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`npm install -g capwrap-cli`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`capwrap auth login --key $CAPWRAP_API_KEY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`capwrap build create --url $APP_URL --name \"$APP_NAME\" --bundle-id $BUNDLE_ID`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use GitLab CI/CD variables (`,_jsx(_components.code,{children:`$APP_URL`}),`, `,_jsx(_components.code,{children:`$APP_NAME`}),`, `,_jsx(_components.code,{children:`$BUNDLE_ID`}),`) to keep your pipeline configuration reusable across environments.`]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best practices`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Always store API keys as secrets.`}),` Never hardcode them in your pipeline configuration or commit them to your repository.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pin the CLI version`}),` using `,_jsx(_components.code,{children:`npm install --save-dev capwrap-cli`}),`. This prevents unexpected behavior if a new CLI version introduces breaking changes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Validate your config before building.`}),` Add a `,_jsx(_components.code,{children:`capwrap validate`}),` step before `,_jsx(_components.code,{children:`capwrap build create`}),` to catch configuration errors early and avoid burning build minutes on a job that will fail.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Check build status before deploying.`}),` Use `,_jsx(_components.code,{children:`capwrap build status \u003cbuild-id>`}),` to confirm a build completed successfully before triggering a deployment step.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use environment-specific variables`}),` for `,_jsx(_components.code,{children:`--url`}),`, `,_jsx(_components.code,{children:`--name`}),`, and `,_jsx(_components.code,{children:`--bundle-id`}),` so the same pipeline works across staging and production environments without modification.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Automate Builds","description":"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.","href":"/cli/ci-cd"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install as a dev dependency","slug":"install-as-a-dev-dependency","depth":2,"children":[]},{"title":"Store your API key as a secret","slug":"store-your-api-key-as-a-secret","depth":2,"children":[]},{"title":"GitHub Actions example","slug":"github-actions-example","depth":2,"children":[]},{"title":"GitLab CI example","slug":"gitlab-ci-example","depth":2,"children":[]},{"title":"Best practices","slug":"best-practices","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"capwrapper","siteName":"Capwrapper","title":"Automate Builds - Capwrapper","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-11T20:47:24.119Z","originalFileLocation":"cli/ci-cd.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Capwrapper\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png\">\u003cmeta data-mint-head property=\"og:title\" content=\"Automate Builds - Capwrapper\">\u003cmeta data-mint-head property=\"og:description\" content=\"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Capwrapper\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.capwrapper.com/cli/ci-cd\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://capwrapper.mintlify.app/_mintlify/api/og/v2?division=CLI\u0026amp;title=Automate+Builds\u0026amp;description=Automate+Capwrapper+builds+and+app+store+deployments+in+GitHub+Actions%2C+GitLab+CI%2C+and+other+pipelines+using+capwrap-cli+and+environment+secrets.\u0026amp;theme=c2234cd59904b024bc9c57a0\u0026amp;signature=17c6c84d60056f120709e433d186028e1d9b77fc6be324c0fac5d9e98ec58019\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Automate Builds - Capwrapper\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://capwrapper.mintlify.app/_mintlify/api/og/v2?division=CLI\u0026amp;title=Automate+Builds\u0026amp;description=Automate+Capwrapper+builds+and+app+store+deployments+in+GitHub+Actions%2C+GitLab+CI%2C+and+other+pipelines+using+capwrap-cli+and+environment+secrets.\u0026amp;theme=c2234cd59904b024bc9c57a0\u0026amp;signature=17c6c84d60056f120709e433d186028e1d9b77fc6be324c0fac5d9e98ec58019\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/capwrapper/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Capwrapper\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#41b0f0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.capwrapper.com/cli/ci-cd\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cli/ci-cd.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.capwrapper.com/#organization\",\"name\":\"Capwrapper\",\"url\":\"https://docs.capwrapper.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://res.cloudinary.com/dsap0wfn1/image/upload/v1775939647/image_only_qixu3j.png\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.capwrapper.com#website\",\"name\":\"Capwrapper\",\"url\":\"https://docs.capwrapper.com\",\"publisher\":{\"@id\":\"https://docs.capwrapper.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.capwrapper.com/cli/ci-cd#webpage\",\"url\":\"https://docs.capwrapper.com/cli/ci-cd\",\"name\":\"Automate Builds\",\"description\":\"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\",\"dateModified\":\"2026-04-11T20:47:24.119Z\",\"isPartOf\":{\"@id\":\"https://docs.capwrapper.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.capwrapper.com/cli/ci-cd#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.capwrapper.com/cli/ci-cd#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI\",\"item\":\"https://docs.capwrapper.com/cli/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automate Builds\",\"item\":\"https://docs.capwrapper.com/cli/ci-cd\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.capwrapper.com/cli/ci-cd#article\",\"headline\":\"Automate Builds\",\"name\":\"Automate Builds\",\"description\":\"Automate Capwrapper builds and app store deployments in GitHub Actions, GitLab CI, and other pipelines using capwrap-cli and environment secrets.\",\"url\":\"https://docs.capwrapper.com/cli/ci-cd\",\"mainEntityOfPage\":{\"@id\":\"https://docs.capwrapper.com/cli/ci-cd#webpage\"},\"dateModified\":\"2026-04-11T20:47:24.119Z\",\"publisher\":{\"@id\":\"https://docs.capwrapper.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.capwrapper.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Capwrapper\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Capwrapper","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Developer Tools","groups":[{"group":"CLI","pages":[{"title":"capwrap-cli","href":"/cli/overview"},{"title":"Capwrapper CLI Setup Guide","href":"/cli/installation"},{"title":"CLI Commands","description":"Complete reference for all capwrap-cli commands — authentication, build management, app store deployment, config validation, and built-in help.","href":"/cli/commands"},{"title":"Automate Builds","href":"/cli/ci-cd"}]},{"group":"REST API","pages":[{"title":"REST API","description":"Trigger Capwrapper builds and deployments programmatically. Full reference for authentication, endpoints, rate limits, and error codes.","href":"/api/overview"},{"title":"Create, List, and Check Build Status","href":"/api/builds"},{"title":"Deploys API","href":"/api/deploys"}]}]}]},"title":"Automate Builds - Capwrapper","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}