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