Skip to content
Permalink
Browse files

release.pl: add tagging of long term release

  • Loading branch information
jef-n committed Mar 1, 2015
1 parent f9c6302 commit 74ac7f0e2c62a1d74024837953f93ecee83ed24d
Showing with 10 additions and 4 deletions.
  1. +10 −4 scripts/release.pl
@@ -52,13 +52,15 @@ ($$)
my $domajor;
my $dominor;
my $dopoint;
my $doltr = 0;

my $result = GetOptions(
"major" => \$domajor,
"minor" => \$dominor,
"point" => \$dopoint,
"releasename=s" => \$newreleasename,
"help" => \$help,
"ltr" => \$doltr,
"dryrun" => \$dryrun,
);

@@ -70,6 +72,7 @@ ($$)
$i++ if defined $dopoint;
pod2usage("Exactly one of -major, -minor or -point expected") if $i!=1;
pod2usage("Release name for major and minor releases expected") if !$dopoint && !defined $newreleasename;
pod2usage("Long term releases only for major and minor releases") if $doltr && $dopoint;
pod2usage("No CMakeLists.txt in current directory") unless -r "CMakeLists.txt";

my $major;
@@ -134,6 +137,7 @@ ($$)
my $release = "$newmajor.$newminor";
my $version = "$release.$newpatch";
my $relbranch = "release-${newmajor}_${newminor}";
my $ltrtag = $doltr ? "ltr-${newmajor}_${newminor}" : "";
my $reltag = "final-${newmajor}_${newminor}_${newpatch}";

unless( $dopoint ) {
@@ -171,14 +175,15 @@ ($$)
}

run( "git commit -a -m 'Release of $release ($releasename)'", "release commit failed" );
run( "git tag $reltag -m 'Version $release'", "tag failed" );
run( "git tag $reltag -m 'Version $release'", "release tag failed" );
run( "git tag $ltrtag -m 'Long term release $release'", "ltr tag failed" ) if $doltr;
} else {
run( "git commit -a -m 'Release of $version'", "release commit failed" );
run( "git tag $reltag -m 'Version $version'", "tag failed" );
}

print "Producing archive...\n";
run( "git archive --format tar --prefix=qgis-$version/ $reltag | bzip2 -c >qgis-$version.tar.bz2", "git archive failed" );
run( "git archive --format tar --prefix=qgis-$version/ $reltag $ltrtag | bzip2 -c >qgis-$version.tar.bz2", "git archive failed" );
run( "md5sum qgis-$version.tar.bz2 >qgis-$version.tar.bz2.md5", "md5sum failed" );

unless( $dopoint ) {
@@ -193,7 +198,7 @@ ($$)
run( "git commit -a -m 'Bump version to $newmajor.$newminor'", "bump version failed" );
}

my $topush = ($dopoint ? "" : "master ") . "$relbranch $reltag";
my $topush = ($dopoint ? "" : "master ") . "$relbranch $reltag $ltrtag";

print "Push dry-run...\n";
run( "git push -n origin $topush", "push dry run failed" );
@@ -206,12 +211,13 @@ =head1 NAME
=head1 SYNOPSIS
release.pl {{-major|-minor} -releasename=releasename|-point}
release.pl {{-major|-minor} [-ltr] -releasename=releasename|-point}
Options:
-major do a new major release
-minor do a new minor release
-point do a new point release
-releasename=name new release name for master/minor release
-ltr new release is a long term release
-dryrun just echo but don't run any commands
=cut

0 comments on commit 74ac7f0

Please sign in to comment.
You can’t perform that action at this time.