Description: Downloads the latest version of Unity Hub.
Identifier: com.github.hansen-m.download.UnityHub
MinimumVersion: 2.7.6

Input:
  NAME: UnityHub
  BUILD: arm64 # Options: arm64, x64

Process:
  - Processor: URLDownloader
    Arguments:
      url: "https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup-%BUILD%.dmg"
      filename: "%NAME%.dmg"

  - Processor: EndOfCheckPhase

  - Processor: CodeSignatureVerifier
    Arguments:
      input_path: "%RECIPE_CACHE_DIR%/downloads/%NAME%.dmg/Unity Hub.app"
      requirement: identifier "com.unity3d.unityhub" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "9QW8UQUTAA"

  - Processor: Versioner
    Arguments:
      input_plist_path: "%RECIPE_CACHE_DIR%/downloads/%NAME%.dmg/Unity Hub.app/Contents/Info.plist"
