-
-
Notifications
You must be signed in to change notification settings - Fork 85
82 lines (80 loc) · 2.82 KB
/
build-35.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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: Transpile to v3.5
run: |
vendor/bin/rector process --config=config/rector-35.php -- ${{ steps.changed-files.outputs.files }}
- name: Set up git credentials
run: |
git config --global user.name "Luca Tumedei"
git config --global user.email "luca@theaveragedev.com"
- 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: Checkout v3.5 from origin
run: |
git fetch origin
git checkout v3.5
git pull origin v3.5
- name: Remove the v3.5-auto-build-from-v4 branch from origin if it exists
run: |
git push origin --delete v3.5-auto-build-from-v4 || true
- name: Create auto-build branch from v3.5
run: |
git checkout -B v3.5-auto-build-from-v4
git push origin v3.5-auto-build-from-v4
- name: Checkout the changed files from the HEAD branch
run: |
git checkout ${{ github.sha }} -- ${{ steps.changed-files.outputs.files }}
- name: Pop changes from stash and commit them
run: |
git stash pop || true
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 --force
- name: Create Pull Request on v3.5
run: |
gh pr create \
--base v3.5 \
--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.V35_BUILD_TOKEN }}