-
Notifications
You must be signed in to change notification settings - Fork 11
134 lines (121 loc) · 3.78 KB
/
update.yml
File metadata and controls
134 lines (121 loc) · 3.78 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
# 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: "Checkout to commit"
if: github.event_name != 'pull_request'
uses: actions/checkout@v5
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@v5
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
- name: "Install dependencies"
run: "composer install"
working-directory: ./extractor
- name: "Checkout"
uses: actions/checkout@v5
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@v5
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@v5
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@v5
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@v5
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@v5
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@v1"
with:
fallback: 0.1.0
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previous_tag.outputs.tag }}
- name: "Commit changes"
if: github.event_name != 'pull_request'
uses: "stefanzweifel/git-auto-commit-action@v6"
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"