Skip to content

Commit 638ae86

Browse files
committed
Add workflows and prep for release
Add a CI GitHub workflow to test on all supported versions of Perl, and drop the old Travis config. Also add a release workflow and the Build.PL stuff to support GitHub releases. Require PGXN::API::Searcher v0.11.1 to ensure #23 and #26 stay fixed, and fix the CPAN meta merging to properly generate a v2 `MYMETA.json` file. Increment version to v0.20.0 and update the copyright year. Drop support for Perl 5.10 and 5.12. Flesh out the README a bit.
1 parent 3e6d1c9 commit 638ae86

File tree

15 files changed

+169
-40
lines changed

15 files changed

+169
-40
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 🧪 CI
2+
on:
3+
push:
4+
branches: ['*']
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [[🐧, ubuntu], [🍎, macos]] # [🪟, windows]
10+
perl: [ '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20', '5.18', '5.16', '5.14' ]
11+
name: 🧅 Perl ${{ matrix.perl }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
12+
runs-on: ${{ matrix.os[1] }}-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Setup Perl ${{ matrix.perl }}
16+
uses: shogo82148/actions-setup-perl@v1
17+
with: { perl-version: "${{ matrix.perl }}" }
18+
19+
- name: Brew CommonMark
20+
if: runner.os == 'macOS'
21+
run: |
22+
brew install cmark
23+
cpanm -v --notest --no-man-pages CommonMark --configure-args="INC=-I'$(brew --prefix)/include' LIBS=-L'$(brew --prefix)/lib -lcmark'"
24+
25+
- name: Apt CommonMark
26+
if: runner.os == 'Linux'
27+
run: |
28+
sudo apt-get install libcmark-dev
29+
cpanm -v --notest --no-man-pages CommonMark
30+
31+
- name: Install Dependencies
32+
run: cpanm -vn Module::Build && cpanm -vn --installdeps --with-recommends --with-develop .
33+
- name: Run Tests
34+
run: perl Build.PL ./Build && ./Build test

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 🚀 Release
2+
on:
3+
push:
4+
tags: [v*]
5+
jobs:
6+
release:
7+
name: Release on CPAN and GitHub
8+
runs-on: ubuntu-latest
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v4
14+
- name: Setup Perl
15+
uses: shogo82148/actions-setup-perl@v1
16+
- name: Install Release Dependencies
17+
run: cpanm -qn Module::Build CPAN::Uploader
18+
- name: Package the Release
19+
id: package
20+
run: perl Build.PL && ./Build manifest && ./Build dist && echo "tarball=$(./Build tarball_name )" >> $GITHUB_OUTPUT
21+
- name: Generate Release Changes
22+
run: ./Build latest_changes
23+
- name: Release on CPAN
24+
env:
25+
CPANUSER: ${{ secrets.CPAN_USERNAME }}
26+
CPANPASS: ${{ secrets.CPAN_PASSWORD }}
27+
run: cpan-upload --user "$CPANUSER" --password "$CPANPASS" '${{ steps.package.outputs.tarball }}'
28+
- name: Create GitHub Release
29+
id: release
30+
uses: actions/create-release@v1
31+
with:
32+
tag_name: ${{ github.ref }}
33+
release_name: Release ${{ github.ref }}
34+
body_path: latest_changes.md
35+
- name: Upload Release Asset
36+
uses: actions/upload-release-asset@v1
37+
with:
38+
upload_url: ${{ steps.release.outputs.upload_url }}
39+
asset_path: ./${{ steps.package.outputs.tarball }}
40+
asset_name: ${{ steps.package.outputs.tarball }}
41+
asset_content_type: application/gzip

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
/*META.*
77
/Build
88
/www
9-
109
.vscode/

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

Build.PL

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ my $class = Module::Build->subclass(
66
class => 'PGXN::Build',
77
code => q{
88
sub valid_licenses { { postgresql => 'PostgreSQL' } }
9+
sub ACTION_tarball_name { print shift->dist_dir . ".tar.gz\n" }
10+
sub ACTION_latest_changes {
11+
my $self = shift;
12+
(my $dv = $self->dist_version) =~ s/^v//;
13+
open my $in, '<:raw', 'Changes' or die "Cannot open Changes: $!\n";
14+
open my $out, '>:raw', 'latest_changes.md' or die "Cannot open latest_changes.md: $!\n";
15+
while (<$in>) { last if /^\Q$dv\E\b/ }
16+
print {$out} "Changes for v$dv\n";
17+
while (<$in>) {
18+
last if /^\s*$/;
19+
chomp;
20+
if (s/^\s+-/- /) {
21+
print {$out} "\n";
22+
} else {
23+
s/^\s+/ /;
24+
}
25+
print {$out} $_;
26+
}
27+
$self->add_to_cleanup('latest_changes.md');
28+
}
929
},
1030
);
1131

@@ -14,7 +34,7 @@ my $build = $class->new(
1434
license => 'postgresql',
1535
script_files => 'bin',
1636
configure_requires => { 'Module::Build' => '0.4209' },
17-
test_requires => {
37+
test_requires => {
1838
'Test::Exception' => '0.31',
1939
'Test::File' => '1.29',
2040
'Test::File::Contents' => '0.20',
@@ -42,8 +62,8 @@ my $build = $class->new(
4262
'Moose::Util::TypeConstraints' => '1.15',
4363
'MooseX::Singleton' => '0.25',
4464
'namespace::autoclean' => '0.11',
45-
'perl' => 5.010,
46-
'PGXN::API::Searcher' => '0.9.4',
65+
'perl' => 5.014,
66+
'PGXN::API::Searcher' => '0.11.1',
4767
'Plack' => '0.9977',
4868
'Plack::App::Directory' => 0,
4969
'Plack::App::File' => 0,
@@ -54,6 +74,7 @@ my $build = $class->new(
5474
'XML::LibXML' => '1.70',
5575
},
5676
meta_merge => {
77+
'meta-spec' => { version => 2 },
5778
resources => {
5879
homepage => 'http://api.pgxn.org/',
5980
bugtracker => 'http://github.com/pgxn/pgxn-api/issues/',

Changes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Revision history for Perl extension PGXN::API
22

3-
0.16.6
3+
0.20.0
44
- Removed the `Capfile` and `eg` directory. Examples for managing PGXN
55
can now be found in the pgxn/pgxn-ops GitHub repository.
66
- Switched from Text::Markdown to CommonMark for parsing and formatting
@@ -20,6 +20,7 @@ Revision history for Perl extension PGXN::API
2020
- Fix unzipping of distributions to ensure that all directories are
2121
readable and executable but not writeable by all, and that files are
2222
only readable by all (#15).
23+
- Dropped support for Perl 5.10 and 5.12.
2324

2425
0.16.5 2016-06-22T18:03:05Z
2526
- Fixed a test failure on systems with a non-English locale, thanks to

MANIFEST.SKIP

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
,v$
55
\B\.svn\b
66
\B\.git
7+
\.vscode
78

89
# Avoid Makemaker generated and utility files.
910
\bMakefile$
@@ -33,6 +34,3 @@
3334

3435
# Avoid Pod tests.
3536
t/pod.+
36-
37-
^MYMETA.yml$
38-
^MYMETA\.json$

README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,58 @@
1-
PGXN/API version 0.16.6
2-
=======================
1+
PGXN/API
2+
========
33

4-
This application provides a REST API for flexible searching of PGXN
5-
distribution metadata and documentation. It is currently in development. Watch
6-
this space and the [PGXN Blog](http://blog.pgxn.org/) as things develop!
4+
This application provides a REST API for flexible searching of PGXN distribution
5+
metadata and documentation. See [the docs](https://github.com/pgxn/pgxn-api/wiki)
6+
for details on using the API.
7+
8+
Installation
9+
------------
10+
11+
To install this module, type the following:
12+
13+
perl Build.PL
14+
./Build
15+
./Build test
16+
./Build install
17+
18+
Dependencies
19+
------------
20+
21+
PGXN-API requires Perl 5.14 and the following modules:
22+
23+
* Archive::Zip
24+
* Cwd
25+
* CommonMark
26+
* Data::Dump
27+
* Digest::SHA1
28+
* Email::MIME::Creator
29+
* Email::Sender::Simple
30+
* File::Path
31+
* File::Copy::Recursive
32+
* File::Spec
33+
* JSON
34+
* JSON::XS
35+
* List::Util
36+
* List::MoreUtils
37+
* Lucy
38+
* Moose
39+
* Moose::Util::TypeConstraints
40+
* MooseX::Singleton
41+
* namespace::autoclean
42+
* PGXN::API::Searcher
43+
* Plack
44+
* Plack::App::Directory
45+
* Plack::App::File
46+
* Plack::Middleware::JSONP
47+
* Plack::Builder
48+
* Text::Markup
49+
* URI::Template
50+
* XML::LibXML
751

852
Copyright and License
953
---------------------
1054

11-
Copyright (c) 2011-2013 David E. Wheeler.
55+
Copyright (c) 2011-2024 David E. Wheeler.
1256

1357
This module is free software; you can redistribute it and/or modify it under
1458
the [PostgreSQL License](http://www.opensource.org/licenses/postgresql).

bin/pgxn_api_server

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/local/bin/perl -w
22

3-
use 5.10.0;
3+
use v5.14;
44
use utf8;
55
use PGXN::API::Router;
66
use Plack::Runner;
@@ -233,7 +233,7 @@ David E. Wheeler <[email protected]>
233233
234234
=head1 Copyright and License
235235
236-
Copyright (c) 2011-2013 David E. Wheeler.
236+
Copyright (c) 2011-2024 David E. Wheeler.
237237
238238
This module is free software; you can redistribute it and/or modify it under
239239
the L<PostgreSQL License|http://www.opensource.org/licenses/postgresql>.

bin/pgxn_api_sync

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/local/bin/perl -w
22

3-
use 5.10.0;
3+
use v5.14;
44
use utf8;
55
use PGXN::API::Sync;
66
use Getopt::Long;
@@ -87,7 +87,7 @@ David E. Wheeler <[email protected]>
8787
8888
=head1 Copyright and License
8989
90-
Copyright (c) 2011-2013 David E. Wheeler.
90+
Copyright (c) 2011-2024 David E. Wheeler.
9191
9292
This module is free software; you can redistribute it and/or modify it under
9393
the L<PostgreSQL License|http://www.opensource.org/licenses/postgresql>.

0 commit comments

Comments
 (0)