Skip to content

Commit 2469f2c

Browse files
committed
Add GitHub Actions workflows for CI and CPAN release
CI workflow: - Runs tests on push/PR across Perl 5.14 through 5.40 - Validates compatibility with the minimum supported version Release workflow: - Triggers on GitHub release publication - Builds distribution tarball and uploads to CPAN - Requires CPAN_USERNAME and CPAN_PASSWORD repository secrets https://claude.ai/code/session_018RtsaLPCF2azHAQ1a6W7vk
1 parent 5882dc9 commit 2469f2c

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
perl-version: ['5.14', '5.20', '5.26', '5.32', '5.38', '5.40']
15+
16+
name: Perl ${{ matrix.perl-version }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: shogo82148/actions-setup-perl@v1
21+
with:
22+
perl-version: ${{ matrix.perl-version }}
23+
24+
- name: Build
25+
run: |
26+
perl Makefile.PL
27+
make
28+
29+
- name: Test
30+
run: make test

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release to CPAN
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: shogo82148/actions-setup-perl@v1
14+
with:
15+
perl-version: '5.38'
16+
install-modules-with: cpanm
17+
install-modules: CPAN::Uploader
18+
19+
- name: Build and test
20+
run: |
21+
perl Makefile.PL
22+
make
23+
make test
24+
25+
- name: Build distribution
26+
run: make dist
27+
28+
- name: Upload to CPAN
29+
env:
30+
CPAN_USERNAME: ${{ secrets.CPAN_USERNAME }}
31+
CPAN_PASSWORD: ${{ secrets.CPAN_PASSWORD }}
32+
run: cpan-upload -u "$CPAN_USERNAME" -p "$CPAN_PASSWORD" Net-IPData-*.tar.gz

0 commit comments

Comments
 (0)