Connect your version control system
Use Unity Build Automation with a version control system.
Read time 5 minutesLast updated 16 hours ago
To use Build Automation with your projects, you must first host your project in a source control system (also known as a version control system). Unity Build Automation supports: The following shows you how to set up source control for Build Automation.
Connect Build Automation to Unity Version Control
Unity Build Automation supports projects stored in UVCS repositories.- From the Build settings, select the Source control tab.
- From the drop-down, select UVCS.
- In the source control provider URL field, add the URL to your UVCS cloud server or select from the list of available organizations.
- Select Authenticate with Unity ID, or Authenticate with username or password.
- If you select Authenticate with username or password, enter the Username and Password for your UVCS server.
- Select an Authentication Type from the dropdown.
- If your repository is encrypted, check the My repository is encrypted box. a. Add the Encryption key. b. Add the Encryption method.
- Select Save.
Connect Build Automation to Git
Unity Build Automation supports projects stored in Git repositories. Your repository can be hosted on GitHub, GitLab, Bitbucket, or private servers. You can configure access to your repository using the following authorization protocols:- Personal Access Tokens (default)
- SSH keys
Personal Access Tokens
To configure Build Automation to use a Personal Access Token to access your repository:- From the Build settings, select the Source control tab.
- From the drop-down, select GitHub, Bitbucket, or GitLab.
- Generate a Personal Access Token from your Git provider.
- Enter your token and select Authorize so Unity can access your provider account.
- Select your preferred repository from the drop down.
- From the Build settings page, select Save.
GitHub
Build Automation requires read access to the repository you wish to build. If you are using a Personal Access Token (classic) then the specific permissions required arerepopublic_repowrite:repo_hookContentsRead-onlyWebhooks(if auto-build is used)Read and write
GitLab
Personal Access Tokens must be granted theread_repositorywrite_repositoryBitbucket
Repository Access Tokens grant access to a single repository, so you'll have to create a token for each repository you wish to build. Tokens must be grantedReadRepositoriesRead and writeWebhooksSSH keys and private repositories
When Build Automation connects to the hosting site, it automatically detects whether your repository is public or private. If your repository is public, Build Automation automatically connects to it, and you can skip to Build Configuration. If your repository is private an SSH key is generated and displayed in the settings screen below the repository URL. Add this SSH key to the settings of your source control provider to grant Build Automation access. To configure Build Automation to use an SSH key to access your repository:- In the Source control tab, from the drop-down > Manual setup, select Git.
- In the Source control provider URL field, add the URL to your Git server. The following are examples of URLs for GitHub, Bitbucket, and GitLab:
git@github.com:youraccount/yourrepo.gitgit@bitbucket.org:youraccount/yourrepo.gitgit@gitlab.com:youracccount/yourrepo.git
- Add the SSH key to your source control provider settings if the repository is private.
- Once the setup is complete, on the Source control tab, select Save.
Connect Build Automation to Azure
Unity Build Automation supports projects stored in Azure repositories.Configuring Azure on the Dashboard
- From the Build settings page, select the Source control tab.
- From the drop-down, select Azure.
- Add your Azure Organization.
- Add the Azure Project that the code repository belongs to.
- Create and provide your Azure Personal Access Token.
- Select Authorize to allow Unity to retrieve your repositories.
- Select Save.
Connect Build Automation to SVN
Unity Build Automation supports projects hosted in Apache Subversion (SVN) repositories.- From the Build settings page, select the Source control tab.
- From the drop-down > Manual setup, then select SVN.
- In your SVN server, create a read-only user account just for Unity Build Automation, along with a secure password.
- From the Build settings page, enter the new username and password in the fields.
- Select Save.
Public SSH Keys
Build Automation does not support connecting to your SVN repository using a public SSH Key. Use a username and password instead.SSL Certificates
Self-signed SSL certificates are not supported. Build Automation does not support an SSL handshake with a server with a self-signed certificate. The hostname in the certificate must match the hostname accessed by Build Automation.Connect Build Automation to Perforce
Unity Build Automation supports Projects stored in Perforce repositories.Configuring Perforce on the Dashboard
- From the Build settings page, select the Source control tab.
- From the drop-down > Manual setup, then select Perforce.
- In the source control provider URL field, enter the URL of your Perforce server.
You can specify the URL to use the or SSL protocols. The following are examples of valid URLs:
https://https://127.0.0.1:1667ssl:127.0.0.1:167
- In P4, create a user with read-only access to your repository.
- From the Build settings page, enter the username and password in the fields.
- Select Save.