-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·54 lines (44 loc) · 1.27 KB
/
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
51
52
53
54
#!/bin/bash
NODE_VERSION=16.16.0
VERSION=$(node -p -e "require('./package.json').version")
BUILD_CMD="npx pkg ../dist/index.js"
rm -rf bin dist
npx webpack
mkdir bin
cd bin
# Linux amd64
$BUILD_CMD -t node"$NODE_VERSION"-linux-x64 --out-path linux-amd64
cd linux-amd64
mv index scratch-run
zip "../scratch-run_"$VERSION"_linux_amd64.zip" scratch-run
cd ..
# Linux arm64
$BUILD_CMD -t node"$NODE_VERSION"-linux-arm64 --out-path linux-arm64
cd linux-arm64
mv index scratch-run
zip "../scratch-run_"$VERSION"_linux_arm64.zip" scratch-run
cd ..
# macOS amd64
$BUILD_CMD -t node"$NODE_VERSION"-macos-x64 --out-path macos-amd64
cd macos-amd64
mv index scratch-run
zip "../scratch-run_"$VERSION"_macos_amd64.zip" scratch-run
cd ..
# macOS arm64
$BUILD_CMD -t node"$NODE_VERSION"-macos-arm64 --out-path macos-arm64
cd macos-arm64
mv index scratch-run
zip "../scratch-run_"$VERSION"_macos_arm64.zip" scratch-run
cd ..
# Windows amd64
$BUILD_CMD -t node"$NODE_VERSION"-win-x64 --out-path win-amd64
cd win-amd64
mv index.exe scratch-run.exe
zip "../scratch-run_"$VERSION"_win_amd64.zip" scratch-run.exe
cd ..
# Windows arm64
$BUILD_CMD -t node"$NODE_VERSION"-win-arm64 --out-path win-arm64
cd win-arm64
mv index.exe scratch-run.exe
zip "../scratch-run_"$VERSION"_win_arm64.zip" scratch-run.exe
cd ..