gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Makefile.release (992B)


      1 # Makefile for releasing.
      2 #
      3 # The release is controlled from version.go. The version found there is
      4 # used to tag the git repo, we're not building any artifacts so there is nothing
      5 # to upload to github.
      6 #
      7 # * Up the version in version.go
      8 # * Run: make -f Makefile.release release
      9 #   * will *commit* your change with 'Release $VERSION'
     10 #   * push to github
     11 #
     12 
     13 define GO
     14 //+build ignore
     15 
     16 package main
     17 
     18 import (
     19 	"fmt"
     20 
     21 	"github.com/miekg/dns"
     22 )
     23 
     24 func main() {
     25 	fmt.Println(dns.Version.String())
     26 }
     27 endef
     28 
     29 $(file > version_release.go,$(GO))
     30 VERSION:=$(shell go run version_release.go)
     31 TAG="v$(VERSION)"
     32 
     33 all:
     34 	@echo Use the \'release\' target to start a release $(VERSION)
     35 	rm -f version_release.go
     36 
     37 .PHONY: release
     38 release: commit push
     39 	@echo Released $(VERSION)
     40 	rm -f version_release.go
     41 
     42 .PHONY: commit
     43 commit:
     44 	@echo Committing release $(VERSION)
     45 	git commit -am"Release $(VERSION)"
     46 	git tag $(TAG)
     47 
     48 .PHONY: push
     49 push:
     50 	@echo Pushing release $(VERSION) to master
     51 	git push --tags
     52 	git push