-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90c103c
commit f9f6507
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
main | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# 定义输出目录 | ||
OUTPUT_DIR="build" | ||
mkdir -p ${OUTPUT_DIR} | ||
|
||
# Linux amd64 | ||
echo "Building for Linux amd64..." | ||
GOOS=linux GOARCH=amd64 go build -o ${OUTPUT_DIR}/gh-proxy-go-linux-amd64 main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-linux-amd64" | ||
|
||
# Linux arm64 | ||
echo "Building for Linux arm64..." | ||
GOOS=linux GOARCH=arm64 go build -o ${OUTPUT_DIR}/gh-proxy-go-linux-arm64 main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-linux-arm64" | ||
|
||
# Linux ARMv7 | ||
echo "Building for Linux ARMv7..." | ||
GOOS=linux GOARCH=arm GOARM=7 go build -o ${OUTPUT_DIR}/gh-proxy-go-linux-armv7 main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-linux-armv7" | ||
|
||
# Windows amd64 | ||
echo "Building for Windows amd64..." | ||
GOOS=windows GOARCH=amd64 go build -o ${OUTPUT_DIR}/gh-proxy-go-windows-amd64.exe main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-windows-amd64.exe" | ||
|
||
# macOS amd64 | ||
echo "Building for macOS amd64..." | ||
GOOS=darwin GOARCH=amd64 go build -o ${OUTPUT_DIR}/gh-proxy-go-macos-amd64 main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-macos-amd64" | ||
|
||
# macOS arm64 | ||
echo "Building for macOS arm64..." | ||
GOOS=darwin GOARCH=arm64 go build -o ${OUTPUT_DIR}/gh-proxy-go-macos-arm64 main.go | ||
echo "Output: ${OUTPUT_DIR}/gh-proxy-go-macos-arm64" | ||
|
||
echo "Build completed." |