diff --git a/Makefile b/Makefile index 4d5c81d92..3e13b7ff0 100644 --- a/Makefile +++ b/Makefile @@ -149,8 +149,19 @@ tgz: cp build/$(MACKEREL_AGENT_NAME) $(tgz_dir)/ tar cvfz build/$(MACKEREL_AGENT_NAME)-latest.tar.gz -C build/tgz $(MACKEREL_AGENT_NAME) -release: - _tools/releng +check-release-deps: + @have_error=0; \ + for command in cpanm hub ghch gobump; do \ + if ! command -v $$command > /dev/null; then \ + have_error=1; \ + echo "\`$$command\` command is required for releasing"; \ + fi; \ + done; \ + test $$have_error = 0 + +release: check-release-deps + (cd _tools && cpanm -qn --installdeps .) + perl _tools/create-release-pullrequest commands_gen.go: commands.go go get github.com/motemen/go-cli/gen @@ -163,4 +174,4 @@ clean: generate: commands_gen.go -.PHONY: test build run deps clean lint crossbuild cover rpm deb tgz generate crossbuild-package crossbuild-package-kcps crossbuild-package-stage rpm-v1 rpm-v2 rpm-stage rpm-stage-v1 rpm-stage-v2 rpm-kcps-v1 rpm-kcps-v2 deb-v1 deb-v2 deb-kcps deb-kcps-v1 deb-kcps-v2 deb-stage deb-stage-v1 deb-stage-v2 +.PHONY: test build run deps clean lint crossbuild cover rpm deb tgz generate crossbuild-package crossbuild-package-kcps crossbuild-package-stage rpm-v1 rpm-v2 rpm-stage rpm-stage-v1 rpm-stage-v2 rpm-kcps-v1 rpm-kcps-v2 deb-v1 deb-v2 deb-kcps deb-kcps-v1 deb-kcps-v2 deb-stage deb-stage-v1 deb-stage-v2 release check-release-deps diff --git a/_tools/cpanfile b/_tools/cpanfile new file mode 100644 index 000000000..8b3e4b40b --- /dev/null +++ b/_tools/cpanfile @@ -0,0 +1 @@ +requires 'Mackerel::ReleaseUtils', 'v0.2.0'; diff --git a/_tools/create-release-pullrequest b/_tools/create-release-pullrequest new file mode 100644 index 000000000..8989d19d2 --- /dev/null +++ b/_tools/create-release-pullrequest @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +=head DESCRIPTION + +releng script for mackerel-agent + +=head SYNOPSIS + + % tool/create-release-pullrequest + +=head DEPENDENCY + +`git`, `hub` and `gobump` command are required. + +=cut + +use 5.014; +use warnings; + +use Mackerel::ReleaseUtils qw/create_release_pull_request/; + +create_release_pull_request 'mackerel-agent';