-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
24 lines (18 loc) · 1.03 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
VERSION="0.1.0"
BINARY_NAME="bolt"
# Build for macOS
GOOS=darwin GOARCH=amd64 go build -o ${BINARY_NAME}_${VERSION}_darwin_amd64
GOOS=darwin GOARCH=arm64 go build -o ${BINARY_NAME}_${VERSION}_darwin_arm64
# Build for Linux
GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME}_${VERSION}_linux_amd64
GOOS=linux GOARCH=arm64 go build -o ${BINARY_NAME}_${VERSION}_linux_arm64
# Build for Windows
GOOS=windows GOARCH=amd64 go build -o ${BINARY_NAME}_${VERSION}_windows_amd64.exe
# Create archives
tar -czvf ${BINARY_NAME}_${VERSION}_darwin_amd64.tar.gz ${BINARY_NAME}_${VERSION}_darwin_amd64
tar -czvf ${BINARY_NAME}_${VERSION}_darwin_arm64.tar.gz ${BINARY_NAME}_${VERSION}_darwin_arm64
tar -czvf ${BINARY_NAME}_${VERSION}_linux_amd64.tar.gz ${BINARY_NAME}_${VERSION}_linux_amd64
tar -czvf ${BINARY_NAME}_${VERSION}_linux_arm64.tar.gz ${BINARY_NAME}_${VERSION}_linux_arm64
zip ${BINARY_NAME}_${VERSION}_windows_amd64.zip ${BINARY_NAME}_${VERSION}_windows_amd64.exe
echo "Build complete!"