为了构建一个统一项目,我使用CircleCI和一个GameCI对接映像。构建可以工作,但我正在尝试使用球体,以便在GitHub上为构建创建一个版本。为此,我创建了一个新的单独的工作,因此我需要在两个作业之间共享数据。我使用persist_to_workspace来实现这一点,正如文档中所指定的那样,但是解决方案似乎不起作用。我得到以下错误:
无法确保工作区目录/root/project/Zipped存在
对于工作区持久化逻辑,我在我的config.yml文件中添加了以下代码行:
working_directory: /root/project -在主任务的执行器内persist_to_workspace --作为主作业步骤中的最后一个命令attach_workspace -作为第二个作业步骤中的开始命令以下是我的完整config.yml文件:
version: 2.1
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有人能帮我一下吗?
发布于 2021-02-25 19:46:56
如果有人遇到同样的问题,尽量避免使用/root路径。我已经将工件存储在/tmp/中的某个地方,在存储工件之前,通过使用带有mkdir标志的mkdir指定chmod权限,手动创建了带有-m的文件夹。
https://stackoverflow.com/questions/66262975
复制相似问题