mirror of https://gitee.com/godoos/godoos.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
670 B
22 lines
670 B
param (
|
|
[string]$GOOS = $(go env GOOS),
|
|
[string]$GOARCH = $(go env GOARCH)
|
|
)
|
|
|
|
$BINARY_NAME = "godo"
|
|
$DEPS_DIR = "deps"
|
|
$PLATFORM_DIR = Join-Path -Path $DEPS_DIR -ChildPath $GOOS
|
|
$ZIP_FILE = Join-Path -Path $DEPS_DIR -ChildPath "${GOOS}.zip"
|
|
|
|
if (Test-Path -Path $PLATFORM_DIR) {
|
|
Write-Output "Compressing $PLATFORM_DIR..."
|
|
Compress-Archive -Path $PLATFORM_DIR -DestinationPath $ZIP_FILE
|
|
Write-Output "Compression completed."
|
|
} else {
|
|
Write-Output "Directory $PLATFORM_DIR does not exist. Skipping compression."
|
|
}
|
|
|
|
Write-Output "Building $BINARY_NAME for $GOOS/$GOARCH..."
|
|
go build -ldflags="-s -w" -o $BINARY_NAME
|
|
|
|
Write-Output "Build completed."
|