Skip to content
This repository was archived by the owner on Apr 30, 2020. It is now read-only.

Commit dd67bb0

Browse files
authored
Add Release Feature to Make (#2)
* MOIA-5439: Use Google API Endpoint V4
1 parent 5251036 commit dd67bb0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Makefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
SHELL := /bin/bash
22

3+
GITHUB_OWNER = moia-dev
4+
GITHUB_REPOSITORY = k8s-oidc-helper
5+
36
# The destination for binaries
47
BUILD_DIR = build
58

@@ -8,7 +11,7 @@ TARGET := $(shell echo $${PWD\#\#*/})
811
.DEFAULT_GOAL: $(TARGET)
912

1013
# These will be provided to the target
11-
VERSION :=0.9.0-rc1
14+
VERSION :=0.2.0
1215
BUILD := `git rev-parse HEAD`
1316

1417
# Use linker flags to provide version/build settings to the target
@@ -24,6 +27,14 @@ all: check compile
2427
$(TARGET): $(SRC)
2528
@go build $(LDFLAGS) -o $(TARGET)
2629

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+
2738
compile: check goxcompile
2839

2940
goxcompile: export CGO_ENABLED=0
@@ -58,4 +69,10 @@ dependencies:
5869
go get github.com/mitchellh/gox
5970
go get github.com/jstemmer/go-junit-report
6071
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

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest"
2020
)
2121

22-
const Version = "v0.1.1"
22+
const Version = "v0.2.0"
2323

2424
const oauthURL = "https://accounts.google.com/o/oauth2/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=%s&scope=openid+email+profile&approval_prompt=force&access_type=offline"
2525

0 commit comments

Comments
 (0)