-
-
Notifications
You must be signed in to change notification settings - Fork 7
67 lines (53 loc) · 2.42 KB
/
downgraded_release.yaml
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
name: Downgraded Release
on:
push:
tags:
# avoid infinite looping, skip tags that ends with ".72"
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches
- '*'
- '!**.72'
jobs:
downgrade_release:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
with:
token: ${{ secrets.ACCESS_TOKEN }}
-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.2
coverage: none
# invoke patches
- run: composer install --ansi
# but no dev packages
- run: composer update --no-dev --ansi
# get rector to "rector-local" directory, to avoid downgrading itself in the /vendor
- 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 src bin vendor --config build/rector-downgrade-php-72.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
- run: cp -r build/target-repository/. .
# clear the dev files
- run: rm -rf build prefix-code.sh full-tool-build.sh scoper.php rector.php rector-local php-scoper.phar
# setup git user
-
run: |
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/
-
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