Automated v3.5 build #14
Workflow file for this run
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
name: Automated v3.5 build | |
on: | |
workflow_dispatch: # yamllint disable-line rule:truthy | |
jobs: | |
build_v3_5: | |
name: v3.5 Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.2" | |
coverage: "none" | |
- name: Validate Composer configuration | |
run: composer validate --no-interaction --strict | |
- name: Install dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Check PSR-4 mapping" | |
run: composer dump-autoload --no-interaction --optimize --strict-psr | |
- name: Require rector | |
run: composer require --dev rector/rector | |
- name: Get changed files | |
id: changed-files | |
uses: yumemi-inc/changed-files@v3 | |
with: | |
separator: " " | |
patterns: | | |
src/**/*.php | |
includes/**/*.php | |
tests/**/*.php | |
- name: Build v3.5 | |
run: | | |
vendor/bin/rector process --config=config/rector-35.php -- ${{ steps.changed-files.outputs.files }} | |
- name: Save changes to stash | |
run: | | |
git stash push --include-untracked -- 'src/*.php' 'includes/*.php' 'tests/*.php' | |
- name: Reset HEAD | |
run: | | |
git reset HEAD --hard | |
- name: Create branch from v3.5, push to origin | |
run: | | |
git checkout -B v3.5-auto-build-from-v4 origin/v3.5 | |
git push origin v3.5-auto-build-from-v4 | |
- name: Pop changes from stash and commit them | |
run: | | |
git stash pop | |
git add -- 'src/*.php' 'includes/*.php' 'tests/*.php' | |
git commit -m "v3.5 auto-build from v4" | |
- name: Push changes to v3.5-auto-build-from-v4 | |
run: | | |
git push origin v3.5-auto-build-from-v4 | |
- name: Create Pull Request on v3.5 | |
run: | | |
gh pr create \ | |
--base v3.5 \ | |
--head-branch v3.5-auto-build-from-v4 \ | |
--draft \ | |
--assignee lucatume \ | |
--title "v4 -> v3.5 auto-build" \ | |
--body "v3.5 automated build changes from v4" \ | |
--label "auto-build" \ | |
--label "v3.5" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |