Skip to content

Commit

Permalink
Update script for downgrade php 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 12, 2024
1 parent fdf358e commit 454eaaa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bare_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
php_version: ['7.4', '8.0', '8.1']

steps:
- uses: shivammathur/setup-php@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Downgraded Release
on:
push:
tags:
# avoid infinite looping, skip tags that ends with ".72"
# avoid infinite looping, skip tags that ends with ".74"
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches
- '*'

Expand Down Expand Up @@ -32,16 +32,16 @@ jobs:
- run: mkdir rector-local
- run: composer require rector/rector --working-dir rector-local --ansi

# downgrade to PHP 7.2
- run: rector-local/vendor/bin/rector process bin src vendor --config build/rector-downgrade-php-72.php --ansi
# downgrade to PHP 7.4
- run: rector-local/vendor/bin/rector process bin src vendor --config build/rector-downgrade-php-74.php --ansi

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

# prefix and scope
- run: sh prefix-code.sh

# copy PHP 7.2 composer + workflows
# copy PHP 7.4 composer + workflows
- run: cp -r build/target-repository/. .

# clear the dev files
Expand All @@ -53,13 +53,13 @@ jobs:
git config user.email "[email protected]"
git config user.name "GitHub Action"
# publish to the same repository with a new tag
# see https://tomasvotruba.com/blog/how-to-release-php-81-and-72-package-in-the-same-repository/
# see https://tomasvotruba.com/blog/how-to-release-php-81-and-74-package-in-the-same-repository/
-
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"
git commit -m "release PHP 7.4 downgraded"
# force push tag, so there is only 1 version
git tag "${GITHUB_REF#refs/tags/}" --force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rector\Set\ValueObject\DowngradeLevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_72]);
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_74]);

$rectorConfig->skip([
'*/Tests/*',
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/.github/workflows/bare_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ['7.2', '7.3', '7.4', '8.0', '8.2']
php_version: ['7.4', '8.0', '8.2']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Swiss knife in pocket of every upgrade architect",
"license": "MIT",
"require": {
"php": ">=7.2"
"php": ">=7.4"
},
"bin": [
"bin/swiss-knife"
Expand Down

0 comments on commit 454eaaa

Please sign in to comment.