diff options
| author | Grant Ammons <gammons@gmail.com> | 2016-07-03 10:54:28 -0400 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2016-07-03 10:54:28 -0400 |
| commit | 953b9532853500dc68ce6a3f95b79bd1bc8bdcd8 (patch) | |
| tree | d96936d7ec44643b2e333ba6ad68a2fe1ae19c53 | |
| parent | 66a2e8c791326ebe98845f17d9d79b4817b73b99 (diff) | |
Added a build script
| -rw-r--r-- | Rakefile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..59ecc9c --- /dev/null +++ b/Rakefile @@ -0,0 +1,28 @@ +desc "Builds todolist for release" + +Envs = [ + {goos: "darwin", arch: "386"}, + {goos: "darwin", arch: "amd64"}, + {goos: "darwin", arch: "arm"}, + {goos: "linux", arch: "386"}, + {goos: "linux", arch: "amd64"}, + {goos: "windows", arch: "386"}, + {goos: "windows", arch: "amd64"} +] + +Version = "0.2.0" + + +task :build do + `rm -rf dist/#{Version}` + Envs.each do |env| + ENV["GOOS"] = env[:goos] + ENV["GOARCH"] = env[:arch] + puts "Building #{env[:goos]} #{env[:arch]}" + `GOOS=#{env[:goos]} GOARCH=#{env[:arch]} go build -v -o dist/#{Version}/todolist` + puts "Zipping #{env[:goos]} #{env[:arch]}" + `zip dist/#{Version}/todolist_#{env[:goos]}_#{env[:arch]}.zip dist/#{Version}/todolist` + puts "Removing dist/#{Version}/todolist" + `rm -rf dist/#{Version}/todolist` + end +end |
