FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github-release/Makefile at master · github-release/github-release · GitHub
github-release
github-release
Repository navigation
Code
Issues
27
(27)
Pull requests
6
(6)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
github-release
/
Makefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
95 lines (77 loc) · 2.46 KB
Breadcrumbs
github-release
/
Makefile
Copy path
File metadata and controls
95 lines (77 loc) · 2.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
SHELL
=/bin/bash -o pipefail
LAST_TAG
?=
$(
shell
git describe --abbrev=0 --tags)
USER
:= github-release
EXECUTABLE
:= github-release
#
only include the amd64 binaries, otherwise the github release will become
#
too big
UNIX_EXECUTABLES
:=
\
darwin/amd64/
$(
EXECUTABLE
)
\
freebsd/amd64/
$(
EXECUTABLE
)
\
linux/amd64/
$(
EXECUTABLE
)
WIN_EXECUTABLES
:=
\
windows/amd64/
$(
EXECUTABLE
)
.exe
COMPRESSED_EXECUTABLES=$(UNIX_EXECUTABLES:%
=%.bz2)
$(
WIN_EXECUTABLES:%.exe=%.zip
)
COMPRESSED_EXECUTABLE_TARGETS=$(COMPRESSED_EXECUTABLES:%
=bin/%)
UPLOAD_CMD
= bin/tmp/
$(
EXECUTABLE
)
upload -u
$(
USER
)
-r
$(
EXECUTABLE
)
-t
$(
LAST_TAG
)
-n
$(
subst
/,-,
$(
FILE
)
)
-f bin/
$(
FILE
)
all
:
$(
EXECUTABLE
)
#
the executable used to perform the upload, dogfooding and all...
bin/tmp/
$(
EXECUTABLE
)
:
go build -v -o
"
$@
"
#
arm
bin/linux/arm/5/
$(
EXECUTABLE
)
:
GOARM=5 GOARCH=arm GOOS=linux go build -o
"
$@
"
bin/linux/arm/7/
$(
EXECUTABLE
)
:
GOARM=7 GOARCH=arm GOOS=linux go build -o
"
$@
"
#
386
bin/darwin/386/
$(
EXECUTABLE
)
:
GOARCH=386 GOOS=darwin go build -o
"
$@
"
bin/linux/386/
$(
EXECUTABLE
)
:
GOARCH=386 GOOS=linux go build -o
"
$@
"
bin/windows/386/
$(
EXECUTABLE
)
:
GOARCH=386 GOOS=windows go build -o
"
$@
"
#
amd64
bin/freebsd/amd64/
$(
EXECUTABLE
)
:
GOARCH=amd64 GOOS=freebsd go build -o
"
$@
"
bin/darwin/amd64/
$(
EXECUTABLE
)
:
GOARCH=amd64 GOOS=darwin go build -o
"
$@
"
bin/linux/amd64/
$(
EXECUTABLE
)
:
GOARCH=amd64 GOOS=linux go build -o
"
$@
"
bin/windows/amd64/
$(
EXECUTABLE
)
.exe
:
GOARCH=amd64 GOOS=windows go build -o
"
$@
"
#
compressed artifacts, makes a huge difference (Go executable is ~9MB,
#
after compressing ~2MB)
%
.bz2
:
%
bzip2 --keep
"
$<
"
%
.zip
:
%
.exe
zip
"
$@
"
"
$<
"
#
git tag -a v$(RELEASE) -m 'release $(RELEASE)'
release
: clean
ifndef
GITHUB_TOKEN
@echo "Please set GITHUB_TOKEN in the environment to perform a release"
exit 1
endif
docker run --rm --volume $(PWD)/var/cache:/root/.cache/go-build \
--env GITHUB_TOKEN=$(GITHUB_TOKEN) \
--env DEBUG_HTTP_TRAFFIC=true \
--volume "$(PWD)":/app \
--workdir /app \
golang:latest \
./release \
"$(MAKE) bin/tmp/$(EXECUTABLE) $(COMPRESSED_EXECUTABLE_TARGETS) && \
git log --format=%B $(LAST_TAG) -1 | \
bin/tmp/$(EXECUTABLE) release -u $(USER) -r $(EXECUTABLE) \
-t $(LAST_TAG) -n $(LAST_TAG) -d - || true && \
$(foreach FILE,$(COMPRESSED_EXECUTABLES),$(UPLOAD_CMD);)"
$(
EXECUTABLE
)
:
go build -o
"
$@
"
install
:
go install
clean
:
rm go-app
||
true
rm
$(
EXECUTABLE
)
||
true
rm -rf bin/
lint
:
go vet ./...
test
:
go
test
./...
.PHONY
: clean release install
Back
|
FazBrowse Home
|
New Git URL