forked from alexzorin/authy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·39 lines (30 loc) · 1.06 KB
/
release.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Create a "bin" directory if it doesn't exist
mkdir -p bin
# List of target operating systems
OS_TARGETS=("windows" "linux" "darwin")
# Loop through each OS target
for OS in "${OS_TARGETS[@]}"
do
# Set the GOOS environment variable for the current target OS
export GOOS="$OS"
BINARY_NAME="authy-export"
# Add .exe extension for Windows
if [ "$OS" == "windows" ]; then
BINARY_NAME="authy-export.exe"
fi
# Add .exe extension for Windows
if [ "$OS" == "darwin" ]; then
BINARY_NAME="authy-export-mac"
fi
# make bin directory if it doesn't exist
mkdir -p bin
# Build the binary and place it in the "bin" directory
go build -o "bin/$BINARY_NAME" cmd/authy-export/authy-export.go
# Print a message indicating the build is complete for the current OS
echo "Built for $OS as bin/$BINARY_NAME"
done
# Clean up any environment variables
unset GOOS
# Print a message indicating the build process is complete
echo "Build process completed for all platforms. Binaries are in the 'bin' directory."