# 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/.
---
# This file contains information about all the release artifacts that are
# needed within a type of release.
#
# Structure
# --------
# `bucket_paths`          -- prefix to be used per product to correctly access our buckets
# `default_locales`       -- list of locales to be used when composing upstream artifacts or the list of
#                      destinations. If given an empty locale, it uses these locales instead.
# `tasktype_map`          -- mapping between task reference and task type, particularly useful when
#                      composing the upstreamArtifacts for scriptworker.
# `platform_names`        -- various platform mappings used in reckoning artifacts or other paths
# `default`               -- a default entry, which the mappings extend and override in such a way that
#                      final path full-destinations will be a concatenation of the following:
#                      `bucket_paths`, `destinations`, `locale_prefix`, `pretty_name`
# `mapping`               -- the main section defining all artifacts to be archived
#
# Per-artifact fields (used within `mapping`):
# `from`                  -- specifies the dependency(ies) from which to expect the particular artifact
# `all_locales`           -- boolean argument to specify whether that particular artifact is to be expected
#                      for all locales or just the default one
# `description`           -- brief summary of what that artifact is
# `locale_prefix`         -- prefix to be used in the final destination paths, whether that's for default locale or not
# `source_path_modifier`  -- any parent dir that might be used in between artifact prefix and filename at source location
#                            for example `public/build` vs `public/build/ach/`.
# `destinations`          -- final list of directories where to push the artifacts
# `pretty_name`           -- the final name the artifact will have at destination
# `checksums_path`        -- the name to identify one artifact within the checksums file
# `not_for_locales`       -- filtering option to avoid associating an artifact if it matches any given locale
# `not_for_platforms`     -- filtering option to avoid associating an artifact with a specific platform
# `only_for_platforms`    -- filtering option to exclusively include the association of an artifact for a specific platform
# `partials_only`         -- filtering option to avoid associating an artifact unless this flag is present
# `update_balrog_manifest`-- flag needed downstream in beetmover jobs to reckon the balrog manifest
# `from_buildid`          -- flag needed downstream in beetmover jobs to reckon the balrog manifest

bucket_paths:
    - pub/firefox/nightly
default_locales:
    - en-US
tasktype_map:
    build: build
    signing: signing
    mar-signing: signing
    partials-signing: signing
    repackage: repackage
    repackage-deb: repackage
    repackage-deb-l10n: repackage
    repackage-rpm: repackage
    repackage-rpm-signing: signing
    repackage-signing: repackage
    repackage-signing-msi: repackage
    repackage-signing-shippable-l10n-msix: signing
    repackage-pkg-notarization: signing
    repackage-l10n-pkg-notarization: signing
    langpack-copy: signing
    attribution: build
    attribution-l10n: build
platform_names:
    filename_platform:
        by-platform:
            linux64-shippable: 'linux-x86_64'
            linux64-devedition: 'linux-x86_64'
            linux64-aarch64-shippable: 'linux-aarch64'
            linux64-aarch64-devedition: 'linux-aarch64'
            macosx64-shippable: 'mac'
            macosx64-devedition: 'mac'
            win32-shippable: 'win32'
            win32-devedition: 'win32'
            win64-shippable: 'win64'
            win64-devedition: 'win64'
            win64-aarch64-shippable: 'win64-aarch64'
            win64-aarch64-devedition: 'win64-aarch64'
    stage_platform:
        by-platform:
            linux64-shippable: 'linux64'
            linux64-devedition: 'linux64'
            linux64-aarch64-shippable: 'linux64-aarch64'
            linux64-aarch64-devedition: 'linux64-aarch64'
            macosx64-shippable: 'macosx64'
            macosx64-devedition: 'macosx64'
            win32-shippable: 'win32'
            win32-devedition: 'win32'
            win64-shippable: 'win64'
            win64-devedition: 'win64'
            win64-aarch64-shippable: 'win64-aarch64'
            win64-aarch64-devedition: 'win64-aarch64'

default: &default
    from:
        - build
    all_locales: false
    description: "TO_BE_OVERRIDDEN"
    locale_prefix: ''
    source_path_modifier:
        by-locale:
            default: '${locale}'
            en-US: ''
    destinations:
        by-locale:
            en-US:
                - ${year}/${month}/${upload_date}-${branch}
                - latest-${branch}
            default:
                - ${year}/${month}/${upload_date}-${branch}-l10n
                - latest-${branch}-l10n

mapping:
    buildhub.json:
        <<: *default
        description: "Build related information to be consumed by Buildhub service"
        pretty_name: firefox-${version}.${locale}.${filename_platform}.buildhub.json
        checksums_path: firefox-${version}.${locale}.${filename_platform}.buildhub.json
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    KEY:
        <<: *default
        from:
            - signing
        description: "Public GPG Key"
        pretty_name: KEY
        checksums_path: KEY
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
        destinations:
            - ${year}/${month}/${upload_date}-${branch}
            - latest-${branch}
    target.crashreporter-symbols.zip:
        <<: *default
        description: "Crashreporter symbols to be consumed by Socorro"
        pretty_name: firefox-${version}.${locale}.${filename_platform}.crashreporter-symbols.zip
        checksums_path: firefox-${version}.${locale}.${filename_platform}.crashreporter-symbols.zip
    target.json:
        <<: *default
        description: "Various compile and moz_app flags baked together in a json file"
        pretty_name: firefox-${version}.${locale}.${filename_platform}.json
        checksums_path: firefox-${version}.${locale}.${filename_platform}.json
    target.mozinfo.json:
        <<: *default
        description: "Various compile and moz_app flags baked together in a json file"
        pretty_name: firefox-${version}.${locale}.${filename_platform}.mozinfo.json
        checksums_path: firefox-${version}.${locale}.${filename_platform}.mozinfo.json
    target.txt:
        <<: *default
        description: "File containing buildid and revision"
        pretty_name: firefox-${version}.${locale}.${filename_platform}.txt
        checksums_path: firefox-${version}.${locale}.${filename_platform}.txt
    target_info.txt:
        <<: *default
        description: "File containing the buildID"
        pretty_name: firefox-${version}.${locale}.${filename_platform}_info.txt
        checksums_path: firefox-${version}.${locale}.${filename_platform}_info.txt
    mozharness.zip:
        <<: *default
        description: "File containing the mozharness set of scripts and configuration used by various automation tools"
        pretty_name: mozharness.zip
        checksums_path: mozharness.zip
    target.jsshell.zip:
        <<: *default
        description: "Set of shells to allow test snippets of Javascript code without needing to reload the page"
        pretty_name: jsshell-${filename_platform}.zip
        checksums_path: jsshell-${filename_platform}.zip
    target.langpack.xpi:
        <<: *default
        all_locales: true
        description: "Localized repack that grabs a packaged en-US Firefox and repackages it as locale-specific Firefox"
        from:
            - langpack-copy
            - signing
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
            - macosx64-shippable
            - win64-shippable
            - win32-shippable
            - win64-shippable
            - win64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.langpack.xpi
        checksums_path: firefox-${version}.${locale}.langpack.xpi
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n/${filename_platform}/xpi
                    - latest-${branch}-l10n/${filename_platform}/xpi
    target.langpack.deb:
        <<: *default
        all_locales: true
        description: "langpack.xpi repackaged as a .deb"
        from:
            - repackage-deb-l10n
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
            - linux64-aarch64-devedition
            - linux64-devedition
        pretty_name: firefox-${version}.${locale}.langpack.deb
        checksums_path: firefox-${version}.${locale}.langpack.deb
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n/${filename_platform}/deb-l10n
                    - latest-${branch}-l10n/${filename_platform}/deb-l10n
    mar:
        <<: *default
        description: "Alongside `mbsdiff`, a tool used to generate partials"
        source_path_modifier: 'host/bin'
        pretty_name: mar
        checksums_path: mar
        not_for_platforms:
            - win32-shippable
            - win64-shippable
            - win64-aarch64-shippable
        destinations:
            - ${year}/${month}/${upload_date}-${branch}/mar-tools/${stage_platform}
            - latest-${branch}/mar-tools/${stage_platform}
    mbsdiff:
        <<: *default
        description: "Alongside `mar`, a tool used to generate partials"
        source_path_modifier: 'host/bin'
        pretty_name: mbsdiff
        checksums_path: mbsdiff
        not_for_platforms:
            - win32-shippable
            - win64-shippable
            - win64-aarch64-shippable
        destinations:
            - ${year}/${month}/${upload_date}-${branch}/mar-tools/${stage_platform}
            - latest-${branch}/mar-tools/${stage_platform}
    target.tar.xz:
        <<: *default
        description: "Main installer for Linux platforms"
        all_locales: true
        from:
            - signing
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.tar.xz
        checksums_path: firefox-${version}.${locale}.${filename_platform}.tar.xz
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.tar.xz.asc:
        <<: *default
        description: "Detached signature for the checksums file"
        all_locales: true
        from:
            - signing
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.tar.xz.asc
        checksums_path: firefox-${version}.${locale}.${filename_platform}.tar.xz.asc
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.pkg:
        <<: *default
        description: "Main package installer for Mac OS X platforms"
        all_locales: true
        from:
            by-level:
                "3":
                    - repackage-pkg-notarization
                    - repackage-l10n-pkg-notarization
                default:
                    - repackage
                    - repackage-l10n
        only_for_platforms:
            - macosx64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.pkg
        checksums_path: firefox-${version}.${locale}.${filename_platform}.pkg
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.dmg:
        <<: *default
        description: "Main package disk image for Mac OS X platforms"
        all_locales: true
        # Attribution-l10n jobs don't have locale in the artifact path
        source_path_modifier: ""
        from:
            - attribution
            - attribution-l10n
        only_for_platforms:
            - macosx64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.dmg
        checksums_path: firefox-${version}.${locale}.${filename_platform}.dmg
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.zip:
        <<: *default
        description: "Main package installer for Windows platforms"
        all_locales: true
        from:
            - signing
        only_for_platforms:
            - win64-shippable
            - win32-shippable
            - win64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.zip
        checksums_path: firefox-${version}.${locale}.${filename_platform}.zip
    target.installer.exe:
        <<: *default
        description: "Main installer for Windows platforms"
        all_locales: true
        source_path_modifier: ''
        from:
            - attribution
            - attribution-l10n
        only_for_platforms:
            - win64-shippable
            - win32-shippable
            - win64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.installer.exe
        checksums_path: firefox-${version}.${locale}.${filename_platform}.installer.exe
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.stub-installer.exe:
        <<: *default
        description: "Stub installer for Win32 platforms"
        all_locales: true
        source_path_modifier: ''
        from:
            - attribution
            - attribution-l10n
        only_for_platforms:
            - win32-shippable
        pretty_name: Firefox Installer.${locale}.exe
        checksums_path: Firefox Installer.${locale}.exe
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.installer.msi:
        <<: *default
        description: "Windows installer for MSI platform"
        all_locales: true
        from:
            - repackage-signing-msi
        only_for_platforms:
            - win64-shippable
            - win32-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.installer.msi
        checksums_path: firefox-${version}.${locale}.${filename_platform}.installer.msi
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.installer.msix:
        <<: *default
        description: "Windows MSIX installer"
        all_locales: true
        from:
            - repackage-signing-shippable-l10n-msix
        only_for_platforms:
            - win64-shippable
            - win64-aarch64-shippable
            - win32-shippable
        pretty_name: firefox-${version}.multi.${filename_platform}.installer.msix
        checksums_path: firefox-${version}.multi.${filename_platform}.installer.msix
        destinations:
            - ${year}/${month}/${upload_date}-${branch}
            - latest-${branch}
            - latest-${branch}-l10n
    target.complete.mar:
        <<: *default
        description: "The main installer we ship our products baked within"
        all_locales: true
        from:
            - mar-signing
        pretty_name: firefox-${version}.${locale}.${filename_platform}.complete.mar
        checksums_path: firefox-${version}.${locale}.${filename_platform}.complete.mar
        update_balrog_manifest: true
        destinations:
            by-locale:
                en-US:
                    - ${year}/${month}/${upload_date}-${branch}
                    - latest-${branch}
                    - latest-${branch}-l10n
                default:
                    - ${year}/${month}/${upload_date}-${branch}-l10n
                    - latest-${branch}-l10n
    target.deb:
        <<: *default
        description: "Firefox as a .deb package"
        from:
            - repackage-deb
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
        pretty_name: firefox-${version}.${locale}.${filename_platform}.deb
        checksums_path: firefox-${version}.${locale}.${filename_platform}.deb
        update_balrog_manifest: false
        destinations:
            - ${year}/${month}/${upload_date}-${branch}
            - latest-${branch}
    target.rpm:
        <<: *default
        description: "Firefox as a .rpm package"
        only_for_platforms:
            - linux64-shippable
            - linux64-aarch64-shippable
            - linux64-devedition
            - linux64-aarch64-devedition
        pretty_name: firefox-${version}.${filename_platform}.rpm
        checksums_path: ${filename_platform}/rpm/firefox-${version}.rpm
        from:
            - repackage-rpm-signing
        destinations:
            - ${year}/${month}/${upload_date}-${branch}
            - latest-${branch}
        update_balrog_manifest: false
    langpack-${locale}.noarch.rpm:
        <<: *default
        description: "langpack.xpi repackaged as a .rpm"
        all_locales: true
        locale_prefix: ''
        source_path_modifier: ''
        from:
            - repackage-rpm-signing
        not_for_locales:
            - en-US
        only_for_platforms:
            - linux64-shippable
            - linux64-devedition
        pretty_name: firefox-l10n-${locale}-${version}.noarch.rpm
        checksums_path: ${filename_platform}/rpm/firefox-l10n-${locale}-${version}.noarch.rpm
        destinations:
            - ${year}/${month}/${upload_date}-${branch}-l10n/${filename_platform}/rpm
            - latest-${branch}-l10n/${filename_platform}/rpm
        update_balrog_manifest: false
    ${partial}:
        <<: *default
        description: "Partials MAR files to serve as updates"
        all_locales: true
        from:
            - partials-signing
        partials_only: true
        pretty_name: firefox-${branch}-${version}-${filename_platform}-${locale}-${from_buildid}-${buildid}.partial.mar
        checksums_path: firefox-${branch}-${version}-${filename_platform}-${locale}-${from_buildid}-${buildid}.partial.mar
        update_balrog_manifest: true
        from_buildid: ${from_buildid}
        destinations:
            by-locale:
                en-US:
                    - partials/${year}/${month}/${upload_date}-${branch}
                default:
                    - partials/${year}/${month}/${upload_date}-${branch}-l10n
