diff --git a/.travis.yml b/.travis.yml index 5e310a6a3..305ea5bc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ install: script: - make check - make quicktest +- make compile_all env: global: - GOTAGS=cmount diff --git a/Makefile b/Makefile index 237aa4592..f8e5f6c42 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,13 @@ upload_beta: rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' build/ memstore:beta-rclone-org @echo Beta release ready at $(BETA_URL) +compile_all: +ifdef GO_LATEST + go run bin/cross-compile.go -parallel 8 -compile-only $(BUILDTAGS) $(TAG)β +else + @echo Skipping compile all as not on Go stable +endif + travis_beta: git log $(LAST_TAG).. > /tmp/git-log.txt go run bin/cross-compile.go -release beta-latest -git-log /tmp/git-log.txt -exclude "^windows/" -parallel 8 $(BUILDTAGS) $(TAG)β diff --git a/bin/cross-compile.go b/bin/cross-compile.go index d0d5b2029..bd8dcf954 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -19,15 +19,16 @@ import ( var ( // Flags - debug = flag.Bool("d", false, "Print commands instead of running them.") - parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.") - copyAs = flag.String("release", "", "Make copies of the releases with this name") - gitLog = flag.String("git-log", "", "git log to include as well") - include = flag.String("include", "^.*$", "os/arch regexp to include") - exclude = flag.String("exclude", "^$", "os/arch regexp to exclude") - cgo = flag.Bool("cgo", false, "Use cgo for the build") - noClean = flag.Bool("no-clean", false, "Don't clean the build directory before running.") - tags = flag.String("tags", "", "Space separated list of build tags") + debug = flag.Bool("d", false, "Print commands instead of running them.") + parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.") + copyAs = flag.String("release", "", "Make copies of the releases with this name") + gitLog = flag.String("git-log", "", "git log to include as well") + include = flag.String("include", "^.*$", "os/arch regexp to include") + exclude = flag.String("exclude", "^$", "os/arch regexp to exclude") + cgo = flag.Bool("cgo", false, "Use cgo for the build") + noClean = flag.Bool("no-clean", false, "Don't clean the build directory before running.") + tags = flag.String("tags", "", "Space separated list of build tags") + compileOnly = flag.Bool("compile-only", false, "Just build the binary, not the zip.") ) // GOOS/GOARCH pairs we build for @@ -117,20 +118,22 @@ func compileArch(version, goos, goarch, dir string) { env = append(env, flags...) } runEnv(args, env) - // Now build the zip - run("cp", "-a", "../MANUAL.txt", filepath.Join(dir, "README.txt")) - run("cp", "-a", "../MANUAL.html", filepath.Join(dir, "README.html")) - run("cp", "-a", "../rclone.1", dir) - if *gitLog != "" { - run("cp", "-a", *gitLog, dir) + if !*compileOnly { + // Now build the zip + run("cp", "-a", "../MANUAL.txt", filepath.Join(dir, "README.txt")) + run("cp", "-a", "../MANUAL.html", filepath.Join(dir, "README.html")) + run("cp", "-a", "../rclone.1", dir) + if *gitLog != "" { + run("cp", "-a", *gitLog, dir) + } + zip := dir + ".zip" + run("zip", "-r9", zip, dir) + if *copyAs != "" { + copyAsZip := strings.Replace(zip, "-"+version, "-"+*copyAs, 1) + run("ln", zip, copyAsZip) + } + run("rm", "-rf", dir) } - zip := dir + ".zip" - run("zip", "-r9", zip, dir) - if *copyAs != "" { - copyAsZip := strings.Replace(zip, "-"+version, "-"+*copyAs, 1) - run("ln", zip, copyAsZip) - } - run("rm", "-rf", dir) log.Printf("Done compiling %s/%s", goos, goarch) }