Skip to content

Commit

Permalink
Merge pull request #1115 from metacpan/haarg/update-update-snapshot
Browse files Browse the repository at this point in the history
update update-snapshot to use GitHub app and set up cpm manually
  • Loading branch information
haarg authored Aug 10, 2023
2 parents 5535a91 + 82579b9 commit 70b85f6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
jobs:
enable-auto-merge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'metacpan-bot'
if: github.event.pull_request.user.login == 'metacpan-automation[bot]'
steps:
- uses: alexwilson/enable-github-automerge-action@1.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ github.event.pull_request.number }}
60 changes: 42 additions & 18 deletions .github/workflows/update-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,58 @@ jobs:
container:
image: perl:5.36
steps:
- uses: actions/checkout@v3
- name: install jq
run: |
apt-get update && apt-get install -y jq
- name: Generate Auth Token
id: auth-token
uses: jamestrousdale/github-app-jwt-token@0.1.4
with:
token: ${{ secrets.METACPAN_BOT_TOKEN }}
- name: Install carton
uses: perl-actions/install-with-cpm@stable
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: git-user
name: Set up git user
uses: haarg/setup-git-user@v1
with:
sudo: false
install: Carton
- name: Install deps
uses: perl-actions/install-with-cpm@stable
jwt: ${{ steps.auth-token.outputs.jwt }}
- uses: actions/checkout@v3
with:
cpanfile: cpanfile
sudo: false
args: >
--resolver metacpan
--show-build-log-on-failure
--local-lib-contained=local
token: ${{ steps.auth-token.outputs.access-token }}
- name: Set up installation local::lib
run: |
mkdir -p $RUNNER_TEMP/perl5/bin
mkdir -p $RUNNER_TEMP/perl5/lib/perl5
echo "$RUNNER_TEMP/perl5/bin" >> "$GITHUB_PATH"
echo "PERL5LIB=$RUNNER_TEMP/perl5/lib/perl5" >> "$GITHUB_ENV"
- name: Get cpm
run: |
curl -sL -o $RUNNER_TEMP/perl5/bin/cpm https://raw.githubusercontent.com/skaji/cpm/main/cpm
chmod +x $RUNNER_TEMP/perl5/bin/cpm
- name: Install Carton and Carton::Snapshot
run: >
cpm install
Carton
Carton::Snapshot
--without-test
--show-build-log-on-failure
--local-lib-contained=$RUNNER_TEMP/perl5
- name: Install deps
run: >
cpm install
--cpanfile cpanfile
--resolver metacpan
--show-build-log-on-failure
--local-lib-contained=local
- name: Maybe update cpanfile.snapshot
run: carton
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.METACPAN_BOT_TOKEN }}
token: ${{ steps.auth-token.outputs.access-token }}
commit-message: Update cpanfile.snapshot
title: Update cpanfile.snapshot
author: MetaCPAN Bot <bot@metacpan.org>
committer: MetaCPAN Bot <bot@metacpan.org>
author: ${{ steps.git-user.outputs.user-full }}
committer: ${{ steps.git-user.outputs.user-full }}
body: |
[GitHub Action Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
push-to-fork: metacpan-bot/metacpan-api
branch: update-cpanfile-snapshot

0 comments on commit 70b85f6

Please sign in to comment.