Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. VERS_MAJOR := 0
  2. VERS_MINOR := 4
  3. VERSION := $(VERS_MAJOR).$(VERS_MINOR)
  4. NEW_MINOR := $$(( $(VERS_MINOR) + 1 ))
  5. NEW_MAJOR := $$(( $(VERS_MAJOR) + 1 ))
  6. output:
  7. output/sendmail: output
  8. go build -o output/sendmail -ldflags "-X main.version=$(VERSION)" ./...
  9. output/sendmail-dev: output
  10. go build -o output/sendmail-dev ./...
  11. clean:
  12. rm output/*
  13. build: clean output/sendmail
  14. docker-build:
  15. docker build --build-arg=version=$(VERSION) -t leophys/mailer:$(VERSION) .
  16. dev-build: clean output/sendmail-dev
  17. bumpvers-minor:
  18. sed -i"" "s/VERS_MINOR := $(VERS_MINOR)/VERS_MINOR := $(NEW_MINOR)/" Makefile
  19. git add Makefile
  20. git commit -m "Bump version $(VERSION) -> $(VERS_MAJOR).$(NEW_MINOR)"
  21. git tag $(VERS_MAJOR).$(NEW_MINOR)
  22. bumpvers-major:
  23. sed -i"" "s/VERS_MAJOR := $(VERS_MAJOR)/VERS_MAJOR := $$(( $(VERS_MAJOR) + 1 ))/" Makefile
  24. git add Makefile
  25. git commit -m "Bump version $(VERSION) -> $(NEW_MAJOR).$(VERS_MINOR)"
  26. git tag $(NEW_MAJOR).$(VERS_MINOR)
  27. release-min:
  28. make bumpvers-minor
  29. make build
  30. make docker-build
  31. release-maj:
  32. make bumpvers-major
  33. make build
  34. make docker-build
  35. PHONY: bumpvers-minor bumpvers-major release-min release-maj clean docker-build