Skip to content

Commit

Permalink
Merge pull request #48 from catatsuy/feature_provide_version_auto
Browse files Browse the repository at this point in the history
provide the version automatically
  • Loading branch information
catatsuy authored Oct 30, 2019
2 parents 0d3216f + 13ca97e commit 6a50758
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- run: make vet
- run: make test
- run: make bin/notify_slack
- run: make release
- run: make release version=${CIRCLE_TAG}

- persist_to_workspace:
root: release/
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ bin/output: cmd/output/main.go

.PHONY: release
release:
GOOS=linux go build -o notify_slack cmd/notify_slack/main.go
GOOS=linux go build -ldflags "-X github.com/catatsuy/notify_slack/cli.Version=${version}" -o notify_slack cmd/notify_slack/main.go
tar cvzf release/notify_slack-linux-amd64.tar.gz notify_slack
GOOS=darwin go build -o notify_slack cmd/notify_slack/main.go
GOOS=darwin go build -ldflags "-X github.com/catatsuy/notify_slack/cli.Version=${version}" -o notify_slack cmd/notify_slack/main.go
tar cvzf release/notify_slack-darwin-amd64.tar.gz notify_slack
rm notify_slack

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ It will be useful if you want to use it on a container. If you use it, you don't

## Release

Version of `cli/cli.go` will be updated.

When you execute the following command and give a tag, it will be released via CircleCI.

``` sh
Expand Down
6 changes: 4 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ import (
"github.com/catatsuy/notify_slack/throttle"
)

const (
Version = "v0.4.1"
var (
Version string
)

const (
ExitCodeOK = 0
ExitCodeParseFlagError = 1
ExitCodeFail = 1
Expand Down

0 comments on commit 6a50758

Please sign in to comment.