Skip to content

Commit e489f85

Browse files
committed
Update workflows
1 parent cccd601 commit e489f85

File tree

3 files changed

+65
-27
lines changed

3 files changed

+65
-27
lines changed

.github/workflows/linux.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# brian's standard GitHub Actions Ubuntu config for Perl 5 modules
2-
# version 20220902.001
2+
# version 20230718.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
@@ -52,6 +52,7 @@ jobs:
5252
- '5.30'
5353
- '5.32'
5454
- '5.34'
55+
- '5.36'
5556
- 'latest'
5657
container:
5758
image: perl:${{ matrix.perl-version }}
@@ -76,14 +77,17 @@ jobs:
7677
- name: Install cpanm and multiple modules
7778
run: |
7879
curl -L https://cpanmin.us | perl - App::cpanminus
79-
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny
80-
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker Test::Manifest
80+
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny ExtUtils::MakeMaker Test::Manifest Test::More
8181
# Install the dependencies, again not testing them. This installs the
8282
# module in the current directory, so we end up installing the module,
8383
# but that's not a big deal.
8484
- name: Install dependencies
8585
run: |
86-
cpan -M https://www.cpan.org -T .
86+
cpanm --notest --installdeps --with-suggests --with-recommends .
87+
- name: Show cpanm failures
88+
if: ${{ failure() }}
89+
run: |
90+
cat /home/runner/.cpanm/work/*/build.log
8791
- name: Run tests
8892
run: |
8993
perl Makefile.PL
@@ -92,7 +96,7 @@ jobs:
9296
- name: Author tests
9397
if: hashFiles('xt') != ''
9498
run: |
95-
cpan -M https://www.cpan.org -T Test::CPAN::Changes
99+
cpanm --notest Test::CPAN::Changes
96100
prove -r -b xt
97101
# Running tests in parallel should be faster, but it's also more
98102
# tricky in cases where different tests share a feature, such as a
@@ -113,13 +117,14 @@ jobs:
113117
perl Makefile.PL
114118
make disttest
115119
make clean
116-
# And, coverage reports, but only under 5.10 and later since modern
117-
# Devel::Cover instances don't work with 5.8
120+
# And, coverage reports, but only under 5.12 and later since modern
121+
# Devel::Cover instances don't work with earlier versions as of
122+
# Devel::Cover 1.39
118123
- name: Run coverage tests
119-
if: env.PERL_VERSION != 'v5.8'
124+
if: env.PERL_VERSION != 'v5.8' && env.PERL_VERSION != 'v5.10'
120125
env:
121126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122127
run: |
123-
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
128+
cpanm --notest Devel::Cover Devel::Cover::Report::Coveralls
124129
perl Makefile.PL
125130
cover -test -report coveralls

.github/workflows/release.yml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
# brian's standard GitHub Actions release config for Perl 5 modules
2-
# version 20220827.002
2+
# version 20230604.001
33
# https://github.com/briandfoy/github_workflows
44
# https://github.com/features/actions
55
# This file is licensed under the Artistic License 2.0
6+
#
7+
# This action builds a Perl distribution and adds it as a release
8+
# on GitHub. This does not upload to PAUSE, but that wouldn't be
9+
# that hard, but that doesn't fit with my workflow since this part
10+
# happens after everything else has succeeded.
11+
#
12+
# This requires that you configure a repository secret named
13+
# RELEASE_ACTION_TOKEN with a GitHub Personal Access Token
14+
# that has "read and write" permissions on Repository/Contents
615
name: release
716

17+
permissions:
18+
contents: write
19+
820
on:
921
push:
22+
# tag a release commit with "release-....". This workflow then runs
23+
# whenever it sees that tag, and doesn't run for other commits.
1024
tags:
1125
- 'release-*'
26+
# With workflow_dispatch, you can trigger this manually. This is
27+
# especially handy when you want to re-run a job that failed because
28+
# the token had expired. Update the GitHub secret and re-run on the
29+
# same commit.
30+
workflow_dispatch:
31+
1232
jobs:
1333
perl:
34+
# We need a GitHub secret, so create an Environment named "release"
35+
# * Go to Settings > Environment (repo settings, not account settings)
36+
# * Make an environment named "release"
37+
# * Add a secret named "RELEASE_ACTION_TOKEN" with a GitHub token with repo permissions
38+
# If you use a different token name, update "RELEASE_ACTION_TOKEN" in the last
39+
# step in this job.
40+
environment: release
1441
runs-on: ${{ matrix.os }}
1542
strategy:
1643
matrix:
@@ -31,39 +58,44 @@ jobs:
3158
# cpanm first, which is easy. I can install IO::Socket::SSL with that,
3259
# then switch back to cpan. I didn't explore this further, but what you
3360
# see here hasn't caused problems for me.
34-
# Need HTTP::Tiny 0.055 or later.
61+
#
62+
# Need HTTP::Tiny 0.055 or later. Probably don't need it at all since I'm
63+
# not using cpan here.
64+
#
65+
# Test::Manifest is there because it's a thing I do. If you are writing
66+
# modules and don't know what it is, you don't need it.
3567
- name: Install cpanm and multiple modules
3668
run: |
3769
curl -L https://cpanmin.us | perl - App::cpanminus
38-
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny
39-
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker Test::Manifest
70+
cpanm --notest IO::Socket::SSL HTTP::Tiny ExtUtils::MakeMaker Test::Manifest
4071
# Install the dependencies, again not testing them. This installs the
4172
# module in the current directory, so we end up installing the module,
4273
# but that's not a big deal.
4374
- name: Install dependencies
4475
run: |
45-
cpan -M https://www.cpan.org -T .
76+
cpanm --notest --installdeps --with-suggests --with-recommends .
77+
# This makes the distribution and tests it, but assumes by the time we
78+
# got here, everything else was already tested.
4679
- name: Create distro
4780
run: |
4881
perl Makefile.PL
4982
make disttest
5083
make dist 2>/dev/null | grep Created | awk '{ print "ASSET_NAME=" $2 }' >> $GITHUB_ENV
5184
- name: version
52-
run: echo "::set-output name=version::$(perl -le 'print $ARGV[0] =~ m/(.*?).tar.gz/' *.tar.gz)"
85+
run: |
86+
perl -le '($name) = $ARGV[0] =~ m/(.*?).tar.gz/; print qq(name=$name)' *.tar.gz >> $GITHUB_OUTPUT
5387
id: version
54-
- name: release
55-
uses: actions/create-release@v1
56-
id: create_release
57-
env:
58-
GITHUB_TOKEN: ${{ github.token }}
59-
with:
60-
draft: false
61-
prerelease: false
62-
release_name: ${{ steps.version.outputs.version }}
63-
tag_name: ${{ github.ref }}
64-
body_path: Changes
88+
- name: Changes extract
89+
run: |
90+
perl -00 -lne 'next unless /\A\d+\.\d+(_\d+)?/; print; last' Changes > Changes-latest
91+
cat Changes-latest
92+
id: extract
6593
- name: upload
6694
uses: softprops/action-gh-release@v1
67-
if: startsWith(github.ref, 'refs/tags/')
6895
with:
96+
body_path: Changes-latest
97+
draft: false
98+
prerelease: false
99+
name: ${{ steps.version.outputs.name }}
69100
files: "*.tar.gz"
101+
token: ${{ secrets.RELEASE_ACTION_TOKEN }}

.github/workflows/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- windows-2019
4545
- windows-2022
4646
steps:
47+
- run: git config --global core.autocrlf false
4748
- uses: actions/checkout@v3
4849
- name: Set up Perl
4950
run: |

0 commit comments

Comments
 (0)