0

So I've been trying to setup a pipeline to build a project following this tutorial:

https://jaidengerig.medium.com/create-a-cd-pipeline-to-auto-publish-unity-games-from-github-to-itch-io-in-30-minutes-for-free-bae3b254283c

But the main issue is that my project data its inside of a src folder: enter image description here

So looks like the pipeline its trying to access the files from the base directory.

This is my main.yaml:

name: Build Project and Publish to itch.io
on: 
  push:
    branches:
      - 'main'
jobs:
  build:
    name: Build Project and Publish to itch.io ✨
    runs-on: ubuntu-latest
    # This stops builds that are in-progress once a new commit comes in
    concurrency: 
      group: unity-build
      cancel-in-progress: true
    steps:
      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          path: ./src
          lfs: true     
      # Cache
      - uses: actions/cache@v2
        with:
          path: Library
          key: Library      
      # Build
      - name: Build project
        uses: game-ci/unity-builder@v2
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
        with:
          projectPath: ./src
          targetPlatform: StandaloneWindows       
 
        # Upload to Itch
      - uses: josephbmanley/butler-publish-itchio-action@master
        env:
          BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
          CHANNEL: windows
          ITCH_GAME: (myitchgamename)
          ITCH_USER: (myitchusername)
          PACKAGE: build/StandaloneWindows

What am I doing wrong? I am pretty new to github actions and the workdir it's still a mistery to me.

Bocdagla
  • 21
  • 2
  • is your project indeed directly within `src` or further nested like e.g. `src/UnityRootFolder/Assets` etc in which case your path would rather be `src/UnityRootFolder` .. and also your Library cache path should rather be accordingly `src/Library` or `src/UnityRootFolder/Library` (also not sure but I think the leading `./` is either not needed or shouldn't be there at all ) – derHugo Jul 18 '23 at 12:37
  • Yes the project its already inside the src folder, there you can find the Assets folder and the ProjectSettings. I tried removing the ```./``` bit i still get these errors: ```Run actions/cache@v2 Cache not found for input keys: Library``` and ```Run game-ci/unity-builder@v2 Error: Project settings file not found at "src/ProjectSettings/ProjectVersion.txt". Have you correctly set the projectPath?``` – Bocdagla Jul 18 '23 at 13:36

1 Answers1

0

Ok i Just realised what was going on.

Looks like the with: path: src was creating a folder called src and the project was being placed inside that src folder.

To find this i added this step just after the checkout:

# Sanity check
      - name: Get directory
        run: ls src

So i was able to identify the problem.

Bocdagla
  • 21
  • 2