-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
release-mac.sh
81 lines (69 loc) · 2.61 KB
/
release-mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
echo "Welcome to build WebGAL Terre, the editor of WebGAL platform."
# 安装依赖
yarn install --frozen-lockfile --network-timeout=300000
# 清理
rm -rf release
mkdir release
# 进入 Terre 目录
cd packages/terre2
yarn run build
yarn run pkg
cd dist
cp -r WebGAL_Terre ../../../release
rm WebGAL_Terre
cd ../
mkdir Exported_Games
cp -r public assets Exported_Games ../../release
cd ../../
# 进入 Origine 目录
cd packages/origine2
#npm install esbuild-darwin-arm64
export NODE_OPTIONS="--max-old-space-size=8192"
yarn run build
cp -rf dist/* ../../release/public/
cd ../../
# 进入 Electron 目录
cd packages/WebGAL-electron
yarn install --frozen-lockfile
yarn run build-universal
mkdir ../../release/assets/templates/WebGAL_Electron_Template
cp -rf build/mac-universal/WebGAL.app/* ../../release/assets/templates/WebGAL_Electron_Template/
cd ../../
# 克隆 WebGAL Android 模板
cd release/assets/templates/
git clone https://github.com/nini22P/WebGAL-Android.git
mv WebGAL-Android WebGAL_Android_Template
# MainActivity.kt 移动到主文件夹防止误删
mv WebGAL_Android_Template/app/src/main/java/com/openwebgal/demo/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
cd ../../../
cd release
# 删除冗余文件
rm -rf Exported_Games/*
rm -rf public/games/*
rm -rf public/games/.gitkeep
rm -rf assets/templates/WebGAL_Template/game/video/*
rm -rf assets/templates/WebGAL_Template/game/video/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/.github
rm -rf assets/templates/WebGAL_Android_Template/.git
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
cd ..
mkdir release-mac
mv release release-mac
cd release-mac
mv release WebGAL
cd ..
mv release-mac release
cd release
# 写脚本
echo 'cd "$(dirname "$0")"' >> run-webgal-on-mac.command
echo 'cd WebGAL' >> run-webgal-on-mac.command
echo './WebGAL_Terre' >> run-webgal-on-mac.command
chmod +x run-webgal-on-mac.command
# readme
echo '你需要在本目录下执行 "chmod -R +x .",并且使用 run-webgal-on-mac.command 脚本才能正确使用 WebGAL Terre' >> readme.txt
echo 'You need to execute "chmod -R +x ." in this directory, and use run-webgal-on-mac.command to use WebGAL Terre correctly' >> readme.txt
echo 'WebGAL Terre を正しく使用するには、このディレクトリで「chmod -R +x .」を実行し、run-webgal-on-mac.command スクリプトを使用する必要があります。' >> readme.txt
chmod -R +x .
echo "WebGAL Terre is now ready to be deployed."