Skip to content
Snippets Groups Projects
Verified Commit b5ebf654 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: add support for wpdesk/wp-init

parent 4ff215ab
No related branches found
No related tags found
No related merge requests found
variables:
WPDESK_CI_VERSION: "2024.09.25"
WPDESK_CI_VERSION: "2024.10.08"
MYSQL_ROOT_PASSWORD: "mysql"
MYSQL_DATABASE: "wptest"
MYSQL_USER: "mysql"
......
......@@ -6,6 +6,8 @@ prepare prefixed vendor:
- assets
- vendor
- vendor_prefixed
# wpdesk/wp-init default cache directory for plugin.php file
- generated
tags:
- vendor
stage: prepare-vendor
......@@ -19,6 +21,8 @@ prepare prefixed vendor:
- php --version
script:
- composer install
# For plugins using wpdesk/wp-init, but only after v0.10. This has to be changed later, when library hits v1
- composer show -q wpdesk/wp-init ^0.10 >/dev/null 2>&1 && vendor/bin/wpinit ./flexible-subscriptions.php ./generated/ || echo "Not using wpdesk/wp-init"
- rm auth.json
prepare npm assets:
......
......@@ -12,8 +12,14 @@
- SEMVER_PART="(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
- echo "Checking plugin version in plugin header"
- if [[ "$(grep -h 'Version:' *.php | grep -oP $SEMVER_REGEX)" != "$PLUGIN_VERSION" ]]; then exit 1; fi
- echo "Checking plugin version in variable"
- if [[ "$(grep -h '$plugin_version' *.php | grep -oP $SEMVER_REGEX)" != "$PLUGIN_VERSION" ]]; then exit 1; fi
- |
# Check for $plugin_version variable in file only for plugin-flow plugins. wpdesk/wp-init doesn't use such identifier.
if ! composer show -q wpdesk/wp-init; then
echo "Checking plugin version in variable";
if [[ "$(grep -h '$plugin_version' *.php | grep -oP $SEMVER_REGEX)" != "$PLUGIN_VERSION" ]]; then
exit 1;
fi
fi
- |
if [[ -f readme.txt ]]; then
# skip check if it's preproduction version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment