Skip to content

Commit

Permalink
Set up CI, and some tweaks to dist.ini and maint scripts
Browse files Browse the repository at this point in the history
- Set up Github Workflow for testing and release on tag

- Add maint/setup-ci.sh script to set up CI environment

- Tweak maint/bump_fatpack.pl so it handles non-minified fatpacked modules

- Remove maint/merge_master.pl from dist.ini since it runs git
operations
  • Loading branch information
stigtsp committed Aug 2, 2024
1 parent 867ceef commit 09b614d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Main

on: push

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build deps
run: |
maint/setup-ci.sh
echo PERL5LIB=$(pwd)/local/lib/perl5 >> "$GITHUB_ENV"
echo PATH=$(pwd)/local/bin:$PATH >> "$GITHUB_ENV"
- name: Build
id: build
run: |
dzil build
echo "tarball=$(ls App-cpanminus-*.tar.gz)" >> "$GITHUB_OUTPUT"
- name: Test installing Mojolicious
run: |
./cpanm Mojolicious
env PERL5LIB=$HOME/perl5/lib/perl5 perl -MMojolicious -E 'say $Mojolicious::VERSION'
- name: Release if tag
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.build.outputs.tarball }}
cpanm
LICENSE
1 change: 0 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ run = %x maint/bump_fatpack.pl %v ; bump the version of fatpacked executable on

[Run::AfterRelease]
run = rm lib/App/cpanminus/fatscript.pm
run = %x maint/merge_master.pl
10 changes: 6 additions & 4 deletions maint/bump_fatpack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ sub find_version {
my $file = shift;

open my $fh, "<", $file or die $!;
while (<$fh>) {
/package App::cpanminus;our\$VERSION="(.*?)"/ and return $1;
}
return;
my $f = do { local undef $/; <$fh> };
close $fh;

$f=~m/package App::cpanminus;\n\s*our \$VERSION = "(.*?)"/;

return $1;
}

my $new_ver = shift @ARGV;
Expand Down
10 changes: 10 additions & 0 deletions maint/setup-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -ex -o pipefail

curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | \
perl - install \
Dist::Zilla Dist::Zilla::PluginBundle::Milla \
Dist::Zilla::Plugin::Run::BeforeBuild \
App::FatPacker \
Perl::Version

0 comments on commit 09b614d

Please sign in to comment.