GitLab App Distribution on Every Pipeline Run
Add a job to your .gitlab-ci.yml, and any pipeline that reaches it pushes a build to AppShare, no separate step for anyone to remember.
What You Get
Three Reasons Teams Automate This Job
One File, Every Merge
Add a single job to the
.gitlab-ci.ymlyou already have, and it applies to every pipeline run from then on.Runs on the Runner You Already Use
Whether you’re on GitLab.com’s shared runners or a self-managed instance, the release job runs on the same runner as the rest of your pipeline, including macOS runners for GitLab iOS deployment.
Control Exactly When It Fires
GitLab's
ruleskeyword lets you decide precisely which branch, tag, or event triggers the release, not just "every push."
SETUP
Set Up GitLab CI App Deployment in Four Steps
Follow these four steps to automate your mobile distribution on every merge or pipeline run.
Open your .gitlab-ci.yml
Find the file at your repo root or create one if this is your first pipeline.
Add a masked CI/CD variable
In Settings → CI/CD → Variables, add APPSHARE_API_KEY as a masked variable.
Add the upload job
Add the upload_to_appshare job to execute when your pipeline passes.
Commit & Push
Push your changes to trigger your first automated build and distribution.
Open your .gitlab-ci.yml
Open your repository's .gitlab-ci.yml at the project root. Ensure your pipeline defines the build and release stages.
.gitlab-ci.yml
stages:
- build
- release
# Your existing build job produces the APK/IPA artifact
build_app:
stage: build
script:
- ./gradlew assembleRelease
artifacts:
paths:
- app/build/outputs/apk/release/*.apkAdd a masked CI/CD variable
In your GitLab project, navigate to Settings → CI/CD → Variables. Click Add variable and create an entry for APPSHARE_API_KEY using the key from AppShare's Integrations tab.
GitLab Variables Configuration
# In GitLab: Settings -> CI/CD -> Variables -> Add Variable
Key: APPSHARE_API_KEY
Value:
Flags:
- [x] Mask variable (prevents secret from appearing in console logs)Add the upload job
Add a new release job to your .gitlab-ci.yml. This installs the CLI and automatically distributes the build.
upload_to_appshare:
stage: release
image: node:18-alpine
dependencies:
- build_app
script:
- npm install -g zunoy-appshare-cli
- export APPSHARE_API_KEY=$APPSHARE_API_KEY
- appshare ./app/build/outputs/apk/release/app-release.apk --app-id my-app-slug
rules:
- if: $CI_COMMIT_BRANCH == "main"Commit & Push
Commit your modified .gitlab-ci.yml and push to GitLab. The pipeline will build and distribute your app automatically.
Terminal
git add .gitlab-ci.yml
git commit -m "ci: integrate AppShare automated distribution"
git push origin mainPassed, your testers receive instant notification emails and install links.LIFECYCLE
What Actually Happens on a Push
UNDER THE HOOD
GitLab Just Runs the CLI
That script step is just AppShare CLI, running inside your pipeline instead of your terminal.

Other Platforms
AppShare Works With Your Pipeline Too
FAQ
Questions About the GitLab CI/CD Integration
What is GitLab app distribution?
GitLab app distribution means using your GitLab CI/CD pipeline to send every new Android or iOS build to testers automatically. With AppShare, a job in your .gitlab-ci.yml installs the AppShare CLI and uploads the .apk or .ipa after the build stage passes. Testers get an install link and QR code without anyone uploading the build by hand.
How does GitLab iOS deployment work for IPA builds?
The AppShare job is the same; only the build differs. GitLab IPA deployment needs a macOS runner, GitLab-hosted or self-managed, to build and sign the .ipa, which is then passed to the upload job as an artifact. Ad hoc builds only install on devices whose UDIDs are in the provisioning profile, so register tester devices in AppShare first.
Do I need a specific GitLab Runner for this?
No. The upload job runs as a standard script job, so it works on GitLab.com shared runners or your own self-managed runners, as long as the runner can run shell commands and Node-based tools. Only the build job has platform needs: Android builds run on Linux runners, while iOS builds need a macOS runner.
How do I set up GitLab CI app deployment?
Open your .gitlab-ci.yml and add an upload_to_appshare job in a stage after your build, with the build job exporting the .apk or .ipa as an artifact. Store your API key in Settings, CI/CD, Variables as a masked variable named APPSHARE_API_KEY, then reference it in the script instead of writing the key into the file.
What triggers the release job?
Whatever you define under rules in the job. A push to a specific branch is the most common, but merge request pipelines, tags, and scheduled runs work too. To release from merge requests instead of branch pushes, match on merge request events rather than $CI_COMMIT_BRANCH, and every other pipeline skips the upload job.
Can I add release notes automatically?
Not from the pipeline yet. The AppShare CLI uploads the build (appshare <file> --app-id <slug>) and has no release notes flag. Once the upload finishes, add or edit the notes on the release's Release Notes tab in AppShare, and testers see them on the install page.
Get Started
Add It to Your Next Pipeline
Add the job, mask the variable, and every pipeline after this one handles the release on its own.
Works on shared or self-managed runners
Controlled by rules, not guesswork
Masked variables, not plaintext keys