diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6fac6d36..c3358d1a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,34 @@ jobs: run: composer install --no-dev --no-interaction --optimize-autoloader - name: Composer build run: composer run-script build + # "composer build" leaves the ready-to-ship distribution in ./multisite-language-switcher + # (bin/git-release.sh rsyncs the repository through .distignore). Everything after that + # point - including the "composer update" that restores the require-dev packages for + # local development - only touches the working tree, never the build directory. + - name: Verify the build directory + run: | + BUILD_DIR=multisite-language-switcher + test -d "$BUILD_DIR" || { echo "::error::$BUILD_DIR was not created by composer build"; exit 1; } + for required in MultisiteLanguageSwitcher.php readme.txt vendor/autoload.php; do + test -e "$BUILD_DIR/$required" || { echo "::error::$BUILD_DIR/$required is missing"; exit 1; } + done + for forbidden in .git .github docs src tests node_modules composer.lock package.json; do + test ! -e "$BUILD_DIR/$forbidden" || { echo "::error::$BUILD_DIR/$forbidden must not be shipped"; exit 1; } + done + php -r ' + $lock = json_decode(file_get_contents("composer.lock"), true); + $found = []; + foreach ($lock["packages-dev"] as $package) { + if (is_dir("multisite-language-switcher/vendor/" . $package["name"])) { + $found[] = $package["name"]; + } + } + if ($found) { + fwrite(STDERR, "::error::require-dev packages in the build directory: " . implode(", ", $found) . PHP_EOL); + exit(1); + } + ' + echo "Build directory holds $(find "$BUILD_DIR" -type f | wc -l) files, production dependencies only." - name: WordPress Plugin Deploy uses: 10up/action-wordpress-plugin-deploy@stable id: deploy @@ -31,6 +59,11 @@ jobs: SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SLUG: multisite-language-switcher + # Deploy only the built distribution. Without this the action falls back to + # rsyncing the whole workspace through .distignore - which cannot exclude vendor/, + # so the require-dev packages restored by "composer build" ended up in the SVN + # transaction and broke the 3.0.0 release. + BUILD_DIR: multisite-language-switcher with: generate-zip: true - name: Attest build provenance diff --git a/Changelog.md b/Changelog.md index 98d40fe2..5dd818e7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ -## 3.0.0 +## 3.0.1 +* Fix: the WordPress.org deploy pushed the whole workspace instead of the built distribution. +* No changes to the plugin itself - the shipped code is identical to 3.0.0. +## 3.0.0 * Add Quick Create for translations: create the translated post straight from the editor metabox, or pick a source post on the new "Add from Translation" submenu (single and bulk), backed by a REST endpoint and switchable in the settings. * Add `msls_quick_create_capability` so integrations can override the Quick Create permission checks, plus filters for the post data, the inserted post, the response, the untranslated-posts list, and the mapped taxonomy terms. * Add filter hooks for the AJAX suggest results of the post and term metaboxes. @@ -22,7 +25,6 @@ * Documentation: update README.md code snippets to reflect new function names. ## 2.10.0 - * Add prefixed public helper functions (msls_get_*, msls_the_switcher) with deprecation shims for legacy names to satisfy WPCS while staying backward compatible. * Expose action hook names as constants for safer programmatic use. * Accessibility: add aria-current="page" on the active language link. diff --git a/MultisiteLanguageSwitcher.php b/MultisiteLanguageSwitcher.php index d5bb7b6e..94345d6e 100644 --- a/MultisiteLanguageSwitcher.php +++ b/MultisiteLanguageSwitcher.php @@ -3,7 +3,7 @@ * Multisite Language Switcher Plugin * * Plugin Name: Multisite Language Switcher - * Version: 3.0.0 + * Version: 3.0.1 * Plugin URI: http://msls.co/ * Description: A simple but powerful plugin that will help you to manage the relations of your contents in a multilingual multisite-installation. * Author: Dennis Ploetner @@ -42,7 +42,7 @@ * @author Dennis Ploetner */ if ( ! defined( 'MSLS_PLUGIN_VERSION' ) ) { - define( 'MSLS_PLUGIN_VERSION', '3.0.0' ); + define( 'MSLS_PLUGIN_VERSION', '3.0.1' ); define( 'MSLS_PLUGIN_PATH', plugin_basename( __FILE__ ) ); define( 'MSLS_PLUGIN__FILE__', __FILE__ ); diff --git a/readme.txt b/readme.txt index de46f3e5..1fd3d643 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: multilingual, multisite, language, switcher, localization Requires at least: 6.1 Tested up to: 7.1 Requires PHP: 7.4 -Stable tag: 3.0.0 +Stable tag: 3.0.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -57,9 +57,7 @@ It's up to you - of course. But yes, if you want to use the Multisite Language S = How can I automatically redirect users based on the browser language? = -The Multisite Language Switcher does not redirect the users automatically. I'm not sure if the plugin should do that. You might check out this [jQuery plugin]( -https://github.com/danieledesantis/jquery-language-detection) or [this approach with a theme](https://github.com/oncleben31/Multisite-Language-Switcher-Theme) -if you need such functionality. +The Multisite Language Switcher does not redirect the users automatically. I'm not sure if the plugin should do that. = How can I add the Multisite Language Switcher to the nav menu of my blog? = @@ -95,6 +93,11 @@ Please visit the [MSLS website](https://msls.co/) or use the [WordPress support == Changelog == += 3.0.1 = + +* Fixed: 3.0.0 could not be published on WordPress.org +* The plugin code is identical to 3.0.0. + = 3.0.0 = * New: Quick Create - create the translated post straight from the editor metabox, or pick a source post on the new `Add from Translation` submenu (single and bulk). Backed by a REST endpoint and switchable in the settings. @@ -126,6 +129,12 @@ The full history is kept in the separate [Changelog](https://github.com/lloc/Mul == Upgrade Notice == += 3.0.1 = + +Republishes 3.0.0, whose upload to WordPress.org failed. The plugin code is unchanged +against 3.0.0 - only the release pipeline was fixed. See the 3.0.0 notice below for what +the major release brings. + = 3.0.0 = Major release. The class structure moved into sub-namespaces, but every pre-3.0 class name diff --git a/src/msls-widget-block/block.json b/src/msls-widget-block/block.json index 44895a5e..ea9d5e9c 100644 --- a/src/msls-widget-block/block.json +++ b/src/msls-widget-block/block.json @@ -5,7 +5,7 @@ "icon": "translation", "category": "widgets", "name": "lloc/msls-widget-block", - "version": "3.0.0", + "version": "3.0.1", "description": "Review the settings for the Multisite Language Switcher plugin, as the block utilizes the API function `msls_the_switcher()` for its output.", "example": {}, "supports": {