name: Google Play Release

on:
  workflow_dispatch:
    inputs:
      track:
        description: "Google Play Store release track"
        required: false
        type: choice
        default: "beta"
        options:
          - internal
          - alpha
          - beta
          - production
      rollout:
        description: "Rollout fraction (0.0-1.0)"
        required: false
        type: string
        default: "0.05"
      validate_only:
        description: "Fastlane dry-run?"
        required: false
        type: boolean
        default: false

permissions:
  contents: read

jobs:
  call-release-workflow:
    uses: FossifyOrg/.github/.github/workflows/release.yml@main
    with:
      flavor: "gplay"
      package_name: "org.fossify.filemanager"
      track: ${{ github.event.inputs.track }}
      rollout: ${{ github.event.inputs.rollout }}
      validate_only: ${{ github.event.inputs.validate_only == 'true' }}

    secrets:
      ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
      SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
      SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
      SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
      SERVICE_ACCOUNT_JSON_KEY_BASE64: ${{ secrets.SERVICE_ACCOUNT_JSON_KEY_BASE64 }}
      FOSSIFYBOT_TOKEN: ""
