Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create a build of the Gutenberg master branch
set -ex
# Expects git clone ~/gutenberg
cd ~/gutenberg
# Reset working directory
git checkout -f master
git pull origin master
# Run the initial gutenberg ZIP build
yes | npm run package-plugin
# Modify 'Version: ' to bump to next version and append short hash (e.g. '4.0-alpha-610aa4e')
echo '<?php file_put_contents( "gutenberg.php", preg_replace_callback( "#Version: (.+)#", function( $matches ) { $new_version = (float) $matches[1] + .1; $new_version .= ".0-alpha-" . substr( shell_exec( "git rev-parse HEAD" ), 0, 7 ); return str_replace( $matches[1], $new_version, $matches[0] ); }, file_get_contents( "gutenberg.php" ) ) );' | php
zip gutenberg.php
# Move ZIP file to builds directory
mv ~/webapps/builds/
cd ~/webapps/builds/
# Rebuild the ZIP file to place all files within a base 'gutenberg/' directory
unzip -d gutenberg
zip -r gutenberg
rm -r gutenberg
date -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.