1 package Dist
::Zilla
::PluginBundle
::Author
::CCM
;
2 # ABSTRACT: A plugin bundle for distributions built by CCM
3 # KEYWORDS: dzil author bundle distribution tool
7 # In your dist.ini file:
12 You probably don't want to use this.
22 exclude_filename = LICENSE
23 exclude_filename = README.md
34 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
48 [Test::CleanNamespaces]
62 [MetaProvides::Package]
71 config_plugin = @Author::CCM
89 [MakeMaker] ; override with the "installer" attribute
92 [CheckChangesHasContent]
97 [UploadToCPAN] ; disable with the "no_upload" attribute
99 commit_msg = Release %N %v%t%n%n%c
102 release_branch = dist
103 release_message = Version %v%t
105 tag_message = Version %v%t%n%n%c
107 push_to = origin master +master:refs/heads/release +dist
108 remotes_must_exist = 0
114 * L<Dist::Zilla::PluginBundle::Author::ETHER>
121 our $VERSION = '999.999'; # VERSION
123 use Dist
::Zilla
::Util
;
125 use namespace
::autoclean
;
129 Specify the release authority
. Defaults to C
<cpan
:CCM
>.
139 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
145 Specify which installer to
use, such as
:
148 * C<MakeMaker> (default)
149 * C<MakeMaker::Custom>
157 default => sub { shift-
>payload->{installer
} || 'MakeMaker' },
162 Disable plugins that
use the network
, and prevent releasing
.
170 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
175 Do
not upload to CPAN
or git
push.
183 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
188 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
195 if ($self->no_upload) {
196 print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
199 my @copy_from_build = qw(LICENSE);
200 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
201 my @gather_exclude = (@copy_from_build, qw(README.md));
202 my @gather_prune = qw(dist.ini);
203 my @gather_noprune = qw(.travis.yml);
204 my @no_index = qw(eg share shares t xt .travis.yml);
205 my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
206 my @git_remotes = qw(github origin);
207 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
212 ['Git::NextVersion'],
214 ['ReversionOnRelease' => {prompt
=> 1}],
217 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
218 ['PruneCruft' => {except
=> [@gather_noprune]}],
219 ['PruneFiles' => {filename
=> [@gather_prune]}],
221 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
226 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
227 ['Prereqs::AuthorDeps'],
231 ['Test::CPAN::Changes'],
232 ['PodCoverageTests'],
234 ['Test::Pod::No404s'],
236 ['Test::EOL' => {finder
=> [@check_files]}],
237 ['Test::NoTabs' => {finder
=> [@check_files]}],
238 ['Test::Perl::Critic'],
239 ['Test::Portability'],
240 ['Test::CleanNamespaces'],
241 ['Test::ReportPrereqs'],
244 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
247 ['MetaNoIndex' => {directory
=> [@no_index]}],
248 ['MetaProvides::Package'],
250 ['Git::Contributors' => {order_by
=> 'commits'}],
251 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
254 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
255 ['OverridePkgVersion'],
259 ['ReadmeAnyFromPod' => 'repo readme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
260 ['ReadmeAnyFromPod' => 'dist readme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
261 ['TravisCI' => 'repo travis' => {perl_version
=> [qw(5.24 5.22 5.20 5.18 5.16 5.14)]}],
262 ['TravisCI' => 'dist travis' => {write_to
=> 'build'}],
266 $self->installer, # e.g. MakeMaker
269 ['CheckChangesHasContent'],
270 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
273 # ['ConfirmRelease'],
274 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
275 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
276 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
277 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
278 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
282 if ($self->airplane) {
283 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
285 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
286 push @plugins, 'BlockRelease';
289 push @plugins, 'ConfirmRelease';
291 $self->add_plugins(@plugins);
294 with
'Dist::Zilla::Role::PluginBundle::Easy';
295 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
296 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
298 __PACKAGE__-
>meta->make_immutable;