Skip to content

Commit

Permalink
(+semver: fix) Add release
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <[email protected]>
  • Loading branch information
annymsMthd committed Aug 5, 2018
1 parent f1cfba2 commit a859d28
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
language: go

go:
- "1.10.x"

- 1.10.x
go_import_path: github.com/annymsMthd/gogitver

script:
- make
- make
deploy:
provider: releases
api_key:
secure: hH15qJcgRzaxpqunFM2appy6pYeQ5Hq3pRiAppFkRF7EnBg/ErL7TvNq+JVKQubTXlx6ojBLdKK/vbz8Jk3tdwtSO1tIPgDRGgdxeOyMLFisUiJ6ZwEnXhPctnhXjyZwsoYDAQQhAJyoBmrz6nNFqEoVMus10cr9Q8xd67XlXmeXz5HuDErypkJQxCQY1gUrspGFPNnZShg6TjaSRbzhauURPht9mfNGDW9pOCluBD0CWYCMbJkLxJtAAzxinQMGFstN/1oF7yRAwrnF2piNpvQXBj0Jnov4EQ3u7CbYYThItdIQIw/q6lgkmYD9MF3n4UCTNwCnxOOX81li9IYfQlqRmX8HJTP0BglL2prttYc41lxcwKhml5NNa0eRigmJXTzd8qyVftUREGfI950u14YgqzQALlZaXULrRhA3N8R5K1eAsniCraa6m9Bje515V+k4H/u4QPiRyTHSirE/u4kDPQ+CLySLRkX6HjSS0v87MeACgDxKUfPmxxbnLUSe6qNSN+WKH7JcZ/ORqV7L0prrzMttjkZnaaUmKDCV/CleYoBATMSp6hSX2fsyldWZ3HSdfyFSTTouG3fQgLYLikt2tH5JvC7Z2GQmF7F0KhtegDNOzroFyrrFEhL8d79IBqGBapvIza9NxEFdOh1JwhCniemXK1fRGTZl8+EHArw=
file_glob: true
skip_cleanup: true
file: artifacts/*
on:
repo: annymsMthd/gogitver
tags: true
10 changes: 10 additions & 0 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ type gitVersion struct {
}

func GetCurrentVerion(path string) (version string, err error) {
tag, ok := os.LookupEnv("TRAVIS_TAG") // If this is a tagged build in travis shortcircuit here
if ok && tag != "" {
version, err := semver.NewVersion(tag)
if err != nil {
return "", err
}

return version.String(), err
}

tagMap := make(map[string]string)

r, err := git.PlainOpen(path)
Expand Down

0 comments on commit a859d28

Please sign in to comment.