From 953b9532853500dc68ce6a3f95b79bd1bc8bdcd8 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Sun, 3 Jul 2016 10:54:28 -0400 Subject: Added a build script --- Rakefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Rakefile (limited to 'Rakefile') 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 -- cgit v1.3