# 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:
    - gecko_taskgraph.transforms.release:run_on_releases
    - gecko_taskgraph.transforms.release_deps:transforms
    - gecko_taskgraph.transforms.release_flatpak_repackage:transforms
    - gecko_taskgraph.transforms.task:transforms

kind-dependencies:
    - post-beetmover-dummy
    - post-langpack-dummy

task-defaults:
    description: Generates flatpak by reackaging the existing tar.bz2
    run-on-projects: []  # to make sure this never runs as part of CI
    run-on-releases: [beta, release, release-rc]
    shipping-phase: promote
    scopes: []
    treeherder:
        platform: linux64-shippable/opt
        kind: build
        tier: 2
    worker-type: b-linux-gcp
    worker:
        implementation: docker-worker
        os: linux
        max-run-time: 7200
        docker-image: {in-tree: firefox-flatpak}
        artifacts:
            - name: public/build
              type: directory
              path: /home/worker/artifacts/
        command:
            - /bin/bash
            - -cx
            - ./runme.sh
        env:
            VERSION: "{release_config[version]}"
            BUILD_NUMBER: "{release_config[build_number]}"
            CANDIDATES_DIR:
                by-release-level:
                    staging:
                        https://ftp.stage.mozaws.net/pub/{task[shipping-product]}/candidates
                    production:
                        https://archive.mozilla.org/pub/{task[shipping-product]}/candidates
            LC_ALL: C.UTF-8
            LANG: C.UTF-8
            L10N_CHANGESETS: "{config_params[head_repository]}/raw-file/{config_params[head_rev]}/browser/locales/l10n-changesets.json"
            FLATPAK_BRANCH:
                by-project:
                    mozilla-release: stable
                    default: beta
        chain-of-trust: true

tasks:
    firefox:
        shipping-product: firefox
        attributes:
            build_platform: linux64-shippable
            build_type: opt
        treeherder:
            symbol: Flatpak(r)
