Skip to content

Commit

Permalink
docs: Add ignorefile and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
uerax committed Sep 24, 2023
1 parent ba75fd8 commit 3aa7c00
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# Go build file
build

# Debug file
__debug_bin*
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
file=$(date '+%Y%m%d%H%M%S')

echo "Building Linux versions..."
GOOS=linux GOARCH=amd64 go build -o build/$file/Anonymous-Bot-64 -trimpath -ldflags "-s -w -buildid=" cmd/main.go
GOOS=linux GOARCH=arm64 go build -o build/$file/Anonymous-Bot-arm64 -trimpath -ldflags "-s -w -buildid=" cmd/main.go

# 打包 Windows 版本
echo "Building Windows versions..."
GOOS=windows GOARCH=amd64 go build -o build/$file/Anonymous-Bot-windows.exe -trimpath -ldflags "-s -w -buildid=" cmd/main.go
GOOS=windows GOARCH=arm64 go build -o build/$file/Anonymous-Bot-windows-arm64.exe -trimpath -ldflags "-s -w -buildid=" cmd/main.go

# 打包 macOS 版本
echo "Building macOS versions..."
GOOS=darwin GOARCH=arm64 go build -o build/$file/Anonymous-Bot-macos-arm64 -trimpath -ldflags "-s -w -buildid=" cmd/main.go

echo "打包完成"

0 comments on commit 3aa7c00

Please sign in to comment.