Update stubs #1273
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
name: "Update stubs" | |
on: | |
workflow_dispatch: | |
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" | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: '0' | |
token: ${{ secrets.PHPSTAN_BOT_TOKEN }} | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "8.1" | |
- name: "Install dependencies" | |
run: "composer install" | |
working-directory: ./extractor | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
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@v3 | |
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@v3 | |
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@v3 | |
with: | |
repository: "php/php-src" | |
path: "php-src" | |
ref: "master" # todo 8.3 after feature freeze | |
- name: "Update stubs" | |
run: "./extractor/extract.php --update -- 8.2 8.3" | |
# 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" | |
uses: "stefanzweifel/git-auto-commit-action@v4" | |
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 }} |