Automating Build Uploads (CI/CD)

Automating Build Uploads (CI/CD)

Automate your testing workflow by integrating Pie with your CI/CD pipeline using our GitHub Action. This eliminates manual build uploads and ensures your latest builds are automatically tested whenever you create a release, merge a pull request, or on a scheduled basis.

Overview

The Pie Build Uploader GitHub Action supports:

  • iOS builds (.app files)
  • Android builds (.apk and .aab files)
  • Automatic zipping of build directories
  • Secure API authentication
  • Flexible trigger strategies (releases, schedules, manual, etc.)

Prerequisites

Before setting up the GitHub Action, you need:

  1. A Pie account - Sign up at app.pie.inc
  2. A Pie API key - Generate one from your app’s settings in the Pie dashboard
  3. A GitHub repository with your mobile app project

Setup Instructions

1. Store Your API Key

Add your Pie API key as a GitHub secret:

  1. Go to your repository’s SettingsSecrets and variablesActions
  2. Click New repository secret
  3. Name it PIE_API_KEY
  4. Paste your Pie API key as the value

2. Add the Action to Your Workflow

Create or update a workflow file in .github/workflows/ (e.g., upload-to-pie.yml):

name: Upload Build to Pie

on:
  release:
    types: [published]

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      # Your build steps here
      
      - name: Upload to Pie
        uses: pielabsai/upload-build-action@v1.2
        with:
          pie_api_key: ${{ secrets.PIE_API_KEY }}
          build_path: path/to/your/build.app  # or .apk, .aab

Common Trigger Strategies

On Release or Tag

Upload builds automatically when you publish a release:

on:
  release:
    types: [published]

Or when you push a version tag:

on:
  push:
    tags:
      - 'v*'  # Matches v1.0, v2.1.0, etc.

Manual Trigger

Allow manual uploads from the GitHub Actions UI:

on:
  workflow_dispatch:

Scheduled Uploads

Run daily at midnight UTC:

on:
  schedule:
    - cron: '0 0 * * *'

On Pull Request Merge

Upload builds when PRs are merged to main:

on:
  pull_request:
    branches: [main]
    types: [closed]

jobs:
  upload:
    if: github.event.pull_request.merged == true
    # ... rest of job configuration

Complete Example

Here’s a complete workflow that builds and uploads an Android APK:

name: Build and Upload to Pie

on:
  push:
    tags:
      - 'v*'

jobs:
  build-and-upload:
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      
      - name: Set up JDK
        uses: actions/setup-java@v3
        with:
          java-version: '17'
          distribution: 'temurin'
      
      - name: Build APK
        run: ./gradlew assembleRelease
      
      - name: Upload to Pie
        uses: pielabsai/upload-build-action@v1.2
        with:
          pie_api_key: ${{ secrets.PIE_API_KEY }}
          build_path: app/build/outputs/apk/release/app-release.apk

Configuration Options

InputDescriptionRequired
pie_api_keyYour Pie API key (use secrets)Yes
build_pathPath to your build file or directoryYes

Next Steps

Once your workflow is set up:

  1. The action will automatically upload your builds to Pie
  2. Pie will begin testing your app based on your configured test settings
  3. View test results in your Pie dashboard

Additional Resources

Troubleshooting

Build upload fails:

  • Verify your API key is correctly stored in GitHub secrets
  • Check that the build path is correct and the file exists
  • Ensure the build file format is supported (.app, .apk, .aab, or .zip)

Need help? Contact support or open an issue on the GitHub Action repository.