Skip to content
Snippets Groups Projects
Commit fe5c5c48 authored by Jacob Rockowitz's avatar Jacob Rockowitz
Browse files

Update 'Steps for creating a new release'

parent c42b2966
No related branches found
No related tags found
No related merge requests found
Steps for creating a new release of this module
--------------------------------------------------------------------------------
Steps for creating a new release
--------------------------------
1. Apply short array syntax
2. Inspect code
3. Run tests
4. Generate and edit release notes
5. Tag a release
6. Update project page
7. Create new release
--------------------------------------------------------------------------------
1. Cleanup code
2. Review code
3. Run tests
4. Generate release notes
5. Tag and create a new release
6. Update project page
# Apply to short array syntax
wget https://raw.githubusercontent.com/thomasbachem/php-short-array-syntax-converter/master/convert.php
find . -name "*.install" -exec php "convert.php" -w "{}" \;
find . -name "*.module" -exec php "convert.php" -w "{}" \;
find . -name "*.php" -exec php "convert.php" -w "{}" \;
find . -name "*.inc" -exec php "convert.php" -w "{}" \;
rm convert.php
1. Cleanup code
---------------
--------------------------------------------------------------------------------
[Convert to short array syntax](https://www.drupal.org/project/short_array_syntax)
# Inspect code
drush short-array-syntax toc_api
**References**
- [Installing Coder Sniffer](https://www.drupal.org/node/1419988)
2. Review code
--------------
**PHPStorm**
[Online](http://pareview.sh)
- [Drupal Development using PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/Drupal+Development+using+PhpStorm#DrupalDevelopmentusingPhpStorm-CoderandPHPCodeSnifferIntegration)
http://git.drupal.org/project/toc_api.git 8.x-1.x
**Online**
- [pareview.sh](http://pareview.sh)
http://git.drupal.org/project/toc_api.git 8.x-1.x
**[Commandline](https://www.drupal.org/node/1587138)**
[Commandline](https://www.drupal.org/node/1587138)
# Check Drupal coding standards
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md modules/sandbox/toc_api
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml modules/sandbox/toc_api
# Check Drupal best practices
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md modules/sandbox/toc_api
--------------------------------------------------------------------------------
# Run tests
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml modules/sandbox/toc_api
**SimpleTest**
GUI (admin/config/development/testing)
3. Run tests
------------
Command-line (from site root)
[SimpleTest](https://www.drupal.org/node/645286)
# Run all test included this module
# Run all tests
php core/scripts/run-tests.sh --url http://localhost/d8_dev --module toc_api
**PHPUnit tests**
PHPUnit tests needs to be run individual if this module is placed in a
modules sub-directory (ie module/contrib or modules/sandbox).
- [/core/phpunit.xml.dist only finds top-level contrib modules](https://www.drupal.org/node/2499239)
If the above patch is applied or this module is in the main /modules directory.
This command will execute all PHPUnit tests for this module
cd core
php ../vendor/phpunit/phpunit/phpunit --group TocApi
The below commands can be used to execute each individual PHPUnit test.
[PHPUnit](https://www.drupal.org/node/2116263)
# Execute individual PHPUnit tests.
cd core
php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocFormatterTest.php
php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocTest.php
--------------------------------------------------------------------------------
php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocTest.php
# Generate and edit release notes
4. Generate release notes
-------------------------
Git Release Notes for Drush (https://www.drupal.org/project/grn)
[Git Release Notes for Drush](https://www.drupal.org/project/grn)
drush release-notes 8.x-1.0-N 8.x-1.x
--------------------------------------------------------------------------------
# Tag a release
drush release-notes 8.x-1.0-VERSION 8.x-1.x
git tag 8.x-1.0-N
git push --tags
git push origin tag 8.x-1.0-N
--------------------------------------------------------------------------------
5. Tag and create a new release
-------------------------------
# Update project page
[Tag a release](https://www.drupal.org/node/1066342)
Steps for converting README.md to valid and supported HTML for this module's
Drupal.org project page.
git tag 8.x-1.0-VERSION
git push --tags
git push origin tag 8.x-1.0-VERSION
- [Convert Markdown to HTML](http://daringfireball.net/projects/markdown/dingus)
- [Tidy HTML](https://infohound.net/tidy/)
- No indent
- No wrap
- Manually cleanup
- Remove `<html>` tags.
- Remove 'Contents of this file'.
- Update example code and wrap in `<pre>` tag.
- Update project page](https://www.drupal.org/node/2685977/edit)
- Preview
- Save
[Create new release](https://www.drupal.org/node/add/project-release/2685977)
--------------------------------------------------------------------------------
# Create new release
6. Update project page
----------------------
[Export README.md](https://www.drupal.org/project/readme)
drush readme-export toc_api
- [Create Release](https://www.drupal.org/node/add/project-release/2685977)
- [Administer releases](https://www.drupal.org/node/2685977/edit/releases)
[Edit project page](https://www.drupal.org/node/2685977/edit)
......@@ -89,4 +89,3 @@ toc_api.toc_type.*:
type: ignore
h6:
type: ignore
......@@ -78,6 +78,7 @@ abstract class TocBlockBase extends BlockBase {
* can all be used as this block's plugin ID.
*
* @return string
* The current TOC block's plugin ID.
*/
protected function getCurrentTocId() {
return $this->pluginId;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment