-
Notifications
You must be signed in to change notification settings - Fork 5
/
pkg-build.sh
executable file
·50 lines (40 loc) · 1.25 KB
/
pkg-build.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
#!/bin/bash
# Strict mode
set -euo pipefail
# Cleanup the files
mkdir -p ./bin
rm -f ./bin/uilicious-*
#
# Does the builds
#
COMMA=","
TARGET_MACOS="node16-macos-x64,node16-macos-arm64"
TARGET_LINUX="node16-linux-x64,node16-linux-arm64"
TARGET_ALPINE="node16-alpine-x64"
TARGET_WINDOWS="node16-win-x64"
TARGET_ARM="node16-linux-armv7"
TARGET_ALL=$TARGET_MACOS$COMMA$TARGET_LINUX$COMMA$TARGET_ALPINE$COMMA$TARGET_WINDOWS
# The various builds
npx --package "[email protected]" \
pkg ./src/uilicious-cli.js \
--options max_old_space_size=2048 \
--no-bytecode --public-packages "*" --public \
--out-path ./bin/ \
--target $TARGET_ALL
#
# Lets rename the files
#
mkdir -p ./bin
cd ./bin
# # 64-bit support
# mv uilicious-*-win-x64.exe uilicious-cli-win-64bit.exe
# mv uilicious-*-macos-x64 uilicious-cli-macos-64bit
# mv uilicious-*-linux-x64 uilicious-cli-linux-64bit
# mv uilicious-*-alpine-x64 uilicious-cli-alpine-64bit
# # arm support
# mv uilicious-*-macos-arm64 uilicious-cli-macos-arm64
# mv uilicious-*-linux-arm64 uilicious-cli-linux-arm64
# # 32-bit support
# mv uilicious-*-linux-x86 uilicious-cli-linux-32bit
# mv uilicious-*-macos-x86 uilicious-cli-macos-32bit
# mv uilicious-*-win-x86.exe uilicious-cli-win-32bit.exe