Skip to content

Commit

Permalink
Auto version.
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Dec 26, 2017
1 parent e2122a4 commit 16b09fc
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 39 deletions.
36 changes: 21 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
os:
- linux
- osx
- linux
- osx

language: go

go:
- 1.9.2
- 1.9.2

addons:
apt:
packages:
- libsecret-1-dev
- libsecret-1-dev

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -q && sudo apt-get install pkg-config -y;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -q && sudo apt-get install pkg-config -y;
fi

script:
- go test -v $(go list ./... | grep -v /vendor/) -cover
- go build -v
- if [[ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]]; then
echo "Build with version ${TRAVIS_TAG}";
go build -v -ldflags "-X github.com/mobingi/mobingi-cli/cmd.version=v${TRAVIS_TAG}";
else
echo "Start unversioned build";
go build -v;
fi

after_success:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-darwin-amd64.tar.gz;
else
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-amd64.tar.gz;
fi
- tar cvzf ${FILE_TO_UPLOAD} mobingi-cli
- ls -laF
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-darwin-amd64.tar.gz;
else
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-amd64.tar.gz;
fi
- tar cvzf ${FILE_TO_UPLOAD} mobingi-cli
- ls -laF

deploy:
provider: releases
Expand Down
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import (
"github.com/spf13/cobra"
)

var version = "local"

func VersionCmd() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "print the version",
Long: `Print the version.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("v1.0.8")
fmt.Println(version)
},
}
}
23 changes: 23 additions & 0 deletions vendor/golang.org/x/sys/unix/syscall_bsd_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions vendor/golang.org/x/sys/unix/syscall_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions vendor/golang.org/x/sys/unix/syscall_linux_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/golang.org/x/sys/unix/syscall_solaris.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/golang.org/x/sys/unix/syscall_solaris_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go

This file was deleted.

0 comments on commit 16b09fc

Please sign in to comment.