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

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

kind-dependencies:
    - build
    - toolchain

not-for-build-platforms:
    # Address Sanitizer builds don't have symbols to upload.
    - linux64-asan-reporter-shippable/opt
    - win64-asan-reporter-shippable/opt
    - linux-geckodriver/opt
    - linux64-geckodriver/opt
    - linux64-aarch64-geckodriver/opt
    - macosx64-geckodriver/opt
    - macosx64-aarch64-geckodriver/opt
    - win32-geckodriver/opt
    - win64-geckodriver/opt
    - win64-aarch64-geckodriver/opt

tasks:
    upload-symbols:
        description: Upload Symbols
        from-deps:
            group-by: platform
        worker-type: b-linux-gcp
        use-python: default
        worker:
            docker-image: {in-tree: "debian12-base"}
            max-run-time: 1800
            env:
                # {level} gets replaced in the upload_symbols transform
                SYMBOL_SECRET: "project/releng/gecko/build/level-{level}/gecko-symbol-upload"
                MAKECAB: /builds/worker/fetches/makecab/makecab
                MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE: system
        run:
            using: mach
            mach: {artifact-reference: "python toolkit/crashreporter/tools/upload_symbols.py <build/public/cidata/target.crashreporter-symbols-full.tar.zst>"}
            sparse-profile: upload-symbols
        scopes:
            - secrets:get:project/releng/gecko/build/level-{level}/gecko-symbol-upload
        fetches:
            toolchain:
                - linux64-makecab
