DEV Community

Yuki Kimoto
Yuki Kimoto

Posted on • Edited on

1

Github Action Workflows for Perl Modules - Perl Club

Github Action workflows for Perl modules.

Github Action Workflows for Perl Modules - Perl Club

Although these Github Action workflows was created for the SPVM project of Perl Club, All Perl modules can use these without any changes.

Features

  • Supports Linux Ubuntu latest, Mac latest, Windows Server latest, Windows Server 2019
  • Supports 32bit on Linux/Ubuntu
  • Supports Perl 5.8.9 on Linux/Ubuntu
  • cpanm is downloaded in the workflow.
  • Resolves CPAN module dependencies.
  • ExtUtils::MakeMaker and make are used.
  • Each workflow is portable in all versions of Perl, Linux, Mac, Windows except for setting environment variables

Download by Command

This Github Action workflows can be downloaded using commands.

mkdir -p .github/workflows

# linux-ubuntu-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest.yml > .github/workflows/linux-ubuntu-latest.yml

# linux-ubuntu-latest-32bit
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest-32bit.yml > .github/workflows/linux-ubuntu-latest-32bit.yml

# linux-ubuntu-latest-perl-5.8.9
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/linux-ubuntu-latest-perl-5.8.9.yml > .github/workflows/linux-ubuntu-latest-perl-5.8.9.yml

# macos-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/macos-latest.yml > .github/workflows/macos-latest.yml

# windows-latest
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/windows-latest.yml > .github/workflows/windows-latest.yml

# windows-2019
curl https://raw.githubusercontent.com/yuki-kimoto/SPVM/master/.github/workflows/windows-2019.yml > .github/workflows/windows-2019.yml

# Show Github Action workflows
ls -l .github/workflows
Enter fullscreen mode Exit fullscreen mode

Makefile.PL Example

An example of Makefile.PL. This is Makefile.PL that is generated by the spvmdist command.

use 5.008_007;
use ExtUtils::MakeMaker;
use strict;
use warnings;
use Config;
use Getopt::Long 'GetOptions';

GetOptions(
  'meta' => \my $meta,
);

unless ($meta) {
  # Do something such as environment check.
}

WriteMakefile(
  NAME              => 'Foo',
  VERSION_FROM      => 'lib/Foo.pm',
  LICENSE           => 'perl_5',
  ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
    (ABSTRACT_FROM  => 'lib/Foo.pm',
     AUTHOR         => 'USER_NAME<USER_MAIL>') : ()),
  test => {TESTS => 't/*.t t/*/*.t t/*/*/*.t'},
  clean => {FILES => []},
  META_MERGE => {
    'meta-spec' => { version => 2 },
    resources => {
      repository => {
        type => 'git',
        url  => '',
        web  => '',
      },
    },
    no_index => {
      directory => [],
    }
  },
  NORECURS => 1,
  CONFIGURE_REQUIRES => {
  },
  PREREQ_PM         => {
  },
  TEST_REQUIRES => {

  },
);

1;
Enter fullscreen mode Exit fullscreen mode

How to use this with Module::Build

Please replace ExtUtils::MakeMaker with Module::Build in the workflows.

And replace build process with the following command.

perl Build.PL
./Build
./Build disttest
Enter fullscreen mode Exit fullscreen mode

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay