# 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: fenix_taskgraph.loader.multi_dep:loader

transforms:
    - fenix_taskgraph.transforms.multi_dep:transforms
    - fenix_taskgraph.transforms.signing:transforms
    - fenix_taskgraph.transforms.notify:transforms
    - taskgraph.transforms.task:transforms

kind-dependencies:
    - build

primary-dependency: build

group-by: build-type

job-template:
    description: Sign Fenix
    worker: {}
    signing-format:
        by-build-type:
            beta-mozillaonline: autograph_apk_mozillaonline
            release-mozillaonline: autograph_apk_mozillaonline
            default: autograph_apk
    index:
        by-tasks-for:
            (action|cron):
                by-build-type:
                    (nightly|debug|nightly-simulation|beta|beta-mozillaonline|release|release-mozillaonline):
                        type: signing
                    default: {}
            default: {}
    run-on-tasks-for:
        by-build-type:
            # No test job runs on push against this build type. Although we do want nightly-simulation
            # signed to use it in the gecko trees.
            # We want beta on push so that we detect problem before shipping it
            (nightly-simulation|beta-firebase|android-test-beta|android-test-mozillaonline|nightly-firebase|android-test-nightly): [github-push]
            default: []
    treeherder:
        job-symbol:
            by-build-type:
                android-test.+: Bats
                android-test-mozillaonline: Bats-mo
                beta-firebase: Bfs
                nightly-firebase: Bfs
                beta-mozillaonline: Bmos
                release-mozillaonline: Bmos
                default: Bs
        kind: build
        platform: android-all/opt
        tier: 1
    notify:
        by-build-type:
            .*(beta|release)-mozillaonline:
                by-level:
                    '3':
                        email:
                            content: The Mozilla Online Fenix {version} APKs are now available
                            link:
                                text: Taskcluster Task
                                href: 'https://firefox-ci-tc.services.mozilla.com/tasks/${status.taskId}'
                            on-reasons: [completed]
                            subject: Mozilla Online Fenix {version} APKs are now available
                            to-addresses: [mozillaonline-fenix@mozilla.com]
                    default: {}
            default: {}
