Skip to content

Commit 16b09fc

Browse files
Auto version.
1 parent e2122a4 commit 16b09fc

10 files changed

+117
-39
lines changed

.travis.yml

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
os:
2-
- linux
3-
- osx
2+
- linux
3+
- osx
44

55
language: go
66

77
go:
8-
- 1.9.2
8+
- 1.9.2
99

1010
addons:
1111
apt:
1212
packages:
13-
- libsecret-1-dev
13+
- libsecret-1-dev
1414

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

2020
script:
2121
- go test -v $(go list ./... | grep -v /vendor/) -cover
22-
- go build -v
22+
- if [[ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]]; then
23+
echo "Build with version ${TRAVIS_TAG}";
24+
go build -v -ldflags "-X github.com/mobingi/mobingi-cli/cmd.version=v${TRAVIS_TAG}";
25+
else
26+
echo "Start unversioned build";
27+
go build -v;
28+
fi
2329

2430
after_success:
25-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
26-
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-darwin-amd64.tar.gz;
27-
else
28-
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-amd64.tar.gz;
29-
fi
30-
- tar cvzf ${FILE_TO_UPLOAD} mobingi-cli
31-
- ls -laF
31+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
32+
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-darwin-amd64.tar.gz;
33+
else
34+
export FILE_TO_UPLOAD=mobingi-cli-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-amd64.tar.gz;
35+
fi
36+
- tar cvzf ${FILE_TO_UPLOAD} mobingi-cli
37+
- ls -laF
3238

3339
deploy:
3440
provider: releases

Gopkg.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/version.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import (
66
"github.com/spf13/cobra"
77
)
88

9+
var version = "local"
10+
911
func VersionCmd() *cobra.Command {
1012
return &cobra.Command{
1113
Use: "version",
1214
Short: "print the version",
1315
Long: `Print the version.`,
1416
Run: func(cmd *cobra.Command, args []string) {
15-
fmt.Println("v1.0.8")
17+
fmt.Println(version)
1618
},
1719
}
1820
}

vendor/golang.org/x/sys/unix/syscall_bsd_test.go

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_freebsd.go

+3-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_linux_test.go

+33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_solaris.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_solaris_test.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go

-13
This file was deleted.

0 commit comments

Comments
 (0)