Skip to content

Commit e110cbb

Browse files
chore: update php 8.1 requirement, ci pipeline, and dependencies (#172)
* chore: update branches, PHP version, add build & deploy steps for zip file * chore: require PHP 8.1, bump dependencies, bump version
1 parent 3256ff0 commit e110cbb

File tree

7 files changed

+697
-345
lines changed

7 files changed

+697
-345
lines changed

.github/workflows/check-standards.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Check Standards
22

33
on:
44
push:
5-
branches: [development, production]
5+
branches: [dev, production]
66
tags:
77
- '*.*.*'
88
pull_request:
9-
branches: [development, production]
9+
branches: [dev, production]
1010

1111
jobs:
1212
src:
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
php: [8.0]
18+
php: [8.1]
1919
os: [ubuntu-20.04]
2020

2121
name: Source code on PHP ${{ matrix.php }}

.github/workflows/run-tests.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Tests
22

33
on:
44
push:
5-
branches: [development, production]
5+
branches: [dev, production]
66
tags:
77
- '*.*.*'
88
pull_request:
9-
branches: [development, production]
9+
branches: [dev, production]
1010

1111
jobs:
1212
tests:
@@ -16,13 +16,13 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
php: [8.0, 8.1]
19+
php: [8.1, 8.2]
2020
os: [ubuntu-20.04]
2121
wordpress: [6.1.1, latest]
2222
include:
2323
- experimental: true
2424
- experimental: false
25-
php: 8.0
25+
php: 8.1
2626
wordpress: 6.1.1
2727

2828
name: Tests - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}
@@ -81,6 +81,35 @@ jobs:
8181
token: ${{ secrets.CODECOV_TOKEN }}
8282
if: matrix.experimental == false
8383

84+
- name: Prepare Build
85+
if: startsWith(github.ref, 'refs/tags/') && matrix.experimental == false
86+
run: |
87+
export COMPOSER_MEMORY_LIMIT=-1
88+
export GITHUB_BUILD_PATH=${{github.workspace}}
89+
export GITHUB_REPO_SLUG="$(basename ${{github.workspace}})"
90+
export GITHUB_TAG="$(basename ${{github.ref}})"
91+
echo "File to be created : $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip"
92+
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
93+
chmod +x wp-cli.phar
94+
mv wp-cli.phar /usr/local/bin/wp
95+
wp package install wp-cli/dist-archive-command
96+
npm install
97+
npm run build
98+
composer install --no-dev --optimize-autoloader
99+
cd ..
100+
wp dist-archive $GITHUB_REPO_SLUG $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip
101+
cd $GITHUB_BUILD_PATH
102+
ls $GITHUB_BUILD_PATH
103+
104+
- name: Deploy
105+
if: startsWith(github.ref, 'refs/tags/') && matrix.experimental == false
106+
uses: softprops/action-gh-release@v1
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
109+
with:
110+
files:
111+
${{github.workspace}}/*.zip
112+
84113
- name: Trigger Bedrock Update
85114
if: github.ref == 'refs/heads/development' && matrix.experimental == false
86115
uses: pressbooks/composer-autoupdate-bedrock@v1

.github/workflows/update-pot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup PHP with tools
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: '8.0'
20+
php-version: '8.1'
2121
tools: composer, wp-cli/wp-cli-bundle
2222
- name: Update POT file
2323
run: wp i18n make-pot . languages/pressbooks-network-catalog.pot --domain=pressbooks-network-catalog --slug=pressbooks-network-catalog --package-name="Pressbooks Network Catalog" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-network-catalog/issues\"}"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.0"
13+
"php": "^8.1"
1414
},
1515
"require-dev": {
1616
"friendsofphp/php-cs-fixer": "^3.10",

0 commit comments

Comments
 (0)