Importing a custom package from DevOps in Unity UPM

73 views Asked by At

I'm working on a project that is hosted on the company's DevOps; since most project share the same basic functionalities, I've created a git submodule that gets imported into every project. However, I'm looking to migrate this to Unity's package manager, so that it is easier to manage.

I've created a project as explained in this video, but whenever I try to import the package by adding the git url I get this error:

Error in importing through HTTPS

How can I import a custom pkg from AzDO?

I tried importing through DevOps Clone command:

Devops HTTPS

I also tried setting up a SSH mode, but Unity displays an error message saying that it expects a password, but I don't know which password SSH expects (it's not the one I setup while generating SSH keys, nor is it the one associated to the DevOps account, so I'm at a loss).

1

There are 1 answers

0
Dhelio On BEST ANSWER

In the end I managed to do it...but via SSH. I'm going to write the whole procedure for all the people that are as ignorant as me in this matter;

Making the package is the easy part, and explained fully in the video in the first post I made;

Next step is generating SSH keys.

Open up shell or Powershell and run: Code (CSharp):

ssh-keygen

It will prompt you for a location where to save private and public keys; default name is id_rsa. Don't change it, just press Enter. IMPORTANT keygen process will prompt you for a password. DO NOT insert the password, otherwise Unity won't be able to logon later. When all is done you will have generated two files:

id_rsa
id_rsa.pub

At the following path: Code (CSharp):

C:\Users\<your-user-name>\.ssh

Next, open up DevOps and go to the "Clone" tab in your Repo. Select "SSH" and then "Manage SSH Keys" upload_2023-11-20_16-38-15.png Click on "New Key" and in the Public Key Data field copy the contents of the id_rsa.pub you've generated earlier. Save, and now go to Unity. Take the SSH clone link you've copied earlier, and just add it to UPM as url: upload_2023-11-20_16-42-20.png There you go. You're done. Took me forever to figure out this simple thing.