update version number on Makefile in release script
@@ -24,6 +24,16 @@ use Mackerel::ReleaseUtils qw/replace create_release_pull_request/;
use JSON::PP qw/decode_json/;
use Path::Tiny qw/path/;
+sub update_makefile {
+ my ($current_version, $next_version) = @_;
+ replace 'Makefile' => sub {
+ my $content = shift;
+ my $cur_reg = '_version ' . quotemeta $current_version;
+ $content =~ s/$cur_reg/_version $next_version/g;
+ $content;
+ };
+}
+
sub retrieve_plugins {
sort map {s/^check-//; $_} <check-*>;
}
@@ -71,6 +81,7 @@ sub main {
create_release_pull_request 'mackerel-check-plugins' => sub {
my ($current_version, $next_version, $releases) = @_;
+ update_makefile $current_version, $next_version;
my @plugins = retrieve_plugins;
update_readme(@plugins);
my $config = load_packaging_confg;
