CI/CD Integration
Automate mobile app build uploads in GitHub Actions, GitLab CI, and Bitbucket Pipelines.
Because the BuildShare CLI is a single compiled binary with zero dependencies, integrating it into continuous integration and delivery pipelines requires only two steps: downloading the binary with the one-liner installer and calling buildshare upload --ci.
Authentication in CI
To authenticate without interactive prompts:
- Generate a Personal Access Token from your BuildShare account settings.
- Add the token as an encrypted secret in your CI repository settings named
BUILDSHARE_TOKEN. - Provide the environment variable to your pipeline step. The CLI automatically reads
BUILDSHARE_TOKEN.
Pipeline Recipes
Create .github/workflows/buildshare.yml in your repository:
name: Upload Build to BuildShare
on:
push:
branches: [ main ]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install BuildShare CLI
run: curl -fsSL https://vishalkumardev.github.io/cli/install.sh | sh
- name: Build APK
run: ./gradlew assembleRelease
- name: Upload to BuildShare
env:
BUILDSHARE_TOKEN: ${{ secrets.BUILDSHARE_TOKEN }}
run: buildshare upload ./app/build/outputs/apk/release/app-release.apk --ci --jsonParsing CI Outputs
When --json is supplied, you can parse the returned payload to extract the public OTA installation URL and post it directly to Slack, Discord, or GitHub PR comments:
# Example: Extract the public install URL using jq
INSTALL_URL=$(buildshare upload ./app.apk --ci --json | jq -r '.build.install_url')
echo "Build available at: $INSTALL_URL"