# 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: 93eddbd3888852c09e130d536fb3c9bd7e4e6f57
    targets:
      nightly:
        git_hash: 'base-browser'
  tor-browser:
    tor-browser: '[% INCLUDE build %]'
    git_hash: dd30508387040bf0a1217a1eb9edb80ac21926f2
    targets:
      nightly:
        git_hash: 'tor-browser'
  mullvad-browser:
    mullvad-browser: '[% INCLUDE build %]'
    git_hash: 6a1ef41c664a5185e25ca2c4bbf5d7447bd888a7
    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: 9b5c720e96df3a54f65e5a4e86b162845971f725
    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
