buildshare.in
CI / CD

GitHub Actions

Automatically upload Android and iOS mobile builds to BuildShare using GitHub Actions workflows.

Integrate BuildShare into your GitHub Actions workflows to automatically upload Android APKs and iOS IPAs whenever code is pushed or releases are created.


Prerequisites

  1. Add your BuildShare personal access token to your GitHub repository secrets:
    • Navigate to Settings → Secrets and variables → Actions.
    • Create a new repository secret named BUILDSHARE_TOKEN.
  2. Add your target Project ID as a secret named BUILDSHARE_PROJECT_ID:
    • Obtain your Project ID via buildshare app list or from the BuildShare web dashboard.
    • Alternatively, commit a buildshare.json or buildshare.yaml file to your repository root (generated via buildshare init).

Workflow Steps

Add these steps to your GitHub Actions workflow job after your build artifact has been generated:

- name: Install BuildShare CLI
  run: |
    curl -fsSL https://raw.githubusercontent.com/vishalkumardev/cli/main/install.sh | sh
    echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Login into buildshare
  run: |
    buildshare login --token ${{ secrets.BUILDSHARE_TOKEN }}

- name: Upload to BuildShare
  env:
    BUILDSHARE_TOKEN: ${{ secrets.BUILDSHARE_TOKEN }}
  run: |
    buildshare upload ./android/app/build/outputs/apk/release/app-release.apk \
      --app ${{ secrets.BUILDSHARE_PROJECT_ID }} \
      --notes "Sprint 42 test build"

Adding CLI to PATH

Running echo "$HOME/.local/bin" >> "$GITHUB_PATH" ensures the runner environment exposes the installed buildshare executable to all subsequent workflow steps.


Full Pipeline Examples

A complete production workflow for React Native compiling an Android Release APK with keystore signing, installing the BuildShare CLI, authenticating, and uploading to BuildShare:

name: Android Release Build

on:
  push:
    branches:
      - main
      - master
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    environment: production 

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: npm

      - name: Install Dependencies
        run: npm install

      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17

      - name: Grant Execute Permission
        run: chmod +x android/gradlew

      - name: Create local.properties
        run: |
          echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties

      - name: Setup Keystore
        run: |
          echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > android/app/my-upload-key.keystore

      - name: Build Release APK
        run: |
          cd android
          ./gradlew assembleRelease

      - name: Install BuildShare CLI
        run: |
          curl -fsSL https://raw.githubusercontent.com/vishalkumardev/cli/main/install.sh | sh
          echo "$HOME/.local/bin" >> "$GITHUB_PATH"

      - name: Login into buildshare
        run: |
          buildshare login --token ${{ secrets.BUILDSHARE_TOKEN }}

      - name: Upload to BuildShare
        env:
          BUILDSHARE_TOKEN: ${{ secrets.BUILDSHARE_TOKEN }}
        run: |
          buildshare upload ./android/app/build/outputs/apk/release/app-release.apk \
            --app ${{ secrets.BUILDSHARE_PROJECT_ID }} \
            --notes "Sprint 42 test build"

Adding Build Details to GitHub Job Summary

Using --json and GitHub Actions job summaries ($GITHUB_STEP_SUMMARY), you can render build confirmation directly on your Actions run summary page:

- name: Upload and Report
  env:
    BUILDSHARE_TOKEN: ${{ secrets.BUILDSHARE_TOKEN }}
  run: |
    RESPONSE=$(buildshare upload ./android/app/build/outputs/apk/release/app-release.apk --app ${{ secrets.BUILDSHARE_PROJECT_ID }} --ci --json)
    BUILD_ID=$(echo "$RESPONSE" | jq -r '.build.id')

    echo "### 🚀 Build Uploaded to BuildShare!" >> $GITHUB_STEP_SUMMARY
    echo "Build ID: \`$BUILD_ID\` has been uploaded and install invitations sent to testers via email." >> $GITHUB_STEP_SUMMARY

On this page