Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.34.0 #2529

Merged
merged 73 commits into from
Aug 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a6c149b
MLP Android GlueCode
Jul 20, 2020
bcfad45
Update gutenberg submodule ref
mchowning Jul 20, 2020
eee29ca
Merge pull request #2485 from wordpress-mobile/update_passing_of_init…
mchowning Jul 20, 2020
05fb43b
Updated Gutenberg ref
Jul 22, 2020
70dbd35
Update Gutenberg commit
chipsnyder Jul 23, 2020
3fb5eee
Cover block - Allow media editing (#2403)
Jul 24, 2020
eb81800
Update Gutenberg ref (#2500)
Jul 24, 2020
1f8955a
Merge branch 'main' into try/bring_main_1.33.0_to_develop
SergioEstevao Jul 24, 2020
8f6501a
Merge branch 'develop' into issue/2419-MLPContainerAndroid and refere…
Jul 24, 2020
77f4aeb
Gutenberg reference update
Jul 24, 2020
ecccd3d
Merge pull request #2494 from wordpress-mobile/issue/2419-MLPContaine…
Jul 24, 2020
241aaa8
Reference update and Merge branch 'develop' into issue/Cover_with_cus…
Jul 24, 2020
857b590
Cover block - Hide media editing button for videos (#2509)
Jul 24, 2020
73c21f3
Merge remote-tracking branch 'origin/develop' into HEAD
mchowning Jul 24, 2020
08e2c5b
Update gutenberg submodule with ref from develop
mchowning Jul 24, 2020
7f775be
Update bundles
mchowning Jul 24, 2020
f9d28f1
Merge pull request #2506 from wordpress-mobile/try/bring_main_1.33.0_…
SergioEstevao Jul 24, 2020
dd47b7f
Update GB version.
SergioEstevao Jul 24, 2020
fba98a5
Merge branch 'develop' into issue/Cover_with_custom_color
Jul 24, 2020
0a90af5
Bundle
Jul 24, 2020
c5b1227
Update release checklist with usage of release_automation.sh script
mchowning Jul 24, 2020
e29768f
Add release precheck for open milestone PRs
mchowning Jul 24, 2020
7dce390
Merge pull request #2508 from antonis/issue/Cover_with_custom_color
Jul 27, 2020
a659dc5
Gutenberg reference
Jul 27, 2020
540a419
Update the title VoiceOver label to be more clear when you are editin…
enejb Jul 3, 2020
daee9fc
Update release noted to bump version to 1.33
enejb Jul 27, 2020
f1d1e38
Bump Gutenberg commit after the merge
enejb Jul 27, 2020
04a39c0
Merge pull request #2368 from wordpress-mobile/add/accessibility-labe…
enejb Jul 27, 2020
9f00441
Update GB reference.
SergioEstevao Jul 27, 2020
f5ea341
Merge branch 'develop' into issue/2507_fix_link_heading_shadow
SergioEstevao Jul 27, 2020
ef59a1c
Have release script check Aztec Versions
mchowning Jul 27, 2020
f5c9fba
Merge pull request #2511 from wordpress-mobile/issue/2507_fix_link_he…
SergioEstevao Jul 27, 2020
c8a5a64
Reference update
Jul 28, 2020
9ec7e04
Merge branch 'develop' into issue/CoverAddImageButton
Jul 28, 2020
fde49d6
Merge pull request #2513 from wordpress-mobile/issue/CoverAddImageButton
Jul 28, 2020
d0411f8
Merge pull request #2512 from wordpress-mobile/update_release_checkli…
mchowning Jul 28, 2020
2d91a70
Reuse confirm_to_proceed function
mchowning Jul 28, 2020
f961eb2
Abort quickly if version number is empty
mchowning Jul 28, 2020
0f8cec1
Merge pull request #2515 from wordpress-mobile/add_release_prechecks
mchowning Jul 28, 2020
27b505a
Update Gutenberg reference
chipsnyder Jul 28, 2020
75ddd7f
Merge pull request #2505 from wordpress-mobile/mobile/issue/2419-capa…
Jul 28, 2020
e869823
Update release script to push gutenberg release branch
mchowning Jul 28, 2020
72aa7b8
Fix links in PR template
mchowning Jul 28, 2020
49cc1f3
Add direction to add link for all changes to release PR template
mchowning Jul 28, 2020
3031ea4
Add checklist item for including new changes in gb-mobile PR description
mchowning Jul 28, 2020
1b8c4f7
Merge pull request #2519 from wordpress-mobile/update_release_pr_temp…
mchowning Jul 29, 2020
ae5f63b
Merge pull request #2518 from wordpress-mobile/fix_links_in_pr_template
mchowning Jul 29, 2020
51a262a
Merge pull request #2517 from wordpress-mobile/update_release_script_…
mchowning Jul 29, 2020
37ad4f2
Add GB PR to release script
mchowning Jul 29, 2020
75a2b11
Bump Gutenberg version
chipsnyder Jul 29, 2020
58490da
Merge remote-tracking branch 'origin/develop' into regression/themeCo…
chipsnyder Jul 29, 2020
909da08
Release script: Update GB PR with link to GB-Mobile PR
mchowning Jul 30, 2020
5343953
Add workaround to insure PR is not created on fork
mchowning Jul 30, 2020
7214094
Update gutenberg
chipsnyder Jul 30, 2020
b077ec4
Merge pull request #2520 from wordpress-mobile/regression/themeColors
Jul 30, 2020
6f9d7b5
Update rn slider (#2504)
lukewalczak Jul 31, 2020
5df5d08
Update gutenberg ref for aztec update
cameronvoell Jul 31, 2020
1cb43b9
Update gutenberg ref
cameronvoell Jul 31, 2020
4ef601a
Merge pull request #2526 from wordpress-mobile/update-aztec-android
cameronvoell Jul 31, 2020
58d2075
Use verbose labels with github cli command
mchowning Aug 3, 2020
0c084a1
Use verbose labels with github cli command
mchowning Aug 3, 2020
edb292a
Merge pull request #2523 from wordpress-mobile/add_gb_pr_to_release_s…
mchowning Aug 3, 2020
790e5b5
Release script: Update gb mobile version to 1.34.0
ceyhun Aug 3, 2020
9cf7aa0
Release script: Update bundle for: 1.34.0
ceyhun Aug 3, 2020
c1eb8f0
Update gutenberg ref
ceyhun Aug 4, 2020
834b28e
Update gutenberg ref
ceyhun Aug 4, 2020
3dde156
Update bundles
ceyhun Aug 4, 2020
6e96de6
Update gutenberg ref
ceyhun Aug 6, 2020
7345ce6
Update bundles
ceyhun Aug 6, 2020
bd96ed3
Update gutenberg ref
cameronvoell Aug 7, 2020
b8fc3d7
Update gutenberg ref, 1.33.1 hotfix
cameronvoell Aug 7, 2020
9f2867b
Update gutenberg ref and bundles
cameronvoell Aug 7, 2020
f2ac24f
Merge branch 'main' into release/1.34.0
cameronvoell Aug 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ To test:
PR submission checklist:

- [ ] I have considered adding unit tests where possible.
- [ ] I have considered if this change warrants user-facing release notes [more info](docs/Release-notes.md) and have added them to `[RELEASE-NOTES.txt](RELEASE-NOTES.txt)` if necessary.
- [ ] I have considered if this change warrants user-facing release notes [more info](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/docs/Release-notes.md) and have added them to [RELEASE-NOTES.txt](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/RELEASE-NOTES.txt) if necessary.
11 changes: 5 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE/release_pull_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ Release for Gutenberg Mobile v1.XX.Y

## Extra PRs that Landed After the Release Was Cut

- [ ] PR 1
- [ ] PR 2
No extra PRs yet. 🎉

## Changes
<!-- To determine the changes you can check the RELEASE-NOTES.txt file and cross check with the list of commits that are part of the PR -->
<!-- To determine the changes you can check the RELEASE-NOTES.txt and gutenberg/packages/react-native-editor/CHANGELOG.md files and cross check with the list of commits that are part of the PR -->

- Change 1
- Change 2
- Change 1: link-to-pr-describing-change-1
- Change 2: link-to-pr-describing-change-2

## Test plan

Expand All @@ -34,6 +33,6 @@ Release for Gutenberg Mobile v1.XX.Y
- iOS: Aztec dependencies match in `RNTAztecView.podspec` and `gutenberg/packages/react-native-aztec/RNTAztecView.podspec`.
- Android: 'grep aztecVersion react-native-aztec/android/build.gradle'.
- [ ] Gutenberg 'Podfile' and 'Podfile.lock' inside 'gutenberg/package/react-native-editor/ios/' are updated to the release number.
- [ ] Check if `RELEASE-NOTES.txt` and `gutenberg/packages/react-native-editor/CHANGELOG.md` are updated with all the changes that made it to the release.
- [ ] Bundle package of the release is updated.
- [ ] Check if `RELEASE-NOTES.txt` and `gutenberg/packages/react-native-editor/RELEASE-NOTES.txt` are updated with all the changes that made it to the release.

1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [***] Media editing support in Media & Text block.
* [***] New block: Social Icons
* [*] Cover block placeholder is updated to allow users start the block with a background color
* [*] Accessibility, update the title VoiceOver label to be more clear when you are editing the post or page title.

1.32.0
------
Expand Down
116 changes: 100 additions & 16 deletions bin/release_automation.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
#!/bin/bash

# Check that Github CLI is installed
command -v gh >/dev/null || { echo "Error: The Github CLI must be installed."; exit 1; }
# Before creating the release, this script performs the following checks:
# - AztecAndroid and WordPress-Aztec-iOS are set to release versions
# - Release is being created off of either develop, main, or release/*
# - Release is being created off of a clean branch
# - Whether there are any open PRs targeting the milestone for the release

# Execute script commands from project's root directory
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPT_PATH/.."

# Check current branch is develop, master, or release/* branch
source bin/release_prechecks.sh
source bin/release_utils.sh

# Check that Github CLI is installed
command -v gh >/dev/null || { echo "Error: The Github CLI must be installed."; exit 1; }

# Check that Aztec versions are set to release versions
aztec_version_problems="$(check_android_and_ios_aztec_versions)"
if [[ ! -z "$aztec_version_problems" ]]; then
printf "\nThere appear to be problems with the Aztec versions:\n$aztec_version_problems\n"
confirm_to_proceed "Do you want to proceed with the release despite the ^above^ problem(s) with the Aztec version?"
else
echo "Confirmed that Aztec Libraries are set to release versions. Proceeding..."
fi

## Check current branch is develop, main, or release/* branch
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ ! "$CURRENT_BRANCH" =~ "^develop$|^main$|^release/.*" ]]; then
echo "Releases should generally only be based on 'develop', 'main', or an earlier release branch."
echo "You are currently on the '$CURRENT_BRANCH' branch."
read -p "Are you sure you want to create a release branch from the '$CURRENT_BRANCH' branch? (y/n) " -n 1
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
printf "Aborting release...\n"
exit 1
fi
confirm_to_proceed "Are you sure you want to create a release branch from the '$CURRENT_BRANCH' branch?"
fi

# Confirm branch is clean
Expand All @@ -27,10 +40,22 @@ fi
CURRENT_VERSION_NUMBER=$(./node_modules/.bin/json -f package.json version)
echo "Current Version Number:$CURRENT_VERSION_NUMBER"
read -p "Enter the new version number: " VERSION_NUMBER
if [[ -z "$VERSION_NUMBER" ]]; then
echo "Version number cannot be empty."
exit 1
fi

# Insure javascript dependencies are up-to-date
npm ci || { echo "Error: 'npm ci' failed"; echo 1; }


# If there are any open PRs with a milestone matching the release version number, notify the user and ask them if they want to proceed
number_milestone_prs=$(check_if_version_has_pending_prs_for_milestone "$VERSION_NUMBER")
if [[ ! -z "$number_milestone_prs" ]] && [[ "0" != "$number_milestone_prs" ]]; then
echo "There are currently $number_milestone_prs PRs with a milestone matching $VERSION_NUMBER."
confirm_to_proceed "Do you want to proceed with cutting the release?"
fi

# Create Git branch
RELEASE_BRANCH="release/$VERSION_NUMBER"
git switch -c "$RELEASE_BRANCH" || { echo "Error: could not create '$RELEASE_BRANCH' branch."; exit 1; }
Expand Down Expand Up @@ -74,25 +99,84 @@ cd ..
# Update the bundles
npm run bundle || { printf "\nError: 'npm bundle' failed.\nIf there is an error stating something like \"Command 'bundle' unrecognized.\" above, perhaps try running 'rm -rf node_modules gutenberg/node_modules && npm install'.\n"; exit 1; }

# Commit bundle changes
# Commit bundle changes along with any update to the gutenberg submodule (if necessary)
git commit -a -m "Release script: Update bundle for: $VERSION_NUMBER" || { echo "Error: failed to commit changes"; exit 1; }

# Verify before publishing a PR
read -p "This script will now create a PR on Github. Would you like to proceed? (y/n) " -n 1

#####
# Create PRs
#####

# Verify before creating PRs
echo "This script will now create a Gutenberg-Mobile PR for the $RELEASE_BRANCH branch and a Gutenberg PR for the $GB_RELEASE_BRANCH branch."
read -p "Would you like to proceed? (y/n) " -n 1
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n\nProceeding to create a PR...\n"
else
printf "\n\nFinishing release script without creating a PR\n"
exit 1
fi

# Read PR template

#####
# Gutenberg-Mobile PR
#####

# Read GB-Mobile PR template
PR_TEMPLATE_PATH='.github/PULL_REQUEST_TEMPLATE/release_pull_request.md'
test -f "$PR_TEMPLATE_PATH" || { echo "Error: Could not find PR template at $PR_TEMPLATE_PATH"; exit 1; }
PR_TEMPLATE=$(cat "$PR_TEMPLATE_PATH")

# Replace version number in PR template
# Replace version number in GB-Mobile PR template
PR_BODY=${PR_TEMPLATE//v1.XX.Y/$VERSION_NUMBER}

# Create PR in GitHub
gh pr create -t "Release $VERSION_NUMBER" -b "$PR_BODY" -B main -l "release-process" -d || { echo "Error: Failed to create PR"; exit 1; }
# Insure PR is created on proper remote
# see https://github.com/cli/cli/issues/800
BASE_REMOTE=$(get_remote_name 'wordpress-mobile/gutenberg-mobile')
git push -u "$BASE_REMOTE" HEAD || { echo "Unable to push to remote $BASE_REMOTE"; exit 1; }

# Create Draft GB-Mobile Release PR in GitHub
GB_MOBILE_PR_URL=$(gh pr create --title "Release $VERSION_NUMBER" --body "$PR_BODY" --base main --label "release-process" --draft)
if [[ $? != 0 ]]; then
echo "Error: Failed to create Gutenberg-Mobile PR"
exit 1
fi


#####
# Gutenberg PR
#####

# Get Checklist from Gutenberg PR template
cd gutenberg
GUTENBERG_PR_TEMPLATE_PATH=".github/PULL_REQUEST_TEMPLATE.md"
test -f "$GUTENBERG_PR_TEMPLATE_PATH" || { echo "Error: Could not find PR template at $GUTENBERG_PR_TEMPLATE_PATH"; exit 1; }
# Get the checklist from the gutenberg PR template by removing everything before the '## Checklist:' line
CHECKLIST_FROM_GUTENBERG_PR_TEMPLATE=$(cat "$GUTENBERG_PR_TEMPLATE_PATH" | sed -e/'## Checklist:'/\{ -e:1 -en\;b1 -e\} -ed)

# Construct body for Gutenberg release PR
GUTENBERG_PR_BEGINNING="## Description
Release $VERSION_NUMBER of the react-native-editor and Gutenberg-Mobile.

For more information about this release and testing instructions, please see the related Gutenberg-Mobile PR: $GB_MOBILE_PR_URL"
GUTENBERG_PR_BODY="$GUTENBERG_PR_BEGINNING

$CHECKLIST_FROM_GUTENBERG_PR_TEMPLATE"

# Insure PR is created on proper remote
# see https://github.com/cli/cli/issues/800
GB_BASE_REMOTE=$(get_remote_name 'WordPress/gutenberg')
git push -u "$GB_BASE_REMOTE" HEAD || { echo "Unable to push to remote: $GB_BASE_REMOTE"; exit 1; }

# Create Draft Gutenberg Release PR in GitHub
GUTENBERG_PR_URL=$(gh pr create --title "Mobile Release v$VERSION_NUMBER" --body "$GUTENBERG_PR_BODY" --base master --label 'Mobile App Android/iOS' --draft)
if [[ $? != 0 ]]; then
echo "Error: Failed to create Gutenberg PR"
exit 1
fi
cd ..

echo "PRs Created"
echo "==========="
printf "Gutenberg-Mobile $GB_MOBILE_PR_URL
Gutenberg $GUTENBERG_PR_URL\n" | column -t
94 changes: 94 additions & 0 deletions bin/release_prechecks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash

# Execute script commands from project's root directory
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$SCRIPT_PATH/.."

#####
# Confirm to Proceed Prompt
#####

# Accepts a single argument: a yes/no question (ending with a ? most likely) to ask the user
function confirm_to_proceed() {
read -p "$1 (y/n) " -n 1
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
printf "Aborting release...\n"
exit 1
fi
}

#####
# PR Milestone check
#####

function check_num_milestone_prs() {
MILESTONE_NAME="$1"
curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/wordpress-mobile/gutenberg-mobile/milestones" \
| npx json -c "this.title === '$MILESTONE_NAME'" -a open_issues
}

function check_if_version_has_pending_prs_for_milestone() {
number_milestone_prs=$(check_num_milestone_prs "$VERSION_NUMBER")
# If we got no results and the version ends with ".0"
if [[ -z "$number_milestone_prs" ]] && [[ "$VERSION_NUMBER" =~ [0-9]+\.[0-9]+\.0$ ]]; then
# Remove the ending ".0" and check again because we usually drop ".0" from our
# milestones. For example, the milestone for 1.34.0 was 1.34
version_without_dot_zero=$(echo "$VERSION_NUMBER" | rev | cut -c 3- | rev)
number_milestone_prs=$(check_num_milestone_prs "$version_without_dot_zero")
fi
echo "$number_milestone_prs"
}


#####
# Check for Aztec Release Versions
#####

SEMANTIC_VERSION_REGEX='\d+\.\d+\.\d+'

function check_android_aztec_is_release_version() {
react_native_aztec_gradle='gutenberg/packages/react-native-aztec/android/build.gradle'
release_version=$(grep aztecVersion "$react_native_aztec_gradle" | grep -oE "$SEMANTIC_VERSION_REGEX")
if [[ -z "$release_version" ]]; then
echo "A release version for AztecAndroid was not found in $react_native_aztec_gradle"
fi
}

function check_ios_aztec_is_release_version() {
result=''

podspec_file='RNTAztecView.podspec'
aztec_version=$(grep WordPress-Aztec-iOS "$podspec_file" | grep -oE "$SEMANTIC_VERSION_REGEX")
if [[ -z "$aztec_version" ]]; then
result="A release version for WordPress-Aztec-iOS was not found in $podspec_file"
fi

podfile='gutenberg/packages/react-native-editor/ios/Podfile'
commented_out_reference_in_podfile=$(grep -E "# *pod 'WordPress-Aztec-iOS'" "$podfile")
if [[ -z "$commented_out_reference_in_podfile" ]]; then
message="The developer version of WordPress-Aztec-iOS was not commented out in $podfile"
if [[ -z "$result" ]]; then
result="$message"
else
result="${result}\n${message}"
fi

fi

echo "$result"
}

# If any problems, the problems are each printed on their own line
function check_android_and_ios_aztec_versions() {
android_result=$(check_android_aztec_is_release_version)
ios_result=$(check_ios_aztec_is_release_version)
if [[ ! -z "$android_result" ]]; then
echo "${android_result}\n${ios_result}"
else
echo "$ios_result"
fi
}

printf "$(check_android_and_ios_aztec_versions)\n"
8 changes: 8 additions & 0 deletions bin/release_utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Accepts the repository owner/name (wordpress-mobile/gutenberg-mobile) and returns
# the locally matching remote
function get_remote_name() {
REPO="$1"
git remote -v | grep "git@github.com:$REPO.git (push)" | grep -oE '^\S*'
}
Loading