diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 54193e1..f0d730f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,5 +1,5 @@ # brian's standard GitHub Actions Ubuntu config for Perl 5 modules -# version 20230503.001 +# version 20230718.001 # https://github.com/briandfoy/github_workflows # https://github.com/features/actions # This file is licensed under the Artistic License 2.0 @@ -56,6 +56,7 @@ jobs: - '5.30' - '5.32' - '5.34' + - '5.36' - 'latest' container: image: perl:${{ matrix.perl-version }} @@ -86,7 +87,11 @@ jobs: # but that's not a big deal. - name: Install dependencies run: | - cpanm --notest -installdeps . + cpanm --notest --installdeps --with-suggests --with-recommends . + - name: Show cpanm failures + if: ${{ failure() }} + run: | + cat /home/runner/.cpanm/work/*/build.log - name: Run tests run: | perl Makefile.PL diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21004dc..dfbc0b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,14 @@ # brian's standard GitHub Actions release config for Perl 5 modules -# version 20220827.002 +# version 20230604.001 # https://github.com/briandfoy/github_workflows # https://github.com/features/actions # This file is licensed under the Artistic License 2.0 # +# This action builds a Perl distribution and adds it as a release +# on GitHub. This does not upload to PAUSE, but that wouldn't be +# that hard, but that doesn't fit with my workflow since this part +# happens after everything else has succeeded. +# # 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 @@ -14,12 +19,25 @@ permissions: on: push: +# tag a release commit with "release-....". This workflow then runs +# whenever it sees that tag, and doesn't run for other commits. tags: - 'release-*' +# With workflow_dispatch, you can trigger this manually. This is +# especially handy when you want to re-run a job that failed because +# the token had expired. Update the GitHub secret and re-run on the +# same commit. workflow_dispatch: jobs: perl: +# We need a GitHub secret, so create an Environment named "release" +# * Go to Settings > Environment (repo settings, not account settings) +# * Make an environment named "release" +# * Add a secret named "RELEASE_ACTION_TOKEN" with a GitHub token with repo permissions +# If you use a different token name, update "RELEASE_ACTION_TOKEN" in the last +# step in this job. + environment: release runs-on: ${{ matrix.os }} strategy: matrix: @@ -40,25 +58,32 @@ jobs: # 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. +# +# Need HTTP::Tiny 0.055 or later. Probably don't need it at all since I'm +# not using cpan here. +# +# Test::Manifest is there because it's a thing I do. If you are writing +# modules and don't know what it is, you don't need it. - 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 + cpanm --notest IO::Socket::SSL HTTP::Tiny 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 . + cpanm --notest --installdeps --with-suggests --with-recommends . +# This makes the distribution and tests it, but assumes by the time we +# got here, everything else was already tested. - 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)" + run: | + perl -le '($name) = $ARGV[0] =~ m/(.*?).tar.gz/; print qq(name=$name)' *.tar.gz >> $GITHUB_OUTPUT id: version - name: Changes extract run: | @@ -67,11 +92,10 @@ jobs: 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 }} + name: ${{ steps.version.outputs.name }} files: "*.tar.gz" token: ${{ secrets.RELEASE_ACTION_TOKEN }}