-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.sh
executable file
·41 lines (26 loc) · 1014 Bytes
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
echo "Building"
ver=$(git describe --tags)
echo "Latest tag/version: $ver"
echo "Preparing bin folder"
rm -r ./bin
echo "Creating bin folders for various platforms"
mkdir -p ./bin/windows
mkdir -p ./bin/linux
mkdir -p ./bin/darwin
echo "Building things"
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'ropci/cmd.VersionInfo=$(git rev-parse HEAD)'" -o bin/linux/ropci main.go
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X 'ropci/cmd.VersionInfo=$(git rev-parse HEAD)'" -o bin/windows/ropci.exe main.go
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X 'ropci/cmd.VersionInfo=$(git rev-parse HEAD)'" -o bin/darwin/ropci main.go
echo "Copying templates"
cp -r ./templates ./bin/windows
cp -r ./templates ./bin/linux
cp -r ./templates ./bin/darwin
echo "Zipping packages"
cd bin
cd windows && zip ../ropci-windows-$ver.zip -r * && cd ..
cd darwin && zip ../ropci-darwin-$ver.zip -r * && cd ..
cd linux && zip ../ropci-linux-$ver.zip -r * && cd ..
cd ..
pwd
echo "Done"