line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::ACPS::Release; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: release plugin for ACPS |
4
|
|
|
|
|
|
|
our $VERSION = '0.30'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1507
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use v5.10; |
8
|
|
|
|
|
|
|
use Git::Wrapper; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::BeforeRelease'; |
11
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::Releaser'; |
12
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::AfterRelease'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use namespace::autoclean; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has legacy => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => 'Bool', |
19
|
|
|
|
|
|
|
default => 0, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub before_release |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $git = Git::Wrapper->new($self->zilla->root); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
if($self->legacy) |
29
|
|
|
|
|
|
|
{ $self->log("legacy release") } |
30
|
|
|
|
|
|
|
else |
31
|
|
|
|
|
|
|
{ $self->log("new-fangled release") } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $version = $self->zilla->version; |
34
|
|
|
|
|
|
|
foreach my $tag ($version, "dist-$version") |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
$self->log_fatal("tag $tag already exists") |
37
|
|
|
|
|
|
|
if $git->tag('-l', $tag ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub release |
42
|
|
|
|
|
|
|
{ |
43
|
|
|
|
|
|
|
my($self, $archive) = @_; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $version = $self->zilla->version; |
46
|
|
|
|
|
|
|
my $git = Git::Wrapper->new($self->zilla->root); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
if(!$self->legacy) |
49
|
|
|
|
|
|
|
{ |
50
|
|
|
|
|
|
|
$self->log("tag $version"); |
51
|
|
|
|
|
|
|
$git->tag("-m", "version $version", $version, 'release'); |
52
|
|
|
|
|
|
|
$self->log("tag dist-$version"); |
53
|
|
|
|
|
|
|
$git->tag("-m", "version $version", "dist-$version", 'master'); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
else |
56
|
|
|
|
|
|
|
{ |
57
|
|
|
|
|
|
|
$self->log("tag $version"); |
58
|
|
|
|
|
|
|
$git->tag('-m', "version $version", $version, 'master'); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub after_release |
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
my($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $git = Git::Wrapper->new($self->zilla->root); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $repo = $ENV{ACPS_RELEASE_MAIN_REPO} // 'public'; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
if(!$self->legacy) |
71
|
|
|
|
|
|
|
{ |
72
|
|
|
|
|
|
|
$self->log("update Changes"); |
73
|
|
|
|
|
|
|
if(-r 'README.pod') |
74
|
|
|
|
|
|
|
{ |
75
|
|
|
|
|
|
|
$git->commit({ message => "update Changes + README.pod" }, 'Changes', 'README.pod'); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
else |
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
$git->commit({ message => "update Changes" }, 'Changes'); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
$self->log("push"); |
82
|
|
|
|
|
|
|
$git->push($repo); |
83
|
|
|
|
|
|
|
$git->push($repo, "release"); |
84
|
|
|
|
|
|
|
$self->log("push tags"); |
85
|
|
|
|
|
|
|
$git->push($repo, "--tags"); |
86
|
|
|
|
|
|
|
$git->push($repo, "--tags", "release"); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else |
89
|
|
|
|
|
|
|
{ |
90
|
|
|
|
|
|
|
$self->log("push"); |
91
|
|
|
|
|
|
|
$git->push($repo); |
92
|
|
|
|
|
|
|
$self->log("push tags"); |
93
|
|
|
|
|
|
|
$git->push($repo, "--tags"); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=pod |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 NAME |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Dist::Zilla::Plugin::ACPS::Release - release plugin for ACPS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 VERSION |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
version 0.30 |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 DESCRIPTION |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Plugin for Dist::Zilla release hooks for ACPS. For now this |
115
|
|
|
|
|
|
|
only checks to ensure that the current version does not |
116
|
|
|
|
|
|
|
already have a tag. If you get an error like this: |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
there is already a tag for this version: 0.1 |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
then bump the version in dist.ini and run dzil release again. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 AUTHOR |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Graham Ollis <gollis@sesda3.com> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This software is copyright (c) 2012 by NASA GSFC. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
131
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |
137
|
|
|
|
|
|
|
|