1
1
SHELL := /bin/bash
2
2
3
+ GITHUB_OWNER = moia-dev
4
+ GITHUB_REPOSITORY = k8s-oidc-helper
5
+
3
6
# The destination for binaries
4
7
BUILD_DIR = build
5
8
@@ -8,7 +11,7 @@ TARGET := $(shell echo $${PWD\#\#*/})
8
11
.DEFAULT_GOAL : $(TARGET )
9
12
10
13
# These will be provided to the target
11
- VERSION :=0.9.0-rc1
14
+ VERSION :=0.2.0
12
15
BUILD := ` git rev-parse HEAD `
13
16
14
17
# Use linker flags to provide version/build settings to the target
@@ -24,6 +27,14 @@ all: check compile
24
27
$(TARGET ) : $(SRC )
25
28
@go build $(LDFLAGS ) -o $(TARGET )
26
29
30
+ .PHONY : release
31
+ release : guard-VERSION guard-GITHUB_TOKEN compile
32
+ github-release info --user $(GITHUB_OWNER ) --repo $(GITHUB_REPOSITORY )
33
+ github-release release --user $(GITHUB_OWNER ) --repo $(GITHUB_REPOSITORY ) --tag v$(VERSION ) --name v$(VERSION )
34
+ for f in build/linux/* ; do github-release upload --user $( GITHUB_OWNER) --repo $( GITHUB_REPOSITORY) --tag v$( VERSION) --name linux/` basename $$ {f}` --file $$ {f}; done
35
+ for f in build/darwin/* ; do github-release upload --user $( GITHUB_OWNER) --repo $( GITHUB_REPOSITORY) --tag v$( VERSION) --name darwin/` basename $$ {f}` --file $$ {f}; done
36
+ github-release edit --user $(GITHUB_OWNER ) --repo $(GITHUB_REPOSITORY ) --tag v$(VERSION ) --name v$(VERSION ) --description v$(VERSION )
37
+
27
38
compile : check goxcompile
28
39
29
40
goxcompile : export CGO_ENABLED=0
@@ -58,4 +69,10 @@ dependencies:
58
69
go get github.com/mitchellh/gox
59
70
go get github.com/jstemmer/go-junit-report
60
71
go get github.com/golang/lint/golint
61
- git submodule update --init --recursive
72
+ git submodule update --init --recursive
73
+
74
+ guard-% :
75
+ @ if [ " ${${* } } " = " " ]; then \
76
+ echo "Environment variable $* not set"; \
77
+ exit 1; \
78
+ fi
0 commit comments