cross-compile: make rclone-beta-latest* for download #1047

This commit is contained in:
Nick Craig-Wood 2017-02-20 16:54:33 +00:00
parent 5e93fe96d3
commit 1ae604fcf4
2 changed files with 7 additions and 6 deletions

View file

@ -98,17 +98,15 @@ upload_github:
./bin/upload-github $(TAG) ./bin/upload-github $(TAG)
cross: doc cross: doc
go run bin/cross-compile.go $(TAG) go run bin/cross-compile.go -release current $(TAG)
beta: beta:
go run bin/cross-compile.go $(TAG)β go run bin/cross-compile.go $(TAG)β
rm build/*-current-*
rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β
@echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/ @echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/
travis_beta: travis_beta:
go run bin/cross-compile.go $(TAG)β go run bin/cross-compile.go -release latest-beta $(TAG)β
rm build/*-current-*
rclone --config bin/travis.rclone.conf -v copy build/ memstore:beta-rclone-org/$(TAG) rclone --config bin/travis.rclone.conf -v copy build/ memstore:beta-rclone-org/$(TAG)
@echo Beta release ready at $(BETA_URL) @echo Beta release ready at $(BETA_URL)

View file

@ -20,6 +20,7 @@ var (
// Flags // Flags
debug = flag.Bool("d", false, "Print commands instead of running them.") debug = flag.Bool("d", false, "Print commands instead of running them.")
parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.") 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")
) )
// GOOS/GOARCH pairs we build for // GOOS/GOARCH pairs we build for
@ -99,8 +100,10 @@ func compileArch(version, goos, goarch, dir string) {
run("cp", "-a", "../rclone.1", dir) run("cp", "-a", "../rclone.1", dir)
zip := dir + ".zip" zip := dir + ".zip"
run("zip", "-r9", zip, dir) run("zip", "-r9", zip, dir)
currentZip := strings.Replace(zip, "-"+version, "-current", 1) if *copyAs != "" {
run("ln", zip, currentZip) copyAsZip := strings.Replace(zip, "-"+version, "-"+*copyAs, 1)
run("ln", zip, copyAsZip)
}
run("rm", "-rf", dir) run("rm", "-rf", dir)
log.Printf("Done compiling %s/%s", goos, goarch) log.Printf("Done compiling %s/%s", goos, goarch)
} }