2022-05-26 15:18:53 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-05-27 11:47:56 +08:00
|
|
|
echo 'Building UI'
|
|
|
|
cd app
|
2022-05-31 15:42:05 +08:00
|
|
|
pnpm install && pnpm run build
|
2022-05-27 11:47:56 +08:00
|
|
|
cd ..
|
2022-05-26 15:18:53 +08:00
|
|
|
|
2022-05-27 11:47:56 +08:00
|
|
|
echo 'Cleaning Builds'
|
2022-05-26 15:18:53 +08:00
|
|
|
rm -rf app/build
|
|
|
|
rm -rf app/kernel-linux
|
2024-05-28 23:40:32 +08:00
|
|
|
rm -rf app/kernel-linux-arm64
|
2022-05-26 15:18:53 +08:00
|
|
|
|
|
|
|
echo 'Building Kernel'
|
|
|
|
|
|
|
|
cd kernel
|
|
|
|
go version
|
|
|
|
export GO111MODULE=on
|
|
|
|
export GOPROXY=https://goproxy.io
|
|
|
|
export CGO_ENABLED=1
|
|
|
|
|
2024-05-28 23:56:04 +08:00
|
|
|
echo 'Building Kernel amd64'
|
2022-05-26 15:18:53 +08:00
|
|
|
export GOOS=linux
|
|
|
|
export GOARCH=amd64
|
2022-05-29 10:11:50 +08:00
|
|
|
go build --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w" .
|
2024-05-28 23:40:32 +08:00
|
|
|
|
2024-05-28 23:56:04 +08:00
|
|
|
echo 'Building Kernel arm64'
|
2024-05-28 23:40:32 +08:00
|
|
|
export GOARCH=arm64
|
|
|
|
export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc
|
2024-05-29 09:20:53 +08:00
|
|
|
go build --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w" .
|
2022-05-26 15:18:53 +08:00
|
|
|
cd ..
|
|
|
|
|
2024-05-29 00:09:41 +08:00
|
|
|
echo 'Building Electron App amd64'
|
2022-05-26 15:18:53 +08:00
|
|
|
cd app
|
2022-05-31 15:42:05 +08:00
|
|
|
pnpm run dist-linux
|
2024-05-29 00:09:41 +08:00
|
|
|
echo 'Building Electron App arm64'
|
|
|
|
pnpm run dist-linux-arm64
|
2022-05-26 15:18:53 +08:00
|
|
|
cd ..
|