This topic covers:
To configure Cloud Build to build your Project from a GitHub repository:
You can configure access to your repository using the following authorization protocols:
To configure Cloud Build to use OAuth to access your repository:
Note: Cloud Build uses your current credentials to retrieve the repository list if you are currently signed into the source code management service. To configure a Project that retrieves a repository from a different account, sign out of the source code management service first, then configure the Project.
For the next step, see Setting up a target build platform.
To configure Cloud Build to use SSH to access your repository:
In the Source Control window, click the Manual tab.
In the SCM URL field, enter the URL of your Git server in either of the following formats:
To connect to your repository, you must specify the URL to your Git server. For information on the format of the URL, see URL syntax. Note: If you are hosting Git on a private server, you must use SSH to connect to your repository.
From the SCM Type drop-down menu, select GIT.
Click the NEXT: ACCESS button.
When Cloud Build connects to the hosting site, it automatically detects whether your repository is public or private. If your repository is public, Cloud Build automatically connects to it, and you can skip to Setting up a target build platform. If your repository is private, see the Using private repositories section.
To connect to your repository, you must specify the URL to your Git server. You can specify the URL to use the https:// protocol.
Note: Git has depricated the git:// URL. If you are connecting via SSH, there are new security steps. See Improving Git protocol security on GitHub for more information.
Note: If you are hosting Git on a private server, you must use SSH to connect to your repository.
Unity Cloud Build automatically re-writes the URL into the format it needs.
If your repository is private, Cloud Build must use SSH to connect to it. When Cloud Build detects that the repository is private, it displays the Grant us access to your source control screen.
To add your SSH key to your project in GitHub:
Sign in to GitHub.
In the upper-right corner of any GitHub page, click your profile photo, then click Your profile.
On your profile page, click Repositories, then click the name of your repository.
In your repository, click the Settings tab.
In the sidebar, click Deploy Keys, then click the Add deploy key button.
In the Title textbox, type name to identify this key.
In the Key field, paste in your public key from the Grant us access to your source control window, and then click the Add key button.
For more information on deploy keys, see Managing Deploy Keys in the GitHub documentation.
You can also add your SSH key to your GitHub account so that all repositories in your account are accessible to Cloud Build. For more information, see Adding a new SSH key to your GitHub account in the GitHub documentation.
To add your SSH key to your Bitbucket account:
Log in to Bitbucket.
Click Bitbucket settings.
On the Settings page, in the SECURITY section, click SSH Keys.
In SSH Keys, click the Add key button.
In the Label field, enter a recognizable name for the key (such as Unity Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary.)
Paste the Unity Cloud Build SSH key from the Grant us access to your source control window into the Key field.
Click Add Key.
On the Grant us access to your source control window, click Next: Target Setup.
In the dashboard, on the NEW BUILD TARGET: BASIC INFO window:
In the Target Label field, enter a name for the build.
If the root folder of your repository doesn’t contain your Assets and Project settingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary, in the Project Subfolder field, enter the URL of the folder that contains your Assets and Project settings.
From the Unity Version drop-down menu, select the version of Unity with which to build the Project.
If you do not want the Project to automatically build whenever your repository is updated, click the Auto-build toggle to disable this feature.
If you are building for the iOSApple’s mobile operating system. More info
See in Glossary or Android platforms, your next step is to enter credentials for the build. Click Next: Credentials. For all other platforms, click Next: Build to complete the configuration and start the initial build.
In the SIGNING CREDS window, provide the following information:
A Bundle ID to uniquely identify your app on the device and in Google Play Store.
Enter your Android keystoreAn Android system that lets you store cryptographic key entries for enhanced device security. More info
See in Glossary credentials or select Auto Generated Debug Keystore to use a development keystore. For more information on Android keystores, see Android Keystore System.
In the iOS SIGNING CREDS window provide the following information:
A Bundle ID to uniquely identify your app on the device.
The Xcode version with which to build the app.
Enter your IOS credentials. For more information on iOS credentials, see Building for iOS.
If your project uses private Git submodules, make sure that the URLs present in your .gitmodules file uses the
git@ syntax instead of
email@example.com:youraccount/yourrepo.git (for GitHub)
firstname.lastname@example.org:youraccount/yourrepo.git (for Bitbucket)
email@example.com:youracccount/yourrepo.git (for GitLab)