2022-05-26 07:18:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-05-27 03:47:56 +00:00
|
|
|
echo 'Building UI'
|
|
|
|
|
cd app
|
2022-05-31 07:42:05 +00:00
|
|
|
pnpm install && pnpm run build
|
2022-05-27 03:47:56 +00:00
|
|
|
cd ..
|
2022-05-26 07:18:53 +00:00
|
|
|
|
2022-05-27 03:47:56 +00:00
|
|
|
echo 'Cleaning Builds'
|
2022-05-26 07:18:53 +00:00
|
|
|
rm -rf app/build
|
|
|
|
|
rm -rf app/kernel-linux
|
2024-05-28 15:40:32 +00:00
|
|
|
rm -rf app/kernel-linux-arm64
|
2022-05-26 07:18:53 +00:00
|
|
|
|
|
|
|
|
echo 'Building Kernel'
|
|
|
|
|
|
|
|
|
|
cd kernel
|
|
|
|
|
go version
|
|
|
|
|
export GO111MODULE=on
|
2024-11-30 12:56:59 +00:00
|
|
|
export GOPROXY=https://mirrors.aliyun.com/goproxy/
|
2022-05-26 07:18:53 +00:00
|
|
|
export CGO_ENABLED=1
|
|
|
|
|
|
2024-05-28 15:56:04 +00:00
|
|
|
echo 'Building Kernel amd64'
|
2022-05-26 07:18:53 +00:00
|
|
|
export GOOS=linux
|
|
|
|
|
export GOARCH=amd64
|
2024-06-03 09:06:38 +00:00
|
|
|
export CC=~/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc
|
2024-06-01 15:32:52 +00:00
|
|
|
go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
2024-05-28 15:40:32 +00:00
|
|
|
|
2024-05-28 15:56:04 +00:00
|
|
|
echo 'Building Kernel arm64'
|
2024-05-28 15:40:32 +00:00
|
|
|
export GOARCH=arm64
|
2024-06-01 10:11:11 +00:00
|
|
|
export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc
|
2024-06-01 15:32:52 +00:00
|
|
|
go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
2022-05-26 07:18:53 +00:00
|
|
|
cd ..
|
|
|
|
|
|
2024-05-28 16:09:41 +00:00
|
|
|
echo 'Building Electron App amd64'
|
2022-05-26 07:18:53 +00:00
|
|
|
cd app
|
2022-05-31 07:42:05 +00:00
|
|
|
pnpm run dist-linux
|
2024-05-28 16:09:41 +00:00
|
|
|
echo 'Building Electron App arm64'
|
|
|
|
|
pnpm run dist-linux-arm64
|
2022-05-26 07:18:53 +00:00
|
|
|
cd ..
|