Files
dify-plugin-daemon/.script/build_plugin_daemon.sh
2025-05-09 12:40:04 +08:00

17 lines
543 B
Bash
Executable File

#!/bin/bash
set -x
# Use environment variable VERSION if set, otherwise use default
VERSION=${VERSION:-0.0.1}
# Detect OS and architecture
OS="${OS:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
ARCH="${ARCH:-$(uname -m)}"
GOOS=${OS} GOARCH=${ARCH} \
go build \
-ldflags "\
-X 'github.com/langgenius/dify-plugin-daemon/internal/manifest.VersionX=${VERSION}' \
-X 'github.com/langgenius/dify-plugin-daemon/internal/manifest.BuildTimeX=$(date -u +%Y-%m-%dT%H:%M:%S%z)'" \
-o dify-plugin-daemon-${OS}-${ARCH} ./cmd/server/main.go