feat: 完善后端脚手架基础能力

This commit is contained in:
2026-08-09 01:06:21 +08:00
parent e311f416f2
commit f95311a107
61 changed files with 5630 additions and 521 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
output_dir="$repo_root/dist"
version="${VERSION:-dev}"
mkdir -p "$output_dir"
platforms=(
"linux amd64"
"darwin amd64"
"windows amd64"
)
for platform in "${platforms[@]}"; do
read -r target_os target_arch <<<"$platform"
extension=""
if [[ "$target_os" == "windows" ]]; then
extension=".exe"
fi
output="$output_dir/skeleton-${target_os}-${target_arch}${extension}"
echo "Building $output"
CGO_ENABLED=0 GOOS="$target_os" GOARCH="$target_arch" \
go build -trimpath -ldflags "-s -w -X main.buildVersion=$version" -o "$output" .
done
echo "Cross-platform amd64 binaries written to $output_dir"
+12
View File
@@ -54,4 +54,16 @@ done < <(rg -l --hidden --glob '!**/.git/**' --glob '!**/.idea/**' "${old_module
go mod edit -module "$new_module"
go mod tidy
atlas_tool_dir="$repo_root/tools/atlas-loader"
if [[ -f "$atlas_tool_dir/go.mod" ]]; then
(
cd "$atlas_tool_dir"
go mod edit -droprequire "$old_module"
go mod edit -require "$new_module@v0.0.0"
go mod edit -dropreplace "$old_module"
go mod edit -replace "$new_module=../.."
go mod tidy
)
fi
echo "Initialization complete."