-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release.sh
executable file
·163 lines (116 loc) · 3.4 KB
/
build_release.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#! /usr/bin/bash
echo "Building artifacts for Sqore"
spinner()
{
# function taken from https://stackoverflow.com/a/20369590
local pid=$!
local delay=0.25
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf " \b\b\b\b"
}
echo "Verifying target installation"
echo "Ensuring docker is currently running"
dockerd &> /dev/null
echo "Building targets (this are containerized and may take a while UwU)"
echo " - Linux x86 64 Debug"
cross build -q --target=x86_64-unknown-linux-gnu \
> /dev/null \
& spinner
echo " Done"
echo " - Linux x86 64 Release"
cross build -q -r --target=x86_64-unknown-linux-gnu \
> /dev/null \
& spinner
echo " Done"
echo " - Windows x64 Debug"
cross build -q --target=x86_64-pc-windows-gnu \
> /dev/null \
& spinner
echo " Done"
echo " - Windows x64 Release"
cross build -q -r --target=x86_64-pc-windows-gnu \
> /dev/null \
& spinner
echo " Done"
echo " - Mac Debug"
cross build -q --target=x86_64-apple-darwin \
> /dev/null \
& spinner
echo " Done"
echo " - Mac Release"
cross build -q -r --target=x86_64-apple-darwin \
> /dev/null \
& spinner
echo " Done"
echo "All builds complete"
echo "---"
##
##
##
echo "Building documentation"
cargo doc --no-deps --document-private-items --target-dir . \
> /dev/null \
& spinner
echo " Done"
##
##
##
# make folder
echo "Making folders"
mkdir addons
mkdir addons/sqore
mkdir addons/sqore/target
mkdir addons/sqore/target/debug
mkdir addons/sqore/target/release
echo "Copying files over"
# metadata
cp README.md addons/sqore/README.md
cp LICENSE addons/sqore/LICENSE
cp sqore.gdextension addons/sqore/sqore.gdextension
# Stage for zip archive
# Windows libraries
cp target/x86_64-pc-windows-gnu/debug/sqore.dll \
addons/sqore/target/debug/sqore.dll
cp target/x86_64-pc-windows-gnu/release/sqore.dll \
addons/sqore/target/release/sqore.dll
# Linux libraries
cp target/x86_64-unknown-linux-gnu/debug/libsqore.so \
addons/sqore/target/debug/libsqore.so
cp target/x86_64-unknown-linux-gnu/release/libsqore.so \
addons/sqore/target/release/libsqore.so
# Mac libraries
cp target/x86_64-apple-darwin/debug/libsqore.dylib \
addons/sqore/target/debug/libsqore.dylib
cp target/x86_64-apple-darwin/release/libsqore.dylib \
addons/sqore/target/release/libsqore.dylib
# Stage for local (using as a git submodule)
# Windows libraries
cp target/x86_64-pc-windows-gnu/debug/sqore.dll \
target/debug/sqore.dll
cp target/x86_64-pc-windows-gnu/release/sqore.dll \
target/release/sqore.dll
# Linux libraries
cp target/x86_64-unknown-linux-gnu/debug/libsqore.so \
target/debug/libsqore.so
cp target/x86_64-unknown-linux-gnu/release/libsqore.so \
target/release/libsqore.so
# Mac libraries
cp target/x86_64-apple-darwin/debug/libsqore.dylib \
target/debug/libsqore.dylib
cp target/x86_64-apple-darwin/release/libsqore.dylib \
target/release/libsqore.dylib
echo "Copying folders over"
# static files folders
cp -r scenes addons/sqore/scenes/
cp -r assets addons/sqore/assets/
cp -r doc addons/sqore/doc
echo "Creating zip archive"
zip -r -q sqore_release addons && rm -r addons/
echo "Your archive should be in this directory as 'sqore_release.zip'"