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
44 [Test::MinimumVersion]
45 max_target_perl = 5.10.1
50 [Test::CleanNamespaces]
64 [MetaProvides::Package]
73 config_plugin = @Author::CCM
88 build_branch = /^(dist|build\/.*)$/
92 [MakeMaker] ; override with the "installer" attribute
95 [CheckChangesHasContent]
100 [UploadToCPAN] ; disable with the "no_upload" attribute
102 commit_msg = Release %N %v%t%n%n%c
105 release_branch = dist
106 release_message = Version %v%t
108 tag_message = Version %v%t%n%n%c
110 push_to = origin master +master:refs/heads/release +dist
111 remotes_must_exist = 0
117 * L<Dist::Zilla::PluginBundle::Author::ETHER>
125 our $VERSION = '999.999'; # VERSION
127 use Dist
::Zilla
::Util
;
129 use namespace
::autoclean
;
133 Specify the release authority
. Defaults to C
<cpan
:CCM
>.
143 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
149 Specify which installer to
use, such as
:
152 * C<MakeMaker> (default)
153 * C<MakeMaker::Custom>
161 default => sub { shift-
>payload->{installer
} || 'MakeMaker' },
166 Disable plugins that
use the network
, and prevent releasing
.
174 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
179 Do
not upload to CPAN
or git
push.
187 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
192 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
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);
207 my $perl_version_target = '5.10.1';
208 my $perl_version = '5.24 5.22 5.20 5.18 5.16 5.14';
209 my $perl_version_build = $perl_version . ' 5.12 5.10 -5.8';
211 if ($self->no_upload) {
212 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
218 ['Git::NextVersion'],
220 ['ReversionOnRelease' => {prompt
=> 1}],
223 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
225 ['PruneFiles' => {filename
=> [@gather_prune]}],
227 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
232 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
233 ['Prereqs::AuthorDeps'],
237 ['Test::CPAN::Changes'],
238 ['PodCoverageTests'],
240 ['Test::Pod::No404s'],
242 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
243 ['Test::EOL' => {finder
=> [@check_files]}],
244 ['Test::NoTabs' => {finder
=> [@check_files]}],
245 ['Test::Perl::Critic'],
246 ['Test::Portability'],
247 ['Test::CleanNamespaces'],
248 ['Test::ReportPrereqs'],
251 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
254 ['MetaNoIndex' => {directory
=> [@no_index]}],
255 ['MetaProvides::Package'],
257 ['Git::Contributors' => {order_by
=> 'commits'}],
258 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
261 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
262 ['OverridePkgVersion'],
266 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
267 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
268 ['TravisYML' => {build_branch
=> '/^(dist|build\/.*)$/', perl_version
=> $perl_version, perl_version_build
=> $perl_version_build}],
272 $self->installer, # e.g. MakeMaker
275 ['CheckChangesHasContent'],
276 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
279 # ['ConfirmRelease'],
280 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
281 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
282 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
283 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
284 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
288 if ($self->airplane) {
289 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
291 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
292 push @plugins, 'BlockRelease';
295 push @plugins, 'ConfirmRelease';
297 $self->add_plugins(@plugins);
300 with
'Dist::Zilla::Role::PluginBundle::Easy';
301 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
302 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
304 __PACKAGE__-
>meta->make_immutable;