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 @no_index = qw(eg share shares t xt);
204 my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
205 my @git_remotes = qw(github origin);
206 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
211 ['Git::NextVersion'],
213 ['ReversionOnRelease' => {prompt
=> 1}],
216 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
218 ['PruneFiles' => {filename
=> [@gather_prune]}],
220 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
225 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
226 ['Prereqs::AuthorDeps'],
230 ['Test::CPAN::Changes'],
231 ['PodCoverageTests'],
233 ['Test::Pod::No404s'],
235 ['Test::EOL' => {finder
=> [@check_files]}],
236 ['Test::NoTabs' => {finder
=> [@check_files]}],
237 ['Test::Perl::Critic'],
238 ['Test::Portability'],
239 ['Test::CleanNamespaces'],
240 ['Test::ReportPrereqs'],
243 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
246 ['MetaNoIndex' => {directory
=> [@no_index]}],
247 ['MetaProvides::Package'],
249 ['Git::Contributors' => {order_by
=> 'commits'}],
250 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
253 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
254 ['OverridePkgVersion'],
258 ['ReadmeAnyFromPod' => 'repo readme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
259 ['ReadmeAnyFromPod' => 'dist readme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
264 $self->installer, # e.g. MakeMaker
267 ['CheckChangesHasContent'],
268 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
271 # ['ConfirmRelease'],
272 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
273 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
274 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
275 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
276 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
280 if ($self->airplane) {
281 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
283 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
284 push @plugins, 'BlockRelease';
287 push @plugins, 'ConfirmRelease';
289 $self->add_plugins(@plugins);
292 with
'Dist::Zilla::Role::PluginBundle::Easy';
293 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
294 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
296 __PACKAGE__-
>meta->make_immutable;