/
YANICK.pm
269 lines (209 loc) · 6.15 KB
/
YANICK.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
package Dist::Zilla::PluginBundle::YANICK;
# ABSTRACT: Be like Yanick when you build your dists
=head1 DESCRIPTION
This is the plugin bundle that Yanick uses to release
his distributions. It's roughly equivalent to
[ContributorsFromGit]
[ContributorsFile]
[Test::Compile]
[CoalescePod]
[ModuleBuild]
[InstallGuide]
[Covenant]
[GithubMeta]
remote=github
[Homepage]
[Bugtracker]
[MetaYAML]
[MetaJSON]
[PodWeaver]
[License]
[HelpWanted]
[ReadmeFromPod]
[ReadmeMarkdownFromPod]
[CoderwallEndorse]
users = yanick:Yanick
[NextRelease]
time_zone = America/Montreal
[MetaProvides::Package]
[MatchManifest]
[ManifestSkip]
[GatherDir]
[ExecDir]
[PkgVersion]
[Authority]
[ReportVersions::Tiny]
[Signature]
[AutoPrereqs]
[CheckChangesHasContent]
[TestRelease]
[ConfirmRelease]
[Git::Check]
[Git::Commit]
[Git::CommitBuild]
release_branch = releases
[Git::Tag]
tag_format = v%v
branch = releases
[UploadToCPAN]
[Git::Push]
push_to = github
[PreviousVersion::Changelog]
[NextVersion::Semantic]
[InstallRelease]
install_command = cpanm .
[Twitter]
[SchwartzRatio]
[ChangeStats::Git]
group=STATISTICS
[RunExtraTests]
[Test::UnusedVars]
=head2 ARGUMENTS
=head3 autoprereqs_skip
Passed as C<skip> to AutoPrereqs.
=head3 authority
Passed to L<Dist::Zilla::Plugin::Authority>.
=head3 fake_release
If given a true value, uses L<Dist::Zilla::Plugin::FakeRelease>
instead of
L<Dist::Zilla::Plugin::Git::Push>,
L<Dist::Zilla::Plugin::UploadToCPAN>,
L<Dist::Zilla::Plugin::InstallRelease> and
L<Dist::Zilla::Plugin::Twitter>.
=head3 mb_class
Passed to C<ModuleBuild> plugin.
=head3 include_dotfiles
For C<GatherDir>. Defaults to false.
=cut
use strict;
use Moose;
use Dist::Zilla::Plugin::ContributorsFile;
use Dist::Zilla::Plugin::ContributorsFromGit;
use Dist::Zilla::Plugin::ModuleBuild;
use Dist::Zilla::Plugin::GithubMeta;
use Dist::Zilla::Plugin::Homepage;
use Dist::Zilla::Plugin::Bugtracker;
use Dist::Zilla::Plugin::MetaYAML;
use Dist::Zilla::Plugin::MetaJSON;
use Dist::Zilla::Plugin::PodWeaver;
use Dist::Zilla::Plugin::License;
use Dist::Zilla::Plugin::ReadmeFromPod;
use Dist::Zilla::Plugin::NextRelease;
use Dist::Zilla::Plugin::MetaProvides::Package;
use Dist::Zilla::Plugin::InstallRelease;
use Dist::Zilla::Plugin::InstallGuide 1.200000;
use Dist::Zilla::Plugin::Twitter 0.019;
use Dist::Zilla::Plugin::Signature;
use Dist::Zilla::Plugin::Git;
use Dist::Zilla::Plugin::CoalescePod;
use Dist::Zilla::Plugin::Test::Compile;
use Dist::Zilla::Plugin::Covenant;
use Dist::Zilla::Plugin::SchwartzRatio;
use Dist::Zilla::Plugin::PreviousVersion::Changelog;
use Dist::Zilla::Plugin::ChangeStats::Git;
use Dist::Zilla::Plugin::Test::UnusedVars;
use Dist::Zilla::Plugin::RunExtraTests;
use Dist::Zilla::Plugin::HelpWanted;
use Dist::Zilla::Plugin::CoderwallEndorse;
with 'Dist::Zilla::Role::PluginBundle::Easy';
sub configure {
my ( $self ) = @_;
my $arg = $self->payload;
my $release_branch = 'releases';
my $upstream = 'github';
my %mb_args;
$mb_args{mb_class} = $arg->{mb_class} if $arg->{mb_class};
$self->add_plugins([ 'ModuleBuild', \%mb_args ]);
$self->add_plugins(
qw/
ContributorsFromGit
ContributorsFile
Test::Compile
CoalescePod
InstallGuide
Covenant
/,
[ GithubMeta => { remote => $upstream, } ],
qw/ Homepage Bugtracker MetaYAML MetaJSON PodWeaver License
ReadmeFromPod
ReadmeMarkdownFromPod
/,
[ CoderwallEndorse => { users => 'yanick:Yanick' } ],
[ NextRelease => {
time_zone => 'America/Montreal',
format => '%-9v %{yyyy-MM-dd}d',
} ],
'MetaProvides::Package',
qw/ MatchManifest
ManifestSkip /,
[ GatherDir => {
include_dotfiles => $arg->{include_dotfiles},
} ],
qw/ ExecDir
PkgVersion /,
[ Authority => {
( authority => $arg->{authority} ) x !!$arg->{authority}
} ],
qw/ ReportVersions::Tiny
Signature /,
[ AutoPrereqs => {
( skip => $arg->{autoprereqs_skip} )
x !!$arg->{autoprereqs_skip}
}
],
qw/ CheckChangesHasContent
TestRelease
ConfirmRelease
Git::Check
/,
[ 'Git::CommitBuild' => { release_branch => $release_branch } ],
[ 'Git::Tag' => { tag_format => 'v%v', branch => $release_branch } ],
);
# Git::Commit can't be before Git::CommitBuild :-/
$self->add_plugins(qw/
Git::Commit
/);
if ( $arg->{fake_release} ) {
$self->add_plugins( 'FakeRelease' );
}
else {
$self->add_plugins(
[ 'Git::Push' => { push_to => $upstream } ],
qw/
UploadToCPAN
/,
[ Twitter => {
tweet_url =>
'https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/',
tweet =>
'Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web}',
url_shortener => 'none',
} ],
[ 'InstallRelease' => { install_command => 'cpanm .' } ],
);
}
$self->add_plugins(qw/
PreviousVersion::Changelog /,
[ 'NextVersion::Semantic' => {
major => 'API CHANGES',
minor => 'NEW FEATURES, ENHANCEMENTS',
revision => 'BUG FIXES, DOCUMENTATION, STATISTICS',
} ],
qw/
SchwartzRatio
/,
[ 'ChangeStats::Git' => { group => 'STATISTICS' } ],
'Test::UnusedVars',
'RunExtraTests',
);
if ( my $help_wanted = $arg->{help_wanted} ) {
$self->add_plugins([
'HelpWanted' => {
map { $_ => 1 } split ' ', $help_wanted
},
]);
}
$self->config_slice( 'mb_class' );
return;
}
1;