-
Notifications
You must be signed in to change notification settings - Fork 11
139 lines (125 loc) · 4.52 KB
/
update.yml
File metadata and controls
139 lines (125 loc) · 4.52 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Update stubs"
on:
workflow_dispatch:
pull_request:
push:
branches:
- "main"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'
jobs:
update:
name: "Update stubs"
runs-on: "ubuntu-latest"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout to commit"
if: github.event_name != 'pull_request'
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
- name: "Checkout to only read"
if: github.event_name == 'pull_request'
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.3"
- name: "Install dependencies"
run: "composer install"
working-directory: ./extractor
- name: "Checkout"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.0"
- name: "Extract stubs"
run: "./extractor/extract.php"
# repeat
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.1"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.1"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.0 8.1"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.2"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.2"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.1 8.2"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.3"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.3"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.2 8.3"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.4"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.4"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.3 8.4"
# ---
- name: "Delete checked out php-src repo"
run: "rm -rf php-src"
- name: "Checkout PHP 8.5"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
repository: "php/php-src"
path: "php-src"
ref: "PHP-8.5"
- name: "Update stubs"
run: "./extractor/extract.php --update -- 8.4 8.5"
# end repeat
- name: 'Get previous tag'
id: previous_tag
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
with:
fallback: 0.1.0
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@d079934efaf011a4cf8912d4637097fe35d32b93" # v1
with:
version: ${{ steps.previous_tag.outputs.tag }}
- name: "Commit changes"
if: github.event_name != 'pull_request'
uses: "stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0" # v6.0.1
id: "commit"
with:
commit_message: "Update stubs"
commit_user_name: "phpstan-bot"
commit_user_email: "ondrej+phpstanbot@mirtes.cz"
commit_author: "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
tagging_message: ${{ steps.semvers.outputs.patch }}
- name: "Show diff"
if: github.event_name == 'pull_request'
run: "git diff"