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

transforms:
    - taskgraph.transforms.upload_symbols:transforms
    - taskgraph.transforms.job:transforms
    - taskgraph.transforms.task:transforms

kind-dependencies:
    - build

only-for-build-platforms:
    - linux64/opt
    - linux64/debug
    - linux64-nightly/opt
    - linux-nightly/opt
    - linux64-devedition-nightly/opt
    - linux-devedition-nightly/opt
    - android-aarch64-nightly/opt
    - android-api-16/opt
    - android-api-16-nightly/opt
    - android-api-16-old-id-nightly/opt
    - android-x86-nightly/opt
    - android-x86-old-id-nightly/opt
    - macosx64-nightly/opt
    - macosx64-devedition-nightly/opt
    - win32-nightly/opt
    - win64-nightly/opt
    - win32-devedition-nightly/opt
    - win64-devedition-nightly/opt

job-template:
    description: Upload Symbols
    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
    worker:
        docker-image: {in-tree: "lint"}
        max-run-time: 900
        env:
            ARTIFACT_TASKID: {"task-reference": "<build>"}
            # {level} gets replaced in the upload_symbols transform
            SYMBOL_SECRET: "project/releng/gecko/build/level-{level}/gecko-symbol-upload"
    run:
        using: run-task
        command: >
            cd /builds/worker/checkouts/gecko &&
            ./mach python toolkit/crashreporter/tools/upload_symbols.py https://queue.taskcluster.net/v1/task/${ARTIFACT_TASKID}/artifacts/public/build/target.crashreporter-symbols-full.zip
        sparse-profile: upload-symbols
    optimization:
        only-if-dependencies-run: null
    scopes:
        - secrets:get:project/releng/gecko/build/level-{level}/gecko-symbol-upload
