feat: DH-HIS Web Giao Ban Go v1.0.1 (Favicon, Exe icon, System Tray, Gitea auto-update)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$DIR"
|
||||
|
||||
echo "======================================================="
|
||||
echo " Building DH-HIS Web Giao Ban (Go Standalone)"
|
||||
echo "======================================================="
|
||||
|
||||
# 1. Build Linux binary
|
||||
echo "[1/2] Building Linux standalone binary: web-giao-ban..."
|
||||
go build -ldflags="-s -w" -o web-giao-ban .
|
||||
chmod +x web-giao-ban
|
||||
echo " -> OK: $(ls -lh web-giao-ban | awk '{print $9, $5}')"
|
||||
|
||||
# 2. Build Windows .exe binary
|
||||
echo "[2/2] Building Windows standalone executable: web-giao-ban.exe..."
|
||||
if [ -f "app.ico" ]; then
|
||||
echo " * Embedding application icon into Windows PE resource..."
|
||||
echo '1 ICON "app.ico"' > app.rc
|
||||
x86_64-w64-mingw32-windres -i app.rc -O coff -o rsrc_windows_amd64.syso
|
||||
fi
|
||||
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 \
|
||||
go build -ldflags="-s -w -H windowsgui" -o web-giao-ban.exe .
|
||||
echo " -> OK: $(ls -lh web-giao-ban.exe | awk '{print $9, $5}')"
|
||||
|
||||
echo "======================================================="
|
||||
echo " Build hoàn tất! Có thể copy web-giao-ban.exe sang Windows là chạy được ngay."
|
||||
echo "======================================================="
|
||||
Reference in New Issue
Block a user