# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

loader: taskgraph.loader.push_apk:loader

transforms:
   - taskgraph.transforms.push_apk:transforms
   - taskgraph.transforms.task:transforms

kind-dependencies:
   - build-signing
   - google-play-strings
   - push-apk-breakpoint

jobs:
   push-apk/opt:
      description: Publishes APK onto Google Play Store
      attributes:
         build_platform: android-nightly
         nightly: true
      shipping-phase: ship
      shipping-product: fennec
      worker-type:
         by-project:
            mozilla-central: scriptworker-prov-v1/pushapk-v1
            mozilla-beta: scriptworker-prov-v1/pushapk-v1
            mozilla-release: scriptworker-prov-v1/pushapk-v1
            default: scriptworker-prov-v1/dep-pushapk
      worker:
         upstream-artifacts:  # see transforms
         google-play-track:
            # See https://github.com/mozilla-releng/pushapkscript#aurora-beta-release-vs-alpha-beta-production
            by-project:
               mozilla-central: 'beta'
               mozilla-beta: 'production'
               mozilla-release: 'rollout'
               default: 'invalid'
         rc-google-play-track:
            by-project:
               mozilla-release: 'rollout'
               birch: 'rollout'
               default: 'invalid'
         implementation: push-apk
         commit:
            by-project:
               mozilla-central: true
               mozilla-beta: true
               mozilla-release: true
               default: false
         rollout-percentage:
            by-project:
               # XXX Please make sure to change PUSH_APK_GOOGLE_PLAY_TRACT to
               # 'rollout' if you add a new supported project
               mozilla-release: 10
               default: null
         rc-rollout-percentage:
            by-project:
               mozilla-release: 5
               birch: 5
               default: null
      requires: all-resolved
      scopes:  # see transforms
      treeherder:
         symbol: pub(gp)
         platform: Android/opt
         tier: 2
         kind: other
      run-on-projects: ['mozilla-central', 'mozilla-beta', 'mozilla-release', 'maple']
      deadline-after: 5 days
