diff --git a/.release/copyright_year.sh b/.release/copyright_year.sh index 734070b5..ccf70ceb 100755 --- a/.release/copyright_year.sh +++ b/.release/copyright_year.sh @@ -12,5 +12,5 @@ sed -i '' \ if ! repo_is_clean; then git add . - git commit -m "bump copyright to $YEAR" + git commit -m "doc: bump copyright to $YEAR" fi diff --git a/.release/do.sh b/.release/do.sh index d7e89f51..71a67535 100755 --- a/.release/do.sh +++ b/.release/do.sh @@ -5,11 +5,8 @@ assure_changes_has_entry || exit -.release/copyright_year.sh .release/version_increment.sh -.release/readme.sh +.release/copyright_year.sh .release/update-psl.sh .release/tag.sh .release/publish-to-cpan.sh - -git checkout -- META.json META.yml diff --git a/.release/publish-to-cpan.sh b/.release/publish-to-cpan.sh index da031dfc..42cfbebf 100755 --- a/.release/publish-to-cpan.sh +++ b/.release/publish-to-cpan.sh @@ -1,6 +1,18 @@ #!/bin/sh +if [ -n "$PERL_PUBLISH_SETUP" ]; then + perl -MCPAN -e 'install Module::Build' + perl -MCPAN -e 'install Mozilla::CA' + perl -MCPAN -e 'install CPAN::Uploader' +fi + +for _f in Mail-DMARC-*; +do + echo "rm $_f" + rm $_f +done + perl Build.PL ./Build dist +./Build distclean cpan-upload Mail-DMARC-*.tar.gz -./Build distclean \ No newline at end of file diff --git a/.release/readme.sh b/.release/readme.sh deleted file mode 100755 index 0360cfd2..00000000 --- a/.release/readme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -. .release/base.sh || exit - -assure_repo_is_clean || exit - -pod2markdown lib/Mail/DMARC.pm > README.md - -if ! repo_is_clean; then - git add README.md - git commit -m "README: updated" -fi diff --git a/.release/tag.sh b/.release/tag.sh index 27c48147..5a0ebe41 100755 --- a/.release/tag.sh +++ b/.release/tag.sh @@ -10,15 +10,17 @@ echo "tag $TAGNAME" git tag "$TAGNAME" git push --tags -# create a GitHub release -# https://developer.github.com/v3/repos/releases/#create-a-release -echo "hint: your GitHub OTP password" +# GitHub CLI api +# https://cli.github.com/manual/gh_api -curl -u msimerson -X POST https://api.github.com/repos/msimerson/mail-dmarc/releases -H 'Content-Type: application/json' -d "{ - \"tag_name\": \"$TAGNAME\", - \"target_commitish\": \"master\", - \"name\": \"$TAGNAME\", - \"body\": \"Description of the release\", - \"draft\": true, - \"prerelease\": false -}" +gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/msimerson/mail-dmarc/releases \ + -f tag_name="$TAGNAME" \ + -f target_commitish='master' \ + -f name="$TAGNAME" \ + -F draft=true \ + -F prerelease=false \ + -F generate_release_notes=true diff --git a/.release/update-psl.sh b/.release/update-psl.sh index 7da0c476..d859cccc 100755 --- a/.release/update-psl.sh +++ b/.release/update-psl.sh @@ -8,5 +8,5 @@ curl -o share/public_suffix_list https://publicsuffix.org/list/effective_tld_nam if ! repo_is_clean; then git add share/public_suffix_list - git commit -m "PSL: updated" + git commit -m "chore: updated PSL" fi diff --git a/.release/version_increment.sh b/.release/version_increment.sh index ad73bde4..48e81290 100755 --- a/.release/version_increment.sh +++ b/.release/version_increment.sh @@ -6,13 +6,38 @@ assure_repo_is_clean || exit NEWVER="$(get_version)" -# shellcheck disable=SC2046 -sed -i '' \ - -e "/VERSION =/ s/= .*$/= '$NEWVER';/" \ - -e "/^version / s/.*/version $NEWVER/" \ - $(find lib -type f -name '*.pm') +update_modules() +{ + # shellcheck disable=SC2046 + sed -i '' \ + -e "/VERSION =/ s/= .*$/= '$NEWVER';/" \ + -e "/^version / s/.*/version $NEWVER/" \ + $(find lib -type f -name '*.pm') + + git add lib +} + +update_readme() +{ + pod2markdown lib/Mail/DMARC.pm README.md + git add README.md +} + +update_meta() +{ + # update the version in META.* files + perl Build.PL + ./Build distclean + git add META.* +} + +update_modules +update_readme +update_meta if ! repo_is_clean; then + git status git add . - git commit -m "increment version to $NEWVER" fi + +git commit -m "release version $NEWVER" diff --git a/bin/install_deps.pl b/bin/install_deps.pl index 6c6b9391..fada30ce 100755 --- a/bin/install_deps.pl +++ b/bin/install_deps.pl @@ -9,8 +9,8 @@ use English qw( -no_match_vars ); my $apps = [ -# { app => 'mysql-server-5', info => { port => 'mysql55-server', dport=>'mysql5', yum =>'mysql-server'} }, -# { app => 'apache22' , info => { port => 'apache22', dport=>'', yum => 'httpd' } }, +# { app => 'mysql-server-8', info => { port => 'mysql82-server', dport=>'mysql82', yum =>'mysql-server'} }, +# { app => 'apache24' , info => { port => 'apache24', dport=>'', yum => 'httpd' } }, ]; $EUID == 0 or die "You will have better luck if you run me as root.\n"; ## no critic (Carp) @@ -353,13 +353,6 @@ sub is_freebsd_port_installed { return 0; } -sub get_freebsd_pkg_info { - if ( -x '/usr/sbin/pkg_info' ) { - return '/usr/sbin/pkg_info'; - }; - return; -} - sub get_freebsd_pkgng { my $pkg = '/usr/local/sbin/pkg'; # port version is likely newest if (! -x $pkg) { $pkg = '/usr/sbin/pkg'; }; # fall back