Skip to content

Commit

Permalink
Remove downgrade hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Apr 10, 2024
1 parent b8b7dff commit 7fa9653
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 222 deletions.
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
*.php text eol=lf

.github/ export-ignore
bin/ export-ignore
tests/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php-cs-fixer.dist.php export-ignore
src/ComposerJsonRewriter.php export-ignore
src/ComposerScripts.php export-ignore
phpunit.dist.xml export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.php export-ignore
rector-downgrade.php export-ignore
77 changes: 0 additions & 77 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
tags:
- '**'

env:
COMPOSER_ROOT_VERSION: '1.x-dev'
DEFAULT_BRANCH: '1.x'
TARGET_PHP_VERSION: '7.4'
TARGET_PHP_VERSION_ID: 70400

jobs:
build:
name: Create a release
Expand All @@ -26,74 +20,3 @@ jobs:
token: ${{ secrets.RELEASE_TOKEN }}
draft: true
prerelease: false

build_downgraded_release:
name: Build release for lower PHP version
runs-on: ubuntu-latest
needs: build
timeout-minutes: 10

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.RELEASE_TOKEN }}

- name: Get branch name
id: branch_name
run: echo "BRANCH=build-downgrade-to-${{ env.TARGET_PHP_VERSION_ID }}" >> $GITHUB_OUTPUT

- name: Install dependencies
run: composer update --ansi

- name: Downgrade src
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}

- name: Run lint on src
run: vendor/bin/parallel-lint src --colors --show-deprecated

- name: Get tag for downgraded release
id: tag-downgraded
run: echo "${{ format('DOWNGRADED_TAG={0}.{1}', github.ref_name, env.TARGET_PHP_VERSION_ID) }}" >> $GITHUB_OUTPUT

- name: Import GPG signing information
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true

- name: Commit and tag
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
commit_message: 'Release PHPStan CodeIgniter to target PHP ${{ env.TARGET_PHP_VERSION }}'
branch: ${{ steps.branch_name.outputs.BRANCH }}
tagging_message: ${{ steps.tag-downgraded.outputs.DOWNGRADED_TAG }}
commit_options: '--gpg-sign'
commit_user_name: paulbalandan
commit_user_email: paulbalandan@gmail.com
add_options: '-u'
create_branch: true

- name: Delete local and remote branches
run: |
git switch ${{ env.DEFAULT_BRANCH }}
git branch -D ${{ steps.branch_name.outputs.BRANCH }}
git push origin -d ${{ steps.branch_name.outputs.BRANCH }}
git branch -a
12 changes: 1 addition & 11 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ on:
- 'composer.json'
- 'phpunit.dist.xml'

env:
TARGET_PHP_VERSION: '7.4'
TARGET_PHP_VERSION_ID: 70400

jobs:
extension-tests:
name: PHPUnit Extension Tests [PHP ${{ matrix.php-version }}]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand Down Expand Up @@ -66,11 +62,5 @@ jobs:
- name: Install dependencies
run: composer update --ansi

- name: Downgrade src
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}

- name: Run lint on src
run: vendor/bin/parallel-lint src --colors --show-deprecated

- name: Run Extension Tests
run: vendor/bin/phpunit --no-coverage
3 changes: 0 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
$finder = Finder::create()
->files()
->in([
__DIR__ . '/bin',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->append([
__FILE__,
__DIR__ . '/bin/parse-php-version',
__DIR__ . '/bin/transform-source',
]);

$overrides = [
Expand Down
48 changes: 0 additions & 48 deletions bin/rector-downgrade.php

This file was deleted.

26 changes: 0 additions & 26 deletions bin/transform-source

This file was deleted.

8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
"require-dev": {
"codeigniter/coding-standard": "^1.7",
"codeigniter4/shield": "^1.0",
"friendsofphp/php-cs-fixer": "^3.20",
"nexusphp/cs-config": "^3.12",
"php-parallel-lint/php-parallel-lint": "^1.3",
"friendsofphp/php-cs-fixer": "^3.49",
"nexusphp/cs-config": "^3.21",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "^10.2",
"rector/rector": "^1.0.0"
"phpunit/phpunit": "^10.5"
},
"conflict": {
"codeigniter/framework": "*"
Expand Down
49 changes: 0 additions & 49 deletions src/ComposerJsonRewriter.php

This file was deleted.

0 comments on commit 7fa9653

Please sign in to comment.