This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
95 lines (75 loc) · 2.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
repo_name := github-issues
version := v$(shell cat Cargo.toml | grep version | cut -d '"' -f2)
artifact_osx = $(repo_name)-$(version)-osx-amd64.tar.gz
OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
test:
@cargo test
.PHONY: test
debug:
OPENSSL_INCLUDE_DIR=$(OPENSSL_INCLUDE_DIR) cargo build
.PHONY: debug
fetch:
./target/debug/github-issues fetch arnau/test \
--oauth-token $(GITHUB_TOKEN) \
--output test.csv \
--format csv
.PHONY: fetch
upload:
./target/debug/github-issues upload arnau/test \
--check \
--oauth-token $(GITHUB_TOKEN) \
--input ./test1.csv
.PHONY: upload
check:
./target/debug/github-issues check arnau/test \
--oauth-token $(GITHUB_TOKEN) \
--input ./test1.csv
.PHONY: check
build:
@cargo build --release
.PHONY: build
release: release-create release-artifacts
.PHONY: release
release-create:
github-release release --user ustwo \
--repo $(repo_name) \
--tag $(version)
.PHONY: release-create
release-artifacts: artifacts
github-release upload --user ustwo \
--repo $(repo_name) \
--tag $(version) \
--name $(artifact_osx) \
--file dist/$(artifact_osx)
.PHONY: release-artifacts
release-info:
github-release info --user ustwo --repo $(repo_name)
.PHONY: release-info
release-delete:
github-release delete --user ustwo --repo $(repo_name) --tag $(version)
.PHONY: release-delete
artifacts: dist/$(artifact_osx)
.PHONY: artifacts
dist/$(artifact_osx): build
@mkdir -p dist
@echo "Compressing"
@cp target/release/$(repo_name) dist/$(repo_name)
@cp LICENSE dist/LICENSE
@cp README.md dist/README.md
@tar -zcvf $@ -C dist/ $(repo_name) \
LICENSE \
README.md
@echo "****************************************************************"
@shasum -a 256 $@
@du -sh $@
@echo "****************************************************************"
artifacts-expand:
cd dist && \
mkdir -p temp && \
tar -zxvf $(artifact_osx) -C temp/
homebrew-create:
brew create tar --set-name $(repo_name)
homebrew-install:
brew install ustwo/tools/$(repo_name)
homebrew-flush:
rm -f /Library/Cache/Homebrew/$(repo_name)*