From 48d0a180c113229087793b9fee6ad4e1a286820e Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 25 Jul 2019 15:47:41 +1200 Subject: [PATCH] 0.16.0 --- plugins/woocommerce-admin/bin/changelog.js | 2 + plugins/woocommerce-admin/bin/pre-release.sh | 93 ++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100755 plugins/woocommerce-admin/bin/pre-release.sh diff --git a/plugins/woocommerce-admin/bin/changelog.js b/plugins/woocommerce-admin/bin/changelog.js index ccf43450de3..e36b194d82d 100644 --- a/plugins/woocommerce-admin/bin/changelog.js +++ b/plugins/woocommerce-admin/bin/changelog.js @@ -122,6 +122,8 @@ const printProjectColumns = async () => { json: true, } + console.log( chalk.yellow( 'Gathering columns from the project board, https://github.com/orgs/woocommerce/projects/2' ) ); + return requestPromise( options ) .then( data => { console.log( ' ' ); diff --git a/plugins/woocommerce-admin/bin/pre-release.sh b/plugins/woocommerce-admin/bin/pre-release.sh new file mode 100755 index 00000000000..3b71d2aae45 --- /dev/null +++ b/plugins/woocommerce-admin/bin/pre-release.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# Enable nicer messaging for build status. +BLUE_BOLD='\033[1;34m'; +GREEN_BOLD='\033[1;32m'; +RED_BOLD='\033[1;31m'; +YELLOW_BOLD='\033[1;33m'; +COLOR_RESET='\033[0m'; + +error () { + echo -e "\nšŸ¤Æ ${RED_BOLD}$1${COLOR_RESET}\n" +} +status () { + echo -e "\nšŸ‘©ā€šŸ’» ${BLUE_BOLD}$1${COLOR_RESET}\n" +} +success () { + echo -e "\nāœ… ${GREEN_BOLD}$1${COLOR_RESET}\n" +} +warning () { + echo -e "\n${YELLOW_BOLD}$1${COLOR_RESET}\n" +} + +# Make sure there are no changes in the working tree. +changed= +if ! git diff --exit-code > /dev/null; then + changed="file(s) modified" +elif ! git diff --cached --exit-code > /dev/null; then + changed="file(s) staged" +fi +if [ ! -z "$changed" ]; then + git status + error "ERROR: Cannot start pre-release with dirty working tree. ā˜ļø Commit your changes and try again." + exit 1 +fi + +status "Lets release WooCommerce Admin šŸŽ‰" + +#git checkout master || { error "ERROR: Unable to checkout master branch." ; exit 1; } + +success "Checked out master branch" + +#git pull origin master + +success "Pulled latest commits" + +status "What version would you like to release?" + +echo -n "Version: " + +read release + +branch="release/${release}" + +exists=`git show-ref refs/heads/${branch}` + +if [ -n "$exists" ]; then + error "ERROR: release branch already exists." + exit 1 +fi + +status "creating a release branch" + +#git checkout -b $branch || { error "ERROR: Unable to create release branch." ; exit 1; } + +success "Release branch created: ${branch}" + +status "Bumping version to ${release}" + +npm --no-git-tag-version version $release || { error "ERROR: Invalid version number." ; exit 1; } + +success "Version bumped successfully" + +status "Run prestart scripts to propagate version numbers and update dependencies." + +npm run prestart + +status "Run docs script to make sure docs are updated." + +npm run docs + +status "Remove changes to package-lock.json to prevent merge conflicts." + +git checkout package-lock.json + +status "Here are the changes so far. Make sure the following changes are reflected." + +echo "- docs/: folder will have changes to documentation, if any." +echo "- package.json: new version number." +echo "- woocommerce-admin.php: new version numbers." +echo -e "\n" +echo -e "\n" + +git status