Search Unity

Get build version from cloud build

Discussion in 'Unity Build Automation' started by Naphier, Dec 4, 2018.

  1. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    Hi all,
    I'm trying to automate our distribution process. Part of our distribution is naming the build to include the version (i.e. 1.2.4) in the file name (zip/apk). From what I can tell this is not included in the webhook json. Recommendations on getting this info? I am not looking for the build job number from cloud build as that's not really that helpful.
     
  2. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    So... this is a bit of a pain, but this is how we're handling it until Unity packs in the player settings in the build's meta data. Anyway, in the pre-build script we're reading the player settings then saving that to StreamingAssets. Then when the build gets to our server we extract the file and read the build version. Works well with Android and Windows, but I have doubts that it's viable for iOS. We had to do something like this anyway because we have launchers, updaters, and documentation that we wan't to pack in the zip, so we'll just pack those in the StreamingAssets folder and move them to the root of the archive.
     
  3. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    We're having the same problem. We need a way to read a build's version number, meaning PlayerSettings.bundleVersion. We set bundleVersion from script and need to access its value in our deployment scripts. I see two options:
    1. Include a simple txt / meta file in the output.
    2. Expose that information via Cloud Build's API. There's already lastBuiltRevision, changeset, unityVersion etc. so it'd be helpful if bundleVersion was also there.

    Or ideally both of the above.
     
  4. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    we just made our own build server
     
  5. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    @Naphier That's what we're debating internally. Out of curiosity, what stack did you end up with? We're thinking either old school Jenkins/TeamCity + EC2 or GitHub Actions + EC2 or own hardware on premise.
     
  6. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    We ended up using our own Windows 10 + IIS rig and Jenkins (fired off commit to dev or manually via API). Main reason was we needed HoloLens builds (in addition to Android and Windows). There was little choice and gives us full control. Good luck!
     
    oobartez likes this.
  7. EnduvoJD

    EnduvoJD

    Joined:
    Aug 12, 2016
    Posts:
    53
    Unity, any reason this hasn't been added?