Skip to content

Commit

Permalink
Merge pull request #17 from lloc/adds-plugin-check-action
Browse files Browse the repository at this point in the history
Adds workflow and execution logic for the plugin check
  • Loading branch information
lloc authored Oct 6, 2024
2 parents d918ee0 + 0052d07 commit 8c1fe3f
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 31 deletions.
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.wordpress-org
/.git
/.github
/bin
/reports
/tests
.distignore
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Plugin Check
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- master
- 'releases/*'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer dependencies
run: composer install --no-dev --no-interaction --optimize-autoloader
- name: Build
run: composer run-script build
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: './mslsmenu'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ composer.lock
.idea/
vendor/
reports/
mslsmenu/
mslsmenu.zip
59 changes: 31 additions & 28 deletions MslsMenu.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
<?php

/*
Plugin Name: MslsMenu
Requires Plugins: multisite-language-switcher
Plugin URI: https://github.com/lloc/MslsMenu
Description: Adds the Multisite Language Switcher to the primary-nav-menu
Version: 2.5.0
Author: Dennis Ploetner
Author URI: http://lloc.de/
Text Domain: mslsmenu
*/

/*
Copyright 2014 Dennis Ploetner (email : re@lloc.de)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* MslsMenu
*
* @copyright Copyright (C) 2011-2022, Dennis Ploetner, re@lloc.de
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 or later
* @wordpress-plugin
*
* Plugin Name: MslsMenu
* Requires Plugins: multisite-language-switcher
* Version: 2.5.1
* Plugin URI: https://wordpress.org/plugins/mslsmenu/
* Description: Adds the Multisite Language Switcher to the primary-nav-menu
* Author: Dennis Ploetner
* Author URI: http://lloc.de/
* Text Domain: mslsmenu
* Domain Path: /languages/
* License: GPLv2 or later
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

declare( strict_types=1 );

Expand Down
12 changes: 12 additions & 0 deletions bin/git-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
PLUGIN_NAME="mslsmenu"
BUILD_PATH="$PROJECT_ROOT/$PLUGIN_NAME"
ZIP_ARCHIVE="$PROJECT_ROOT/$PLUGIN_NAME.zip"

rm -f $ZIP_ARCHIVE
rm -rf $BUILD_PATH && mkdir $BUILD_PATH

rsync -arvp --exclude-from=$PROJECT_ROOT/.distignore $PROJECT_ROOT/ $BUILD_PATH/
cd $PROJECT_ROOT && zip -r $ZIP_ARCHIVE $PLUGIN_NAME
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"homepage": "https://it.wordpress.org/plugins/mslsmenu/",
"require": {
"php": ">=7.1",
"php": ">=7.4",
"composer/installers": "~1.9.0"
},
"require-dev": {
Expand All @@ -21,7 +21,11 @@
"scripts": {
"test": "vendor/bin/pest",
"coverage": "php -d xdebug.mode=coverage vendor/bin/pest --coverage",
"analyze": "vendor/bin/phpstan analyze"
"analyze": "vendor/bin/phpstan analyze",
"git-release": "bin/git-release.sh",
"build": [
"@git-release"
]
},
"authors": [
{
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: multilingual, multisite, language, switcher, menu
Requires at least: 5.3
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 2.5.0
Stable tag: 2.5.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -35,6 +35,10 @@ But this can lead to fatal errors if you don't know much about PHP, or maybe the

== Changelog ==

= 2.5.1 =
* plugin check integration added
* missing license problem addressed

= 2.5.0 =
* WordPress 6.6 tested
* MslsOutput class deprecated init in favour of a function
Expand Down

0 comments on commit 8c1fe3f

Please sign in to comment.