Skip to content

Commit

Permalink
feat: Notification v9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartui committed Jul 18, 2024
1 parent de10ede commit d4c1dea
Show file tree
Hide file tree
Showing 46 changed files with 43,357 additions and 2,110 deletions.
1 change: 0 additions & 1 deletion .build-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ build
node_modules
src/assets
tests
vendor/typisttech
.build-excludes
.editorconfig
.gitattributes
Expand Down
1 change: 0 additions & 1 deletion .distignore

This file was deleted.

4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ indent_style = tab

[{*.txt,wp-config-sample.php}]
end_of_line = crlf

[*.yml]
indent_style = space
indent_size = 2
68 changes: 11 additions & 57 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,25 @@ on:
- develop

jobs:

# Builds the package and creates artifact with dist files
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout
uses: actions/checkout@v2
- name: Install OS dependencies
run: sudo apt-get install zip -y
- name: Setup variables
id: vars
run: |
echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
path: ${{ steps.vars.outputs.composer-cache-path }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
php-version: '7.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
run: composer install -o --no-dev --no-progress
uses: "ramsey/composer-install@v2"
with:
composer-options: "--no-dev"
- name: Run Strauss
run: composer run-script prefix-namespaces-prod
- name: Create build dir
run: mkdir build
- name: Copy files
Expand All @@ -44,46 +39,5 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: build
name: ${{ secrets.SLUG }}-dev
path: build

# Creates the dev package artifact from develop branch
pack:
name: Pack
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: build
path: ${{ secrets.SLUG }}
- name: Create archive
run: |
zip -rq ${{ secrets.SLUG }}-dev.zip ${{ secrets.SLUG }}
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: ${{ secrets.SLUG }}-dev
path: ${{ secrets.SLUG }}-dev.zip

# Uploads the develop package to internal repository
upload:
name: Upload to repo
runs-on: ubuntu-latest
needs: pack
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ secrets.SLUG }}-dev
path: .
- name: Upload to repo
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{ secrets.PACKAGES_DEPLOY_KEY }}
with:
flags: '-avz'
options: '--recursive '
src: '.'
dest: '${{ secrets.BRACKETSPACE_REPO_RSYNC_URL }}${{ secrets.SLUG }}/'
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout master
uses: actions/checkout@v1
with:
Expand All @@ -33,7 +31,7 @@ jobs:
run: git flow init -d
- name: Start release
run: git flow release start ${{ github.event.inputs.new_version }}
- name: Replace 3.0.0 tags with new version number
- name: Replace Next tags with new version number
uses: jacobtomlinson/gha-find-replace@master
with:
find: "(?i)\\[Next\\]"
Expand All @@ -50,6 +48,12 @@ jobs:
find: "Version: [0-9]+.[0-9]+.[0-9]+"
replace: "Version: ${{ github.event.inputs.new_version }}"
include: "${{ secrets.SLUG }}.php"
- name: Replace constant tag in Runtime file
uses: jacobtomlinson/gha-find-replace@master
with:
find: "VERSION = '[0-9]+.[0-9]+.[0-9]+'"
replace: "VERSION = '${{ github.event.inputs.new_version }}'"
include: "src/classes/Runtime.php"
- name: Commit version bump
run: git commit -am "Version bump"
- name: Finish release
Expand Down
74 changes: 10 additions & 64 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout
uses: actions/checkout@v2
- name: Install OS dependencies
run: sudo apt-get install zip -y
- name: Setup variables
id: vars
run: |
echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
path: ${{ steps.vars.outputs.composer-cache-path }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
php-version: '7.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
run: composer install -o --no-dev --no-progress
uses: "ramsey/composer-install@v2"
with:
composer-options: "--no-dev"
- name: Run Strauss
run: composer run-script prefix-namespaces-prod
- name: Create build dir
run: mkdir build
- name: Copy files
Expand Down Expand Up @@ -71,49 +67,6 @@ jobs:
name: ${{ steps.vars.outputs.package-name }}
path: ${{ steps.vars.outputs.package-name }}.zip

# Uploads the stable package to internal repository
upload:
name: Upload to repo
runs-on: ubuntu-latest
needs: pack
steps:
- name: Setup variables
id: vars
run: |
echo "::set-output name=package-name::${{ secrets.SLUG }}-${GITHUB_REF#refs/tags/}"
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ steps.vars.outputs.package-name }}
path: .
- name: Upload to repo
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{ secrets.PACKAGES_DEPLOY_KEY }}
with:
flags: '-avz'
options: '--recursive '
src: '.'
dest: '${{ secrets.BRACKETSPACE_REPO_RSYNC_URL }}${{ secrets.SLUG }}/'

# Deploys the stable tag to WordPress.org repository
wordpress-org-release:
name: Release on WordPress.org
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: build
path: .
- name: Deploy to WordPress repository
uses: 10up/[email protected]
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ${{ secrets.SLUG }}

# Release on GitHub
github-release:
name: Release on GitHub
Expand All @@ -127,12 +80,6 @@ jobs:
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
echo "::set-output name=package-name::${{ secrets.SLUG }}-${GITHUB_REF#refs/tags/}"
- name: Parse changelog
run: |
START="= ${{ steps.vars.outputs.version }} ="
END="= [0-9]+.[0-9]+.[0-9]+ =|==|\$"
grep -oPz "(?s)${START}.*?\n\K.*?(?=${END})" readme.txt > changelog.txt
truncate -s-2 changelog.txt
- name: Download artifact
uses: actions/download-artifact@v1
with:
Expand All @@ -141,7 +88,6 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.txt
files: ${{ steps.vars.outputs.package-name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109 changes: 50 additions & 59 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,59 @@ on: push

jobs:
phpcs:
name: WordPress Coding Standards
name: PHP Coding Standards
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout
uses: actions/checkout@v2
- name: Setup variables
id: vars
run: |
echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
with:
path: ${{ steps.vars.outputs.composer-cache-path }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress
- name: Coding Standards
run: composer phpcs
php-lint:
name: PHP Lint
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Coding Standards
run: composer phpcs
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout
uses: actions/checkout@v2
- name: Setup variables
id: vars
run: |
echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
with:
path: ${{ steps.vars.outputs.composer-cache-path }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress
- name: Coding Standards
run: composer phpcs
php-compat:
name: PHP Compatibility
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Analyze
run: composer phpstan
phplint:
name: PHP Lint
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Set PHP version
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Checkout
uses: actions/checkout@v2
- name: Setup variables
id: vars
run: |
echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
with:
path: ${{ steps.vars.outputs.composer-cache-path }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress
- name: Coding Standards
run: composer phpcompat
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Lint
run: composer phplint
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
### Project ###
composer.lock
yarn.lock
*.log
/dependencies/*
!/dependencies/.gitkeep
node_modules/
/dist
resources/*/dist/
/vendor

### Windows ###
Expand Down
Loading

0 comments on commit d4c1dea

Please sign in to comment.