This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
footnotes/footnotes.php
Ben Goldsworthy 0a34e96450
Add release helper script (#64)
This commit adds a release helper script, amongst other workflow improvements.

See `README.md` for instructions, and `_tools/release.sh` for the script itself.

This script:

1. sanity-checks the various version tags;
2. triggers a Plugin build;
3. flags the new version as pre-release;
4. tags the version in Git;
5. creates a local working copy of the SVN repo;
6. copies the new release to the local `trunk/` (whilst keeping the ‘Stable Tag’ field in `readme.txt` pointing to the previous stable version);
7. copies the commit message from the changelog in `readme.txt`; and
8. (if a flag is set) commits the changes to the remote `trunk/`.

Pushing out a new release must still be done manually, once `trunk/` is tested and working. To do so, check out a local copy of `trunk/` and:

1. update the ‘Stable Tag’ field in `trunk/readme.txt` to the new version;
2. update the ‘Version’ field in the comment header of `trunk/footnotes.php` to the new version;
3. remove the ‘p’ from the end of the ‘version’ tag in the `getInfo()` function at the bottom of `js/wsiwyg-editor.js`; 
4. copy a new tag for the release from `trunk/` (`svn cp trunk tags/<version number>`); and
5. commit your changes (`svn ci -m "Release version <version number>"`).

The WP Plugin Directory will automatically parse the ‘Stable Tag’ field in `trunk/readme.txt`, and inform users that a new version is available.

At various stages user input is required to validate information. This is not ready for automation with GitHub Actions, but is a useful step on the way — see [this piece](https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to-gradual-automation/) for more info.

Unless a `-c` flag is passed (e.g., by running `composer run release:commit`) no changes will take place on the remote SVN repo. If you want to test this out on a branch other than `main`, uncomment lines 31 & 52 of the script.

Version checking enforces the versioning rules stated [here](https://github.com/markcheret/footnotes/wiki/Versioning).

**NB: I have not tested the `-c` mode yet, as I wanted people will more familiarity with the SVN to have a look at it before I risked making any changes and blowing everything up.**

Co-authored-by: pewgeuges <73141620+pewgeuges@users.noreply.github.com>
2021-03-17 17:46:21 +00:00

134 lines
5.5 KiB
PHP
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Plugin Name: footnotes
* Plugin URI: https://wordpress.org/plugins/footnotes/
* Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
* Author: Mark Cheret
* Version: 2.5.10
* Author URI: https://cheret.org/footnotes/
* Text Domain: footnotes
* Domain Path: /languages
*
* @package footnotes
* @copyright 2021 Mark Cheret (email: mark@cheret.de)
*/
/**
* Version numbers in WordPress plugin readme.txt and main PHP headers.
*
* - Adding: Documentation: Readme.txt: informative 'Package Version' field in sync with the package version currently hidden in the main PHP script header.
* - Adding: Documentation: Readme.txt: informative 'Version' field pointing a tag folder in SVN for bugfix versions available ahead of the stable tag.
* - Adding: Documentation: Readme.txt: comment line below the 'Stable Tag' field to warn that this is (unexpectedly) parsed for release configuration.
*
* @since 2.5.11
* @see readme.txt
* @link https://meta.trac.wordpress.org/ticket/5652
*
* Package Version Actual version string, informative only.
* May identify a development version.
* A 'd' series is suffixed to incremented bugfix version.
* Used for style sheet cache busting.
*
* Version Parsed in the main PHP file header for update configuration.
* Refers to the latest tag.
* Typically the best available version.
* May not be released, due to release frequency concerns.
*
* Stable Tag Parsed in the readme.txt in trunk/ for release configuration.
* May be smaller than Version, avoiding too frequent releases.
*
* WordPress plugin readmes are usually lacking the version number of the package.
* In Footnotes, this has been included after the stable tag had been mistaken for
* the package version, given that state-of-the-art readmes have that information.
*
* - Bugfix: Codebase: revert to 2.5.8, thanks to @little-shiva @watershare @adjayabdg @staho @frav8 @voregnev @dsl225 @alexclassroom @a223123131 @codldmac bug reports.
*
* @version 2.5.10 (reversion to @version 2.5.8)
* @revision 2483464
* @timestamp 2021-03-01 11:09:29 +0000
* @link https://plugins.trac.wordpress.org/changeset/2483464/footnotes/trunk
*
* @reporter @little-shiva
* @link https://wordpress.org/support/topic/footnotes-broke-two-of-my-client-sites/
*
* @reporter @watershare
* @link https://wordpress.org/support/topic/latest-update-broke-my-site-19/
*
* @reporter @adjayabdg
* @link https://wordpress.org/support/topic/latest-update-broke-my-site-19/#post-14115531
*
* @reporter @staho
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/
*
* @reporter @frav8
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115614
*
* @reporter @voregnev
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115632
*
* @reporter @dsl225
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115820
*
* @reporter @alexclassroom
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115860
*
* @reporter @a223123131
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115906
* @link https://wordpress.org/support/topic/update-breaks-layout-3/
* @link https://wordpress.org/support/topic/bugs-in-every-2nd-update/#post-14116804
*
* @reporter @codldmac
* @link https://wordpress.org/support/topic/crashed-my-site-104/
*
* The accidental release of 2.5.9d1 was due to 3 factors:
*
* 1. The codebase got overhauled for the sake of WordPress Coding Standards compliance,
* one requirement of which is that files be named after the name of the class in them;
* 2. The renamed folder was not added to Subversion version control due to an unexpected
* unfamiliarity with the system and its command line interface;
* 3. The Stable Tag field in the Readme header was used for the package version because
* the related field is lacking, and the use of file headers for release configuration
* is uncommon.
*
* @link https://wordpress.org/support/topic/2-5-10-reverts-2-5-9d1-and-apologies/
* @link https://wordpress.org/support/topic/2-5-10-reverts-2-5-9d1-and-apologies/#post-14119440
* @link https://github.com/markcheret/footnotes/issues/55
* @link https://meta.trac.wordpress.org/ticket/5645
* @link https://wordpress.org/plugins/readme.txt
* @link https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/
*/
/**
* Plugins main PHP file.
*
* @filesource
* @package footnotes
* @since 0.0.1
*/
// Get all common classes and functions.
require_once dirname( __FILE__ ) . '/includes.php';
// Add Plugin Links to the "installed plugins" page.
$l_str_plugin_file = 'footnotes/footnotes.php';
add_filter( "plugin_action_links_{$l_str_plugin_file}", array( 'MCI_Footnotes_Hooks', 'plugin_links' ), 10, 2 );
// Initialize the Plugin.
$g_obj_mci_footnotes = new MCI_Footnotes();
// Run the Plugin.
$g_obj_mci_footnotes->run();
/**
* Sets the stylesheet enqueuing mode for production.
*
* @since 2.5.5
* @var bool
* @see class/init.php
*
* In production, a minified CSS file tailored to the settings is enqueued.
*
* Developing stylesheets is meant to be easier when this is set to false.
* WARNING: This facility designed for development must NOT be used in production.
*/
define( 'C_BOOL_CSS_PRODUCTION_MODE', false );