Skip to content

Chore: Increase version before release (#202) #278

Chore: Increase version before release (#202)

Chore: Increase version before release (#202) #278

Workflow file for this run

name: Transpile to older versions
on:
push:
branches:
- main
workflow_dispatch:
jobs:
transpile:
name: Transpile to older versions of PHP
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies
run: composer install
- name: Transpile to ${{ matrix.version }}
run: php vendor/bin/rector process --no-diffs --no-progress-bar --config rector.$(echo ${{ matrix.version }} | sed -e 's/\.//').php src
- name: Add polyfill for 7.3
if: matrix.version == '7.2'
run: composer require symfony/polyfill-php73:^1.0
- name: Update composer.json version
run: 'sed -i -e ''s/"php": "\^8.2"/"php": "\^${{ matrix.version }}"/'' composer.json'
- name: Downgrade phpunit
if: matrix.version == '7.2'
run: 'sed -i -e ''s/"phpunit\/phpunit": "\^9.5"/"phpunit\/phpunit": "\^8.5"/'' composer.json'
- name: Copy Bootstrap
if: matrix.version == '7.2'
run: cp .github/bootstrap-72.php src
- name: Load Bootstrap
if: matrix.version == '7.2'
run: 'cat composer.json | jq --argjson files ''["src/bootstrap-72.php"]'' ''.autoload += {files: $files}'' > tmp.json && mv tmp.json composer.json'
- name: Update README
run: sed -i '1s/^/# This branch is auto generated\n/' README.md
- name: Commit PHP ${{ matrix.version }} version
uses: actions-x/commit@v6
with:
files: .
branch: php-${{ matrix.version }}
name: GitHub Actions
email: noreply@github.com
message: Transpiled to PHP ${{ matrix.version }}
force: true
trigger_tests:
name: Trigger tests
runs-on: ubuntu-latest
needs:
- transpile
strategy:
matrix:
version: [7x, 8x]
steps:
- name: Trigger ${{ matrix.version }} tests
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_TOKEN }}
event-type: trigger-${{ matrix.version }}-tests
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'