game-ci / docker

Series of CI-specialised docker images for Unity.
https://hub.docker.com/u/unityci
MIT License
397 stars 123 forks source link

Support alpha and beta versions of Unity #50

Open mob-sakai opened 3 years ago

mob-sakai commented 3 years ago

Your Docker image and GitHub Actions are great for testing the Unity project in CI. 👍

BTW, Unity package developers (including me) are concerned about whether their packages will work properly with newer versions of Unity. Do you plan to support alpha and beta versions of Unity?

webbertakken commented 3 years ago

Hi @mob-sakai and thanks a lot for bringing the first real use-case for alpha/beta versions to our attention!

Currently it's not formally planned, but we're willing to explore setting it up for these versions.

That said, in the past we have seen very odd failures for alpha versions and experienced quite a few problems with them. The steps for generating the images may also differ from the stable images, and we'll probably need a way to republish specific images. Currently we haven't yet built an interface, nor the logic to do this in the versioning-backend.

I'm afraid we'll have to mostly rely on support from contributors to make this a reality. It might not be very hard, but it will most likely require some sustained effort for a short while.

GabLeRoux commented 3 years ago

Here's a related issues we used to have while installing alpha versions (for reference) in previous dockerfile implementations (in gableroux/unity3d images):

Note that things may have changed now that we're installing Unity using hub instead 👍 Contributions are definitely welcome.

mob-sakai commented 3 years ago

@webbertakken @GabLeRoux Thank you for your quick reply.

I've successfully installed Unity 2020.2.0b11(base) and webgl module, and createManualActivationFile in my environment.

Currently we haven't yet built an interface, nor the logic to do this in the versioning-backend.

We can get Alpha/beta versions and changesets from releases-linux.json. For example, We can get a new alpha/beta version with a script like this:

import { EditorVersionInfo } from '../../model/editorVersionInfo';
import fetch from 'node-fetch';

const UNITY_RELEASES_URL = 'https://public-cdn.cloud.unity3d.com/hub/prod/releases-linux.json';

export const scrapeBetaVersions = async (): Promise<EditorVersionInfo[]> => {
  interface releases {
    beta: {version: string, downloadUrl: string}[];
  }
  const response = await fetch(UNITY_RELEASES_URL);
  const releases: releases = await response.json()

  const betaVersionInfoList = releases.beta.map((release)=>{
    const version = release.version;
    const changeSet = release.downloadUrl.match(/https?:\/\/(beta|download)\.unity3d\.com\/(download|download_unity)\/([^\/]+)\/.*/)?.[3] || "";
    const [major, minor, patch] = version.split('.');

    return {
      version,
      changeSet,
      major: Number(major),
      minor: Number(minor),
      patch,
    };
  })

  return betaVersionInfoList;
};

I don't think I understood everything about versioning-backend. However, I'd like to contribute to this project in some form.

webbertakken commented 3 years ago

I've successfully installed Unity 2020.2.0b11

Great, glad that worked.

We can get Alpha/beta versions and changesets from releases-linux.json.

Unfortunately we can't. As these are rolling versions.

webbertakken commented 3 years ago

Also feel free to discuss any ideas on discord.

mob-sakai commented 3 years ago

Well... that means you need all released alpha/beta versions, right? Scraped versions seem to be pushed to db. Is it unsatisfactory?

webbertakken commented 3 years ago

Well... that means you need all released alpha/beta versions, right?

Correct.

Scraped versions seem to be pushed to db.

Also correct.

Is it unsatisfactory?

Correct again, we do not want to become the source of truth for Unity versions. Unity is a big and grown-up company that should be able to handle maintaining a source of truth. Once they provide the versions publicly, like they do with stable versions, we should be able to reliably consume them.

That said, they seem to have an archive section per major version. Perhaps this would be usable for what we're trying to do if we can programatically determine which major versions have betas.

mob-sakai commented 3 years ago

OK, I understood.

mob-sakai commented 3 years ago

PR: Unity-CI/versioning-backend#29

Version updates of Unity have resulted in the occasional missing libraries.

The failure log of alpha/beta will help you to find them.

singlerider commented 2 years ago

I'd like to mention that this would be a great feature for me. I'm unofficially representing the company I work for with this message, and our product is only currently supported in the BETA releases (such as 2022.2.0b8). I'll join the Discord to see if I can figure out a way to unblock some CI builds.

AndrewKahr commented 2 years ago

I too would heavily benefit from automatic beta builds as I am also working a project that relies on features of 2022.2.

Unfortunately I predict the answer as of now is gonna be to build a custom image with the beta version and push it to your own registry as I recall there being concerns about blocking the build pipeline if something fails.

Webber is also busy with building the CLI so I presume he wouldn’t have the time to work out the backend changes/bugs needed to track the beta versions through the system. Looking through the thread though, it looks like a draft PR already exists with tracking for beta versions so that's a plus there.

My thinking to ease concerns of builds not working is to exclude alpha versions from the system. I'd expect beta versions to be decently stable given how many alphas precede the first beta.

singlerider commented 2 years ago

I predict the answer as of now is gonna be to build a custom image with the beta version and push it to your own registry

If this is possible, I would be satisfied. I can host an image, but I would need some instructions on how to do the building. I'm trying to work through that now.