🔨 Update build scripts

This commit is contained in:
Liang Ding
2022-05-27 11:47:56 +08:00
parent 25034d5eb2
commit dc46b478bc
5 changed files with 13 additions and 12 deletions

35
scripts/darwin-build.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
echo 'Building UI'
cd app
npm install && npm run build
cd ..
echo 'Cleaning Builds'
rm -rf app/build
rm -rf app/kernel-darwin
rm -rf app/kernel-darwin-arm64
echo 'Building Kernel'
cd kernel
go version
export GO111MODULE=on
export GOPROXY=https://goproxy.io
export CGO_ENABLED=1
export GOOS=darwin
export GOARCH=amd64
go build --tags fts5 -v -o "app/kernel-darwin/SiYuan-Kernel" -ldflags "-s -w" .
export GOOS=darwin
export GOARCH=arm64
go build --tags fts5 -v -o "app/kernel-darwin-arm64/SiYuan-Kernel" -ldflags "-s -w" .
cd ..
echo 'Building Electron'
cd app
npm run dist-darwin
echo 'Building Electron arm64'
npm run dist-darwin-arm64
cd ..