License Perl CI MetaCPAN package CPAN version CPAN testers

NAME

App::prepare4release - prepare a Perl distribution for release (skeleton)

SYNOPSIS

use App::prepare4release;
App::prepare4release->run(@ARGV);

DESCRIPTION

Run from the distribution root (where prepare4release.json and Makefile.PL live). The tool:

README badge injector (maint/inject-readme-badges.pl)

The MY::postamble fragment cannot hold large, self-contained Perl _sub_s: ExtUtils::MakeMaker expects that section to expand into Makefile rules, and keeping badge logic only in Makefile.PL would either duplicate a lot of text or imply loading this distribution at make README.md time. Instead, prepare4release writes maint/inject-readme-badges.pl, a small, generated program (core modules only) that strips prior shield lines and inserts the frozen Markdown block computed on the last run (same flags as --github / --gitlab / --cpan). Downstream distributions should commit that file with the rest of the tree so make README.md works in a clean clone and the file is included in the CPAN tarball like any other tracked asset. Re-run prepare4release after changing repository URLs, license, or badge-related options so the script and README.md stay consistent. No runtime dependency on App::prepare4release is added to the target module.

CONFIGURATION FILE

File name: prepare4release.json (in the distribution root).

An empty file or whitespace-only file is treated as an empty JSON object {}.

Continuous integration

When --github is set, if .github/workflows/ci.yml does not exist it is created. It runs prove -lr t on an Ubuntu runner using https://github.com/shogo82148/actions-setup-perl|shogo82148/actions-setup-perl, with a matrix of stable Perl releases from the stricter of Makefile.PL MIN_PERL_VERSION and the main module's use v5... / use 5... line, up to the latest stable Perl.

The ceiling is resolved at each run via the MetaCPAN FastAPI GET /v1/release/perl (latest perl distribution release). The previous release/_search sort=version:desc query could return ancient tarballs because Elasticsearch sort is not Perl version order. If the request fails, a fallback (currently 5.40) is used. Override for tests or air-gapped use:

PREPARE4RELEASE_PERL_MAX=5.40 prepare4release ...

Matrix entries use even minor versions only (5.10, 5.12, …) between the computed minimum and maximum.

When --gitlab is set, if .gitlab-ci.yml is missing it is created with a parallel.matrix over PERL_VERSION and the official perl Docker image.

Existing workflow files are never overwritten.

System dependencies (apt)

There is no robust automatic mapping from CPAN modules to Debian packages. The tool scans Makefile.PL, cpanfile, and Build.PL for Alien::... names and, with --verbose, warns so you can add ci.apt_packages manually.

ENVIRONMENT

COPYRIGHT AND LICENSE

Copyright (C) by the authors.

Same terms as Perl 5 itself.