Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPM config on Windows runners #618

Open
lukas-prodviz opened this issue Jan 3, 2024 · 5 comments
Open

UPM config on Windows runners #618

lukas-prodviz opened this issue Jan 3, 2024 · 5 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@lukas-prodviz
Copy link

lukas-prodviz commented Jan 3, 2024

Hello,

According to the documentation, UPM authentication on Ubuntu is configured by creating the upmconfig file under /home/runner/work/_temp/_github_home.

In which directory should this file be placed on Windows runners?

I already tried to use $HOME and change the Ubuntu example from the documentation as follows:

  - name: Create .upmconfig.toml UPM authentication file
    env:
      npm_token: ${{ secrets.NPM_TOKEN }}
    run: |
      cd $HOME
      echo "[npmAuth.`"https://upm.example.com`"]" > .upmconfig.toml
      echo "_auth = `"$Env:npm_token`"" >> .upmconfig.toml
      echo "alwaysAuth = true" >> .upmconfig.toml

But this still gives me the message "... failed because it lacks valid authentication credentials" when the package manager tries to resolve the dependencies, whereas on Ubuntu everything works as expected.

@davidmfinol davidmfinol added question Further information is requested help wanted Extra attention is needed labels Jan 8, 2024
@GabLeRoux
Copy link
Member

GabLeRoux commented Mar 14, 2024

I think this could be related:
game-ci/unity-test-runner#261

It's not for the builder project, but it does work with the .upmconfig.toml. We might need to do similar logic for the builder project.

@nvandessel
Copy link

nvandessel commented Mar 14, 2024

Unfortunately for the test-runner, package-mode has the caveat of only working on Linux runners due to the dependency on jq, issue being tracked here: game-ci/unity-test-runner#224

So that means that I haven't been able to confirm it working on a Windows machine.

One possible option is to try a different location for the toml that is accepted by Unity. See valid locations here.
So instead of: cd $HOME, it might be: cd C:\ProgramData\Unity\config\

*Note that my example location requires the file to be named upmconfig.toml without the prepended .

@laurentinosn-chimera
Copy link

@lukas-prodviz have you managed to work with this config? I'm having the same issue. I'm also trying to build on a self-hosted Windows agent and must authenticate it with my external package manager. I have tried using various approaches without success:
Creating the upm file to C:\ProgramData\Unity\config;
Try creating on ${{ runner.temp }}/_github_home
And finally using this:

    - name: Build project
       uses: game-ci/unity-builder@v4
       env:
         ...
         UPM_REGISTRY_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
       with:
         ...
         scopedRegistryUrl: http://myserver.upm.com:8080

Still looking to solve this problem =/

@Shaun-Fong
Copy link

@lukas-prodviz have you managed to work with this config? I'm having the same issue. I'm also trying to build on a self-hosted Windows agent and must authenticate it with my external package manager. I have tried using various approaches without success: Creating the upm file to C:\ProgramData\Unity\config; Try creating on ${{ runner.temp }}/_github_home And finally using this:

You cannot use scopedRegistryUrl as an input parameter because it does not exist in the builder at all.

    - name: Build project
       uses: game-ci/unity-builder@v4
       env:
         ...
         UPM_REGISTRY_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
       with:
         ...
         scopedRegistryUrl: http://myserver.upm.com:8080

Try PR #665; it should work with your actions.
I successfully set up GitHub Packages as a private registry in my private repo.

@laurentinosn-chimera
Copy link

It worked, thank @Shaun-Fong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants