2024-09-14 22:56:50 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-11-08 15:01:14 +08:00
|
|
|
VERSION=1.7.1
|
2024-09-16 13:11:04 +08:00
|
|
|
|
|
|
|
# Clean up the build directory
|
|
|
|
rm -rf build
|
|
|
|
mkdir build
|
|
|
|
|
2024-09-14 22:56:50 +08:00
|
|
|
# Linux amd64
|
2024-09-16 13:11:04 +08:00
|
|
|
echo "Building for Linux amd64..."
|
2024-10-21 16:29:17 +08:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
|
|
|
tar zcf build/ncmdump-go_linux_amd64_$VERSION.tar.gz -C build ncmdump-go
|
|
|
|
rm build/ncmdump-go
|
2024-09-16 13:11:04 +08:00
|
|
|
|
|
|
|
# Linux arm64
|
|
|
|
echo "Building for Linux arm64..."
|
2024-10-21 16:29:17 +08:00
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
|
|
|
tar zcf build/ncmdump-go_linux_arm64_$VERSION.tar.gz -C build ncmdump-go
|
|
|
|
rm build/ncmdump-go
|
2024-09-14 22:56:50 +08:00
|
|
|
|
|
|
|
# macOS amd64
|
2024-09-16 13:11:04 +08:00
|
|
|
echo "Building for macOS amd64..."
|
2024-10-21 16:29:17 +08:00
|
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
|
|
|
tar zcf build/ncmdump-go_darwin_amd64_$VERSION.tar.gz -C build ncmdump-go
|
|
|
|
rm build/ncmdump-go
|
2024-09-14 22:56:50 +08:00
|
|
|
|
|
|
|
# macOS arm64
|
2024-09-16 13:11:04 +08:00
|
|
|
echo "Building for macOS arm64..."
|
2024-10-21 16:29:17 +08:00
|
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
|
|
|
tar zcf build/ncmdump-go_darwin_arm64_$VERSION.tar.gz -C build ncmdump-go
|
|
|
|
rm build/ncmdump-go
|
2024-09-14 22:56:50 +08:00
|
|
|
|
|
|
|
# Windows amd64
|
2024-09-16 13:11:04 +08:00
|
|
|
echo "Building for Windows amd64..."
|
2024-10-21 16:29:17 +08:00
|
|
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go.exe github.com/taurusxin/ncmdump-go
|
|
|
|
zip -q -j build/ncmdump-go_windows_amd64_$VERSION.zip ./build/ncmdump-go.exe
|
|
|
|
rm build/ncmdump-go.exe
|