* for version 20230626.001 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brian's standard GitHub Actions release config for Perl 5 modules | |
# version 20220827.002 | |
# https://github.com/briandfoy/github_workflows | |
# https://github.com/features/actions | |
# This file is licensed under the Artistic License 2.0 | |
# | |
# This requires that you configure a repository secret named | |
# RELEASE_ACTION_TOKEN with a GitHub Personal Access Token | |
# that has "read and write" permissions on Repository/Contents | |
name: release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- 'release-*' | |
workflow_dispatch: | |
jobs: | |
perl: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
perl-version: | |
- 'latest' | |
container: | |
image: perl:${{ matrix.perl-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
# Some older versions of Perl have trouble with hostnames in certs. I | |
# haven't figured out why. | |
- name: Setup environment | |
run: | | |
echo "PERL_LWP_SSL_VERIFY_HOSTNAME=0" >> $GITHUB_ENV | |
# I had some problems with openssl on Ubuntu, so I punted by installing | |
# cpanm first, which is easy. I can install IO::Socket::SSL with that, | |
# then switch back to cpan. I didn't explore this further, but what you | |
# see here hasn't caused problems for me. | |
# Need HTTP::Tiny 0.055 or later. | |
- name: Install cpanm and multiple modules | |
run: | | |
curl -L https://cpanmin.us | perl - App::cpanminus | |
cpanm --notest IO::Socket::SSL App::Cpan HTTP::Tiny | |
cpan -M https://www.cpan.org -T ExtUtils::MakeMaker Test::Manifest | |
# Install the dependencies, again not testing them. This installs the | |
# module in the current directory, so we end up installing the module, | |
# but that's not a big deal. | |
- name: Install dependencies | |
run: | | |
cpan -M https://www.cpan.org -T . | |
- name: Create distro | |
run: | | |
perl Makefile.PL | |
make disttest | |
make dist 2>/dev/null | grep Created | awk '{ print "ASSET_NAME=" $2 }' >> $GITHUB_ENV | |
- name: version | |
run: echo "::set-output name=version::$(perl -le 'print $ARGV[0] =~ m/(.*?).tar.gz/' *.tar.gz)" | |
id: version | |
- name: Changes extract | |
run: | | |
perl -00 -lne 'next unless /\A\d+\.\d+(_\d+)?/; print; last' Changes > Changes-latest | |
cat Changes-latest | |
id: extract | |
- name: upload | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body_path: Changes-latest | |
draft: false | |
prerelease: false | |
name: ${{ steps.version.outputs.version }} | |
files: "*.tar.gz" | |
token: ${{ secrets.RELEASE_ACTION_TOKEN }} |