first commit
Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
This commit is contained in:
32
scripts/build.sh
Executable file
32
scripts/build.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Change to repo root
|
||||
cd "$(dirname "$0")/../"
|
||||
|
||||
OS=$(uname -s)
|
||||
|
||||
# Determine output binary name
|
||||
case "$OS" in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
OUTPUT="./build/memos.exe"
|
||||
;;
|
||||
*)
|
||||
OUTPUT="./build/memos"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Building for $OS..."
|
||||
|
||||
# Ensure build directories exist and configure a writable Go build cache
|
||||
mkdir -p ./build/.gocache ./build/.gomodcache
|
||||
export GOCACHE="$(pwd)/build/.gocache"
|
||||
export GOMODCACHE="$(pwd)/build/.gomodcache"
|
||||
|
||||
# Build the executable
|
||||
go build -o "$OUTPUT" ./cmd/memos
|
||||
|
||||
echo "Build successful!"
|
||||
echo "To run the application, execute the following command:"
|
||||
echo "$OUTPUT"
|
||||
Reference in New Issue
Block a user