Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
feat: add a script to build binary files for Linux/macOS/Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yechentide committed Oct 16, 2023
1 parent eadbfc0 commit 1502440
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -eu

BINARY_NAME=mhnow-bot
BUILD_DIR=./build
declare -r BINARY_NAME
declare -r BUILD_DIR

if [[ ! -e "${BUILD_DIR}" ]]; then
mkdir -p "${BUILD_DIR}"
fi

GOOS=linux GOARCH=amd64 go build -o "${BUILD_DIR}/${BINARY_NAME}_linux_x86_64" ./main.go
GOOS=linux GOARCH=arm64 go build -o "${BUILD_DIR}/${BINARY_NAME}_linux_arm64" ./main.go
GOOS=windows GOARCH=amd64 go build -o "${BUILD_DIR}/${BINARY_NAME}_windows_x86_64.exe" ./main.go
GOOS=darwin GOARCH=arm64 go build -o "${BUILD_DIR}/${BINARY_NAME}_macos_arm64" ./main.go

0 comments on commit 1502440

Please sign in to comment.