Skip to content

Commit eff1170

Browse files
authored
Merge pull request #20 from dtaniwaki/update-makefile-for-release
Update Makefile for release
2 parents 2513e80 + 61d916b commit eff1170

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ go:
33
- "1.11.x"
44
- "1.12.x"
55

6+
go_import_path: github.com/pfnet-research/git-ghost
7+
68
before_install:
79
- export PATH=$GOPATH/bin:$PATH
810

Makefile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ IMAGE_PREFIX ?= dtaniwaki/
66
IMAGE_TAG ?= $(VERSION)
77
OUTDIR ?= $(PROJECTROOT)/dist
88
RELEASE_TAG ?=
9-
GITHUB_API ?=
10-
GITHUB_USER ?=
11-
GITHUB_REPO ?=
9+
GITHUB_USER := pfnet-research
10+
GITHUB_REPO := git-ghost
11+
GITHUB_REPO_URL := git@github.com:pfnet-research/git-ghost.git
1212
GITHUB_TOKEN ?=
13-
DOCKER_GITHUB_ENV_FLAGS := -e GITHUB_API=$(GITHUB_API) -e GITHUB_USER=$(GITHUB_USER) -e GITHUB_REPO=$(GITHUB_REPO) -e GITHUB_TOKEN=$(GITHUB_TOKEN)
1413

1514
LDFLAGS := -ldflags="-s -w -X \"github.com/pfnet-research/git-ghost/cmd.Version=$(VERSION)\" -X \"github.com/pfnet-research/git-ghost/cmd.Revision=$(REVISION)\" -extldflags \"-static\""
1615

@@ -58,16 +57,25 @@ build-all: build-linux build-darwin build-windows
5857
release: release-code release-assets release-image
5958

6059
.PHONY: release-code
61-
release-code: guard-RELEASE_TAG guard-GITHUB_USER guard-GITHUB_REPO guard-GITHUB_TOKEN
62-
github-release release --tag $(RELEASE_TAG)
60+
release-code: guard-RELEASE_TAG guard-RELEASE_COMMIT guard-GITHUB_USER guard-GITHUB_REPO guard-GITHUB_REPO_URL guard-GITHUB_TOKEN
61+
@GITHUB_TOKEN=$(GITHUB_TOKEN)
62+
git tag $(RELEASE_TAG) $(RELEASE_COMMIT)
63+
git push $(GITHUB_REPO_URL) $(RELEASE_TAG)
64+
github-release release \
65+
--user $(GITHUB_USER) \
66+
--repo $(GITHUB_REPO) \
67+
--tag $(RELEASE_TAG)
6368

6469
.PHONY: release-assets
65-
release-assets: guard-RELEASE_TAG guard-GITHUB_USER guard-GITHUB_REPO guard-GITHUB_TOKEN clean build-all
70+
release-assets: guard-RELEASE_TAG guard-GITHUB_REPO guard-GITHUB_USER guard-GITHUB_TOKEN clean build-all
71+
@GITHUB_TOKEN=$(GITHUB_TOKEN)
6672
for target in linux-amd64 darwin-amd64 windows-amd64.exe; do \
6773
github-release upload \
74+
--user $(GITHUB_USER) \
75+
--repo $(GITHUB_REPO) \
6876
--tag $(RELEASE_TAG) \
6977
--name git-ghost-$$target \
70-
--file $(OUTDIR)/git-ghost-\$$target; \
78+
--file $(OUTDIR)/git-ghost-$$target; \
7179
done
7280

7381
.PHONY: release-image

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This type of branch contains modifications from a specific commit in your workin
2020

2121
## Installing
2222

23+
### From Source
24+
2325
Install the binary from source: execute,
2426

2527
```bash
@@ -28,7 +30,16 @@ $ cd git-ghost
2830
$ make install
2931
```
3032

31-
The binaries of each versions are available in [Releases](/releases).
33+
### Using Homebrew
34+
35+
```bash
36+
$ brew tap pfnet-research/git-ghost
37+
$ brew install git-ghost
38+
```
39+
40+
### Releases
41+
42+
The binaries of each releases are available in [Releases](/releases).
3243

3344
## Getting Started
3445

0 commit comments

Comments
 (0)