; --- Project details
name             = Yancy
author           = Doug Bell <preaction@cpan.org>
license          = Perl_5
copyright_holder = Doug Bell
copyright_year   = 2021

[Authority]
authority  = cpan:PREACTION
do_munging = 0

[GithubMeta]
homepage = http://preaction.me/yancy/
issues = 1
[MetaResources]
IRC                     = irc://irc.libera.chat/#mojo-yancy

; --- Module management
[@Filter]
-bundle = @Basic
; GatherDir must be configured separately
-remove = GatherDir
-remove = Readme

[Readme::Brief]
[ReadmeAnyFromPod]
location = root
filename = README.mkdn
type = markdown

[PodWeaver]
replacer = replace_with_comment
post_code_replacer = replace_with_nothing
[RewriteVersion]
[CPANFile]
[MetaJSON]
[MetaProvides::Package]
[MetaNoIndex]
directory = t
directory = xt
directory = inc
directory = share
directory = eg
directory = examples
[Git::Contributors]
; authordep Pod::Weaver::Section::Contributors
[Test::ReportPrereqs]
[Test::Compile]
skip = Yancy::Backend ; All backend modules have additional requirements

; --- Repository management
[Git::GatherDir]
include_dotfiles = 1
prune_directory = ^eg
; Exclude dotfiles in the root directory
exclude_match = ^\.[^/]+$
; Exclude generated root content, which is included by the various plugins
; Without this, we get an error about duplicate content
exclude_filename = cpanfile
exclude_filename = META.json
exclude_filename = LICENSE
exclude_filename = README
exclude_filename = README.mkdn
exclude_filename = Makefile.PL

[CopyFilesFromBuild]
; Copy generated content to the repository root so users without Dist::Zilla
; can use it
copy = cpanfile
copy = META.json
copy = LICENSE
copy = Makefile.PL

[GitHubREADME::Badge]
badges = travis
badges = coveralls

; --- Git management
[CheckChangesHasContent]
changelog = CHANGES
[Git::Check]
; Automatically commit these files during release
allow_dirty_match = README.*
allow_dirty_match = .*[.]PL
allow_dirty = cpanfile
allow_dirty = LICENSE
allow_dirty = CHANGES
allow_dirty = META.json

[Git::Commit / Commit_Dirty_Files]
; Automatically commit with release version and changelog
changelog = CHANGES
commit_msg = release v%v%n%n%c
allow_dirty_match = README.*
allow_dirty_match = .*[.]PL
allow_dirty = cpanfile
allow_dirty = LICENSE
allow_dirty = CHANGES
allow_dirty = META.json
add_files_in = .
[Git::Tag]
changelog = CHANGES
tag_message = %N v%v - %{yyyy-MM-dd}d%n%n%c ; Tag annotations show up in github release list

; NextRelease acts *during* pre-release to write $VERSION and
; timestamp to Changes and  *after* release to add a new 
; section, so to act at the right time after release, it must actually
; come after Commit_Dirty_Files but before Commit_Changes in the
; dist.ini.  It will still act during pre-release as usual

[NextRelease]
filename = CHANGES
[BumpVersionAfterRelease]

[Git::Commit / Commit_Changes]
commit_msg = incrementing version after release
allow_dirty = CHANGES
allow_dirty_match = ^bin/
allow_dirty_match = ^lib/.*\.pm$
allow_dirty_match = .*[.]PL
[Git::Push]

[Run::AfterBuild / build docker images]
run = [ "$CI" != "true" ] && docker build -f eg/docker/Dockerfile --pull --tag preaction/yancy:latest "%d"
run = [ "$CI" != "true" ] && docker build -f eg/docker/Dockerfile.pg --tag preaction/yancy:latest-pg "%d"
run = [ "$CI" != "true" ] && docker build -f eg/docker/Dockerfile.mysql --tag preaction/yancy:latest-mysql "%d"
run = [ "$CI" != "true" ] && docker build -f eg/docker/Dockerfile.sqlite --tag preaction/yancy:latest-sqlite "%d"
fatal_errors = 0

[Run::AfterRelease / release docker images]
run = docker build -f eg/docker/Dockerfile --pull --tag preaction/yancy:latest --tag preaction/yancy:v%v "%d"
run = docker build -f eg/docker/Dockerfile.pg --build-arg TAG=v%v --tag preaction/yancy:latest-pg --tag preaction/yancy:v%v-pg "%d"
run = docker build -f eg/docker/Dockerfile.mysql --build-arg TAG=v%v --tag preaction/yancy:latest-mysql --tag preaction/yancy:v%v-mysql "%d"
run = docker build -f eg/docker/Dockerfile.sqlite --build-arg TAG=v%v --tag preaction/yancy:latest-sqlite --tag preaction/yancy:v%v-sqlite "%d"
run = docker push preaction/yancy:latest
run = docker push preaction/yancy:latest-pg
run = docker push preaction/yancy:latest-mysql
run = docker push preaction/yancy:latest-sqlite
run = docker push preaction/yancy:v%v
run = docker push preaction/yancy:v%v-pg
run = docker push preaction/yancy:v%v-mysql
run = docker push preaction/yancy:v%v-sqlite

[Run::AfterRelease / deploy doc site]
run = PERL5LIB=%d/lib:$PERL5LIB MOJO_HOME=eg/doc-site ./eg/doc-site/deploy.sh

[Run::AfterRelease / clean up release dirs]
run = rm -rf %a %d

; --- Project-specific directives

[Prereqs]
; Mojolicious requires 5.16
perl = 5.016
Mojolicious = 9
Mojolicious::Plugin::OpenAPI = 2.12 ; fix the GET /api breakage
Mojolicious::Plugin::I18N = 1.6 ; Must be all-caps I18N!
Role::Tiny = 2.000001 ; Required for Mojolicious roles
Class::Method::Modifiers = 0 ; Required for around/before/after
JSON::Validator = 4.20
Sys::Hostname = 0
File::Spec::Functions = 0
FindBin = 0
Digest = 0
Scalar::Util = 0
Text::Balanced = 0
Exporter = 0

;-- Common prereqs with minimum version requirements
;Path::Tiny = 0.072 ; Fixes issues with File::Path
;List::Util = 1.29 ; First version with pair* functions
;Getopt::Long = 2.36 ; First version with GetOptionsFromArray
;Import::Base = 0.012 ; Fixed using subs in imports
;Log::Any = 1.045 ; Returns message and faster

[Prereqs / TestRequires]
Test::More = 1.001005 ; First version that allows args to subtests
File::Temp = 0.2307 ; Fixes a locking issue on BSD systems. Github #106

;Test::Deep = 0
;Test::Differences = 0
;Test::Fatal = 0