Bash unity cloud构建后脚本上传到github页面
我在Github页面上运行游戏。 最近开始使用unity云构建 我成功地运行了构建后脚本。 但对于如何让它拉入存储库、应用新构建并将其推送到GitHub,却没有任何线索 到目前为止,我已经尝试了这个脚本,没有太多的运气Bash unity cloud构建后脚本上传到github页面,bash,git,unity3d,github,Bash,Git,Unity3d,Github,我在Github页面上运行游戏。 最近开始使用unity云构建 我成功地运行了构建后脚本。 但对于如何让它拉入存储库、应用新构建并将其推送到GitHub,却没有任何线索 到目前为止,我已经尝试了这个脚本,没有太多的运气 #!/bin/sh set -x ssh-agent $(ssh-add ./id_rsa; git clone git@github.com:triktron/Road-Rage.git tmpResp; cp -r ./WebGL/Build ./tmpResp/;cd
#!/bin/sh
set -x
ssh-agent $(ssh-add ./id_rsa; git clone git@github.com:triktron/Road-Rage.git tmpResp; cp -r ./WebGL/Build ./tmpResp/;cd ./tmpResp/; git add Build; git commit -m "auto build"; git push)
日志对此做出了回应
2838: Executing Post-Build Script at upload.sh
2839: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2840: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
2841: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2842: It is required that your private key files are NOT accessible by others.
2843: This private key will be ignored.
2844: ++ git clone git@github.com:triktron/Road-Rage.git tmpResp
2845: Cloning into 'tmpResp'...
2846: ++ cp -r ./WebGL/Build ./tmpResp/
2847: cp: ./WebGL/Build: No such file or directory
2848: ++ cd ./tmpResp/
2849: ++ git add Build
2850: ++ git commit -m 'auto build'
2851: *** Please tell me who you are.
2852: Run
2853: to set your account's default identity.
2854: Omit --global to set the identity only in this repository.
2855: ++ git push
2856: Everything up-to-date
2857: + ssh-agent
2858: SSH_AGENT_PID=5387; export SSH_AGENT_PID;
2859: WORKSPACESIZE | ARTIFACTSSIZE
2860: --------------|--------------
2861: 154.10 MiB | 12.79 MiB
谢谢你的时间
[2020年3月23日更新]
所以我花了更多的时间在这上面,然后我愿意说,但我明白了。
如果有人想做同样的事情,这里有我的解决方案
我把这个脚本放在我的文件中
#!/bin/sh
set -x
export buildfolder="$(find . -regex '.\/temp[^\/]*\/WebGL\/Build' -print -quit)"
if [ -z "$buildfolder" ]; then
echo "Could not find build folder"
exit 1
fi
if [ ! -d ./tmp ]; then
git clone "https://${nickname}:${githubkey}@github.com/${nickname}/${repositorie}" ./tmp
fi
cp -r "$buildfolder" ./tmp
cd ./tmp
git add Build
git config --global user.email "$githubemail"
git config --global user.name "$nickname"
git commit -m "unity cloud build"
git push --force
并在我的unity cloud构建控制台中添加了这些环境变量