Skip to content

UPM authentication and runAsHostUser on self-hosted linux runner #660

Description

@eberleinNeobird

Bug description

I created a self-hosted Linux runner for GitHub, to build my unity app. When I set the unity-builder runAsHosteUser to true authentication to UPM Server fails:

An error occurred while resolving packages:
  Project has invalid dependencies:
    com.neobird.bootstrap: Request [GET <my verdaccio package>] failed because it lacks valid authentication credentials

How to reproduce

Install Linux runner like described on:
https://game.ci/docs/self-hosting/host-provisioning/ubuntu-setup

Use these two steps:

      - name: Setup UPM Authentication
        timeout-minutes: 10
        run: |
          mkdir ${{ runner.temp }}/_github_home
          cd ${{ runner.temp }}/_github_home
          echo "[npmAuth.\"my verdaccio url"]" >> .upmconfig.toml
          echo "alwaysAuth = true" >> .upmconfig.toml
          echo "token = \"${{ secrets.NPM_AUTH_TOKEN }}\"" >> .upmconfig.toml

and

      - name: Unity Build (${{ matrix.targetPlatform }}, ${{ matrix.buildProfile }}, ${{ matrix.unityVersion }})
        uses: game-ci/unity-builder@v4
        timeout-minutes: 60
        env:
          UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          runAsHostUser: ${{ matrix.runAsHostUser }}
          versioning: Semantic
          dockerWorkspacePath: /github/workspace
          unityVersion: ${{ matrix.unityVersion }}
          targetPlatform: ${{ matrix.targetPlatform }}
          buildMethod: NeoBird.Build.BuildScript
          customParameters: '-buildProfile ${{ matrix.buildProfile }

matrix.runAsHostUser of course is true.

Expected behavior

UPM packages should be resolved.

Maybe it's because of step Setup, UPM Authentication does not run as HostUser.
Thx for your help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions