From e00616b0165c1f8a7ddda36082613d8ff66ea0a3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 7 Dec 2017 21:49:32 +0000 Subject: [PATCH] Write version.txt on building into root of downloads --- Makefile | 4 ++-- bin/cross-compile.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa9c2a812..ec565f369 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ log_since_last_release: upload_beta: rclone --config bin/travis.rclone.conf -v copy --exclude '*beta-latest*' build/ memstore:beta-rclone-org/$(TAG) - rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' build/ memstore:beta-rclone-org + rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' --include version.txt build/ memstore:beta-rclone-org @echo Beta release ready at $(BETA_URL) compile_all: @@ -135,7 +135,7 @@ 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)β rclone --config bin/travis.rclone.conf -v copy --exclude '*beta-latest*' build/ memstore:beta-rclone-org/$(TAG) - rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' build/ memstore:beta-rclone-org + rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' --include version.txt build/ memstore:beta-rclone-org @echo Beta release ready at $(BETA_URL) # Fetch the windows builds from appveyor diff --git a/bin/cross-compile.go b/bin/cross-compile.go index bd8dcf954..90beff4d6 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -6,6 +6,8 @@ package main import ( "flag" + "fmt" + "io/ioutil" "log" "os" "os/exec" @@ -198,5 +200,9 @@ func main() { if err != nil { log.Fatalf("Couldn't cd into build dir: %v", err) } + err = ioutil.WriteFile("version.txt", []byte(fmt.Sprintf("rclone %s\n", version)), 0666) + if err != nil { + log.Fatalf("Couldn't write version.txt: %v", err) + } compile(version) }