forked from u5surf/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
40 lines (32 loc) · 1.12 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
PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]')
VERSION := $(shell grep -Eo '(v[0-9]+[\.][0-9]+[\.][0-9]+(-[a-zA-Z0-9]*)?)' version.go)
.PHONY: build docker release
build:
go fmt ./...
@mkdir -p ./bin/
CGO_ENABLED=1 go build -o ./bin/auth github.com/moov-io/auth
docker:
docker build --pull -t moov/auth:$(VERSION) -f Dockerfile .
docker tag moov/auth:$(VERSION) moov/auth:latest
.PHONY: clean
clean:
@rm -rf ./bin/
dist: clean build
ifeq ($(OS),Windows_NT)
CGO_ENABLED=1 GOOS=windows go build -o bin/auth-windows-amd64.exe github.com/moov-io/auth
else
CGO_ENABLED=1 GOOS=$(PLATFORM) go build -o bin/auth-$(PLATFORM)-amd64 github.com/moov-io/auth
endif
release: docker AUTHORS
go test ./...
git tag -f $(VERSION)
release-push:
docker push moov/auth:$(VERSION)
git push origin master
git push --tags origin $(VERSION)
# From https://github.com/genuinetools/img
.PHONY: AUTHORS
AUTHORS:
@$(file >$@,# This file lists all individuals having contributed content to the repository.)
@$(file >>$@,# For how it is generated, see `make AUTHORS`.)
@echo "$(shell git log --format='\n%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf)" >> $@