github.com/goki/ki@v1.1.11/ki/Makefile (about)

     1  # Basic Go makefile
     2  
     3  GOCMD=go
     4  GOBUILD=$(GOCMD) build
     5  GOCLEAN=$(GOCMD) clean
     6  GOTEST=$(GOCMD) test
     7  GOGET=$(GOCMD) get
     8  
     9  
    10  all: build
    11  
    12  build: 
    13  	$(GOBUILD) -v
    14  test: 
    15  	$(GOTEST) -v ./...
    16  clean: 
    17  	$(GOCLEAN)
    18  	
    19  # NOTE: MUST update version number here prior to running 'make release'
    20  VERS=v1.1.11
    21  PACKAGE=ki
    22  GIT_COMMIT=`git rev-parse --short HEAD`
    23  VERS_DATE=`date -u +%Y-%m-%d\ %H:%M`
    24  VERS_FILE=version.go
    25  
    26  release:
    27  	/bin/rm -f $(VERS_FILE)
    28  	@echo "// WARNING: auto-generated by Makefile release target -- run 'make release' to update" > $(VERS_FILE)
    29  	@echo "" >> $(VERS_FILE)
    30  	@echo "package $(PACKAGE)" >> $(VERS_FILE)
    31  	@echo "" >> $(VERS_FILE)
    32  	@echo "const (" >> $(VERS_FILE)
    33  	@echo "	Version     = \"$(VERS)\"" >> $(VERS_FILE)
    34  	@echo "	GitCommit   = \"$(GIT_COMMIT)\" // the commit JUST BEFORE the release" >> $(VERS_FILE)
    35  	@echo "	VersionDate = \"$(VERS_DATE)\" // UTC" >> $(VERS_FILE)
    36  	@echo ")" >> $(VERS_FILE)
    37  	@echo "" >> $(VERS_FILE)
    38  	goimports -w $(VERS_FILE)
    39  	/bin/cat $(VERS_FILE)
    40  	git commit -am "$(VERS) release -- $(VERS_FILE) updated"
    41  	git tag -a $(VERS) -m "$(VERS) release"
    42  	git push
    43  	git push origin --tags
    44  
    45