-
Notifications
You must be signed in to change notification settings - Fork 237
80 lines (80 loc) · 2.61 KB
/
update-snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Update cpanfile.snapshot
on:
schedule:
- cron: '1 15 * * 0'
workflow_dispatch:
jobs:
update-dep:
runs-on: 'ubuntu-20.04'
steps:
- name: Generate Auth Token
uses: actions/create-github-app-token@v1
id: app-token
with:
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:
app: ${{ steps.app-token.outputs.app-slug }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.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: libcmark-dev
run: sudo apt-get install -y -f --no-install-recommends libcmark-dev
- name: Install cpanm, Carton, and Carton::Snapshot
run: >
cpm install
App::cpanminus
Carton
Carton::Snapshot
--without-test
--show-build-log-on-failure
--local-lib-contained=$RUNNER_TEMP/perl5
- name: Install forced deps
run: >
cpanm
--cpanfile cpanfile.forced
--showdeps --installdeps
-L local
-q
.
| cpm install
--without-test
--resolver metacpan
--show-build-log-on-failure
--local-lib-contained=local
--reinstall
-
- name: Install deps
run: >
cpm install
--cpanfile cpanfile
--resolver metacpan
--show-build-log-on-failure
--local-lib-contained=local
--with-develop
- name: Maybe update cpanfile.snapshot
run: carton
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: Update cpanfile.snapshot
title: Update cpanfile.snapshot
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 }})
branch: update-cpanfile-snapshot