Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add downgraded release down to PHP 7.2 #5

Merged
merged 1 commit into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Downgraded Release

on:
push:
tags:
- '*'

jobs:
downgrade_release:
runs-on: ubuntu-latest

steps:
- uses: "actions/checkout@v2"

-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.1
coverage: none

- uses: "ramsey/composer-install@v2"

# downgrade /src to PHP 7.2
- run: vendor/bin/rector process src --config build/rector-downgrade-php-72.php --ansi
- run: vendor/bin/ecs check src --fix --ansi

# copy PHP 7.2 composer
- run: cp build/composer-php-72.json composer.json

# clear the dev files
- run: rm -rf build .github tests ecs.php phpstan.neon phpunit.xml

# setup git user
-
run: |
git config user.email "action@github.com"
git config user.name "GitHub Action"

# publish to the same repository with a new tag
-
name: "Tag Downgraded Code"
run: |
# separate a "git add" to add untracked (new) files too
git add --all
git commit -m "release PHP 7.2 downgraded"

# force push tag, so there is only 1 version
git tag "${GITHUB_REF#refs/tags/}" --force
git push origin "${GITHUB_REF#refs/tags/}" --force
23 changes: 23 additions & 0 deletions build/composer-php-72.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "symplify/phpstan-extensions",
"type": "phpstan-extension",
"description": "Pre-escaped error messages in 'symplify' error format, container aware test case and other useful extensions for PHPStan",
"license": "MIT",
"keywords": ["static analysis", "phpstan-extension"],
"require": {
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
"Symplify\\PHPStanExtensions\\": "src"
}
},
"extra": {
"phpstan": {
"includes": [
"config/config.neon"
]
}
}
}
10 changes: 10 additions & 0 deletions build/rector-downgrade-php-72.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\DowngradeLevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_72]);
};
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.2",
"phpunit/phpunit": "^10.3",
"rector/rector": "^0.17",
"rector/rector": "^0.18",
"symfony/dependency-injection": "^6.2",
"symfony/finder": "^6.2",
"symplify/easy-ci": "11.3.1.72",
Expand Down