Explorar o código

ci(tunasync): upload to github releases

bigeagle %!s(int64=8) %!d(string=hai) anos
pai
achega
e37bb44fa3
Modificáronse 3 ficheiros con 23 adicións e 7 borrados
  1. 4 7
      .testandcover.bash
  2. 14 0
      .travis.yml
  3. 5 0
      Makefile

+ 4 - 7
.testandcover.bash

@@ -1,6 +1,4 @@
 #!/bin/bash
-
-
 function die() {
   echo $*
   exit 1
@@ -8,7 +6,7 @@ function die() {
 
 export GOPATH=`pwd`:$GOPATH
 
-make
+make travis
 
 # Initialize profile.cov
 echo "mode: count" > profile.cov
@@ -19,10 +17,9 @@ ERROR=""
 # Test each package and append coverage profile info to profile.cov
 for pkg in `cat .testpackages.txt`
 do
-    #$HOME/gopath/bin/
-    go test -v -covermode=count -coverprofile=profile_tmp.cov $pkg || ERROR="Error testing $pkg"
-
-    [ -f profile_tmp.cov ] && {
+	go test -v -covermode=count -coverprofile=profile_tmp.cov $pkg || ERROR="Error testing $pkg"
+	
+	[ -f profile_tmp.cov ] && {
 		tail -n +2 profile_tmp.cov >> profile.cov || die "Unable to append coverage for $pkg"
 	}
 done

+ 14 - 0
.travis.yml

@@ -19,3 +19,17 @@ script:
 
 after_success:
     - goveralls -coverprofile=profile.cov -service=travis-ci
+
+before_deploy: "echo 'ready to deploy?'"
+
+deploy:
+    provider: releases
+    file:
+        - "build/tunasync-linux-bin.tar.gz"
+    api_key:
+        secure: "F9kaVaR1mxEh2+EL9Nm8GZmbVY98pXCJA0LGDNrq1C2vU61AUNOeX6yI1mMklHNZPLBqoFDvGN1M5HnJ+xWCFH+KnJgLD2GVIAcAxFNpcNWQe8XKE5heklNsIQNQfuh/rJKM6YzeDB9G5RN4Y76iL4WIAXhNnMm48W6jLnWhf70="
+    skip_cleanup: true
+    overwrite: true
+    on:
+        tags: true
+        all_branches: true

+ 5 - 0
Makefile

@@ -2,6 +2,8 @@ LDFLAGS="-X main.buildstamp=`date -u '+%s'` -X main.githash=`git rev-parse HEAD`
 
 all: get tunasync tunasynctl
 
+travis: get tunasync tunasynctl travis-package
+
 get: 
 	go get ./cmd/tunasync
 	go get ./cmd/tunasynctl
@@ -14,3 +16,6 @@ tunasync: build
 
 tunasynctl: build
 	go build -o build/tunasynctl -ldflags ${LDFLAGS} github.com/tuna/tunasync/cmd/tunasynctl
+
+travis-package: tunasync tunasynctl
+	tar zcf build/tunasync-linux-bin.tar.gz -C build tunasync tunasynctl