This repository was archived by the owner on Sep 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·86 lines (63 loc) · 1.95 KB
/
make.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
#!/bin/bash
# --- functions ---
# https://stackoverflow.com/questions/25288194/
# pushd () {
# command pushd "$@" &> /dev/null
# }
# popd () {
# command popd "$@" &> /dev/null
# }
download_dependencies () {
mkdir "scripts" "assets"
get_script package-mac.sh
get_script snap.sh
get_script gh-upload.sh
get_script makeself.sh
get_asset Miscord.app.zip
get_asset snap.zip
get_asset makeself.zip
wget --quiet "https://github.com/github/hub/releases/download/v2.4.0/hub-linux-amd64-2.4.0.tgz"
tar -xzf hub-linux-amd64-2.4.0.tgz
mv hub-linux-amd64-2.4.0/bin/hub scripts/hub
rm -r hub-linux-amd64-2.4.0.tgz hub-linux-amd64-2.4.0
}
get_script () {
wget --quiet "https://raw.githubusercontent.com/Bjornskjald/miscord-build-scripts/master/$1" -O "scripts/$1"
chmod +x "scripts/$1"
}
get_asset () {
wget --quiet "https://github.com/Bjornskjald/miscord-build-scripts/releases/download/assets/$1" -O "assets/$1"
pushd "assets"
unzip -qq "$1"
popd
}
# --- functions end ---
VERSION=$(node -pe "require('./package.json').version")
echo "Building Miscord v$VERSION..."
mkdir -p build
echo "Downloading dependencies..."
download_dependencies
npm install
npm run build:linux -- -o build/miscord-linux &
# npm run build:linux32 -- -o build/miscord-$VERSION-linux-x86 &
npm run build:win -- -o build/miscord-win.exe &
# npm run build:win32 -- -o build/miscord-$VERSION-win-x86.exe &
npm run build:mac -- -o build/miscord-macos &
wait
source scripts/makeself.sh
makeself_linux &
# makeself_linux_x86 &
makeself_mac &
wait
source scripts/package-mac.sh
assets=()
for f in build/*; do
if ! [ -f "$f" ]; then continue; fi
assets+=(-a "$f")
done
MESSAGE="Release generated automatically with [\`miscord-build-scripts\`](https://github.com/Bjornskjald/miscord-build-scripts/) via [\`hub\`](https://github.com/github/hub/)"
FULL="$VERSION
$MESSAGE"
scripts/hub release create "${assets[@]}" -m "$FULL" "v$VERSION"
source scripts/snap.sh
echo "Finished."