# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("step") %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
git_url: https://gitlab.torproject.org/tpo/translation.git
version: '[% c("abbrev") %]'

# Linux builds still use gz as compress_tar, while other platforms use
# zst. To avoid duplicating translations tarballs which can be shared
# between platforms, we set compress_tar, except for the fenix
# translations (which are not used for Linux builds).
compress_tar: 'gz'

steps:
  base-browser:
    base-browser: '[% INCLUDE build %]'
    git_hash: 86442427facf038d5706644221de7e2fb733550b
    targets:
      nightly:
        git_hash: 'base-browser'
  tor-browser:
    tor-browser: '[% INCLUDE build %]'
    git_hash: 2c0b448503d52c3b512d1e7a55ccc78ac19db146
    targets:
      nightly:
        git_hash: 'tor-browser'
  mullvad-browser:
    mullvad-browser: '[% INCLUDE build %]'
    git_hash: 34b45a7417145b1f26784825ef6c873497cbda0a
    targets:
      nightly:
        git_hash: 'mullvad-browser'
  fenix:
    fenix: '[% INCLUDE build %]'
    # We need to bump the commit before releasing but just pointing to a branch
    # might cause too much rebuidling of the Firefox part.
    git_hash: f5b1916560f4162f281201a19deee7ed3eb0882e
    compress_tar: 'zst'
    targets:
      nightly:
        git_hash: 'fenix-torbrowserstringsxml'
  list_updates:
    list_updates: |
      [%
        FOREACH component = [ 'base-browser', 'tor-browser', 'mullvad-browser', 'fenix' ];
          branch = pc(project, 'git_hash', { step => component, target => [ 'nightly' ] });
          commit_hash = exec('git rev-parse ' _ branch, { git_hash => branch });
          IF commit_hash == pc(project, "git_hash", { step => component });
            GET '* ' _ component _ " is up to date\n";
          ELSE;
            GET '* ' _ component _ ' can be updated: ' _ commit_hash _ "\n";
          END;
        END;
        -%]
    fetch: 1
