"Could not ensure that workspace directory exists"

I am using CircleCI in order to build a Unity project. The build works, but I am trying to make use of the github-release orb in order to create a release on GitHub for the build. I have created a new separate job for this, so I needed to share data between the jobs. I am using persist_to_workspace in order to do that, as specified in the documentation, but the solution doesn’t seem to work - I get the following error: “Could not ensure that workspace directory /root/project/Zipped exists”.

For the workspace persist logic, I’ve added the following lines of code in my config.yml file:

  • working_directory: /root/project - Inside the executor of the main job
  • persist_to_workspace - As a last command inside my main job’s steps
  • attach_workspace - As a beginning command inside my second job’s steps

Here’s my full config.yml file:

orbs:
  github-release: h-matsuo/github-release@0.1.3

executors:
  unity_exec:
    docker:
      - image: unityci/editor:ubuntu-2019.4.19f1-windows-mono-0.9.0
    environment:
      BUILD_NAME: speedrun-circleci-build
    working_directory: /root/project

.build: &build
  executor: unity_exec
  steps:
    - checkout
    - run: mkdir -p /root/project/Zipped
    - run:
        name: Git submodule recursive
        command: git submodule update --init --recursive
    - run:
        name: Remove editor folder in shared project
        command: rm -rf ./Assets/Shared/Movement/Generic/Attributes/Editor/
    - run: 
        name: Converting Unity license
        command: chmod +x ./ci/unity_license.sh && ./ci/unity_license.sh
    - run:
        name: Building game binaries
        command: chmod +x ./ci/build.sh && ./ci/build.sh
    - run: 
        name: Zipping build
        command: apt update && apt -y install zip && zip -r "/root/project/Zipped/build.zip" ./Builds/
    - store_artifacts:
        path: /root/project/Zipped/build.zip
    - run:
        name: Show all files
        command: find "$(pwd)"
    - persist_to_workspace:
        root: Zipped
        paths:
            - build.zip
jobs:
  build_windows:
    <<: *build
    environment:
      BUILD_TARGET: StandaloneWindows64
  release:
    description: Build project and publish a new release tagged `v1.1.1`.
    executor: github-release/default
    steps:
      - attach_workspace:
          at: /root/project/Zipped
      - run:
          name: Show all files
          command: sudo find "/root/project"
      - github-release/create:
          tag: v1.1.1
          title: Version v1.1.1
          description: This release is version v1.1.1.
          file-path: ./build.zip
          
workflows:
  version: 2
  build:
    jobs:
      - build_windows
      - release:
          requires:
            - build_windows

Can somebody help me with this please?

Hi there!

While we are digging into this problem, can you please provide the line that you’re receiving that error message on? That will help a lot!

Thanks!