# 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_generated_sources
    - gecko_taskgraph.transforms.job
    - gecko_taskgraph.transforms.task

kind-dependencies:
    - build

only-for-attributes:
    - nightly
    - shippable
    - upload-generated-sources

not-for-build-platforms:
    - macosx64-shippable/opt
    - macosx64-devedition/opt

task-defaults:
    run-on-repo-type: [hg]

tasks:
    upload-generated-sources:
        description: Upload generated source files from build
        from-deps:
            group-by: single-with-filters
        worker-type: b-linux-medium
        treeherder:
            symbol: Ugs
            kind: build
        worker:
            docker-image: {in-tree: "lint"}
            max-run-time: 600
        run:
            using: mach
            mach: {artifact-reference: "python --virtualenv upload-generated-sources build/upload_generated_sources.py <build/public/build/target.generated-files.tar.gz>"}
            sparse-profile: upload-generated-sources
        scopes:
            - secrets:get:project/releng/gecko/build/level-{level}/gecko-generated-sources-upload
