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

Add step to run pod install in XCFramework folder to automation #116

Merged
merged 2 commits into from
May 31, 2023

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented May 25, 2023

This is necessary after the introduction of the XCFramework builder project in
wordpress-mobile/gutenberg-mobile#5739 and wordpress-mobile/gutenberg-mobile#5740.

Worth noting that the XCFramework distribution pipeline and integration in Jetpack and WordPress iOS is currently incomplete. The step is required to avoid a CI failure but has not effect on the quality of the final release. This will hopefully change within the next couple of releases.


Update: I run a manual test after following @fluiddot's suggestion:

The script starts and eventually reaches the new step...

image

...which succeeds
image

This is the commit:

Untitled4

For reference, here's the diff for the modified version of the script that I used
--- a/release_automation.sh
+++ b/release_automation.sh
@@ -50,35 +50,35 @@ if ! [[ $REPLY =~ ^[Yy]$ ]]; then
 fi
 
 # Check if script is up-to-date
-LOCAL_COMMIT=$(git rev-parse HEAD)
-execute "git" "remote" "update"
-DEFAULT_BRANCH_HEAD=$(git rev-parse 'trunk@{upstream}')
-if ! [[ "$LOCAL_COMMIT" = "$DEFAULT_BRANCH_HEAD" ]]; then
-    echo ""
-    echo "You're not running this script from the HEAD commit on the default branch, 'trunk'."
-    echo "If you are generating a release you should generally use the latest version of the script."
-    read -r -p "Are you sure you want the script to proceed? (y/n) "
-    echo ""
-    if ! [[ $REPLY =~ ^[Yy]$ ]]; then
-        abort "Exiting script..."
-    fi
-fi
-
-# Check if script has uncommitted changes
-if [ -n "$(git status --porcelain)" ]; then
-    echo "You are running this script with uncommitted changes."
-    echo "If you are generating a release you should generally use the current version of the script on the develop branch."
-    read -r -p "Are you sure you want the script to proceed? (y/n) "
-    echo ""
-    if ! [[ $REPLY =~ ^[Yy]$ ]]; then
-        abort "Exiting script..."
-    fi
-fi
-
-# Read GB-Mobile PR template
-PR_TEMPLATE_PATH='./release_pull_request.md'
-test -f "$PR_TEMPLATE_PATH" || abort "Error: Could not find PR template at $PR_TEMPLATE_PATH"
-PR_TEMPLATE=$(cat "$PR_TEMPLATE_PATH")
+# LOCAL_COMMIT=$(git rev-parse HEAD)
+# execute "git" "remote" "update"
+# DEFAULT_BRANCH_HEAD=$(git rev-parse 'trunk@{upstream}')
+# if ! [[ "$LOCAL_COMMIT" = "$DEFAULT_BRANCH_HEAD" ]]; then
+#     echo ""
+#     echo "You're not running this script from the HEAD commit on the default branch, 'trunk'."
+#     echo "If you are generating a release you should generally use the latest version of the script."
+#     read -r -p "Are you sure you want the script to proceed? (y/n) "
+#     echo ""
+#     if ! [[ $REPLY =~ ^[Yy]$ ]]; then
+#         abort "Exiting script..."
+#     fi
+# fi
+
+# # Check if script has uncommitted changes
+# if [ -n "$(git status --porcelain)" ]; then
+#     echo "You are running this script with uncommitted changes."
+#     echo "If you are generating a release you should generally use the current version of the script on the develop branch."
+#     read -r -p "Are you sure you want the script to proceed? (y/n) "
+#     echo ""
+#     if ! [[ $REPLY =~ ^[Yy]$ ]]; then
+#         abort "Exiting script..."
+#     fi
+# fi
+
+# # Read GB-Mobile PR template
+# PR_TEMPLATE_PATH='./release_pull_request.md'
+# test -f "$PR_TEMPLATE_PATH" || abort "Error: Could not find PR template at $PR_TEMPLATE_PATH"
+# PR_TEMPLATE=$(cat "$PR_TEMPLATE_PATH")
 
 # Ask for path to gutenberg-mobile directory
 # (default is sibling directory of gutenberg-mobile-release-toolkit)
@@ -96,136 +96,136 @@ source ./release_prechecks.sh "$GB_MOBILE_PATH"
 # Execute script commands from gutenberg-mobile directory
 cd "$GB_MOBILE_PATH"
 
-# Check that Github CLI is installed
-command -v gh >/dev/null || abort "Error: The Github CLI must be installed."
-
-# Check that Github CLI is logged
-gh auth status >/dev/null 2>&1 || abort "Error: You are not logged into any GitHub hosts. Run 'gh auth login' to authenticate."
-
-# Check that jq is installed
-command -v jq >/dev/null || abort "Error: jq must be installed."
-
-# Check that Aztec versions are set to release versions
-aztec_version_problems="$(check_android_and_ios_aztec_versions)"
-if [[ -n "$aztec_version_problems" ]]; then
-    warn "There appear to be problems with the Aztec versions:\n$aztec_version_problems"
-    confirm_to_proceed "Do you want to proceed with the release despite the ^above^ problem(s) with the Aztec version?"
-else
-    ohai "Confirmed that Aztec Libraries are set to release versions. Proceeding..."
-fi
-
-# Check if current HEAD is on trunk
-CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
-if [[ ! "$CURRENT_BRANCH" =~ ^trunk$ ]]; then
-
-    # Check if current HEAD is a release tag
-    CURRENT_TAG=$(git tag --points-at HEAD)
-    if [[ ! "$CURRENT_TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
-        warn "Releases should generally only be based on 'trunk', or a release tag."
-        warn "Gutenberg-Mobile is currently on the '$CURRENT_BRANCH' branch and '$CURRENT_TAG' tag."
-        confirm_to_proceed "Are you sure you want to create a release branch from here?"
-    fi
-fi
-
-# Confirm branch is clean
-[[ -z "$(git status --porcelain)" ]] || { git status; abort "Uncommitted changes found. Aborting release script..."; }
-
-# Ask for new version number
-CURRENT_VERSION_NUMBER=$(jq '.version' package.json --raw-output)
-echo "Current Version Number:$CURRENT_VERSION_NUMBER"
-read -r -p "Enter the new version number: " VERSION_NUMBER
-if [[ -z "$VERSION_NUMBER" ]]; then
-    abort "Version number cannot be empty."
-fi
-
-# Ensure javascript dependencies are up-to-date
-read -r -p "Run 'npm ci' to ensure javascript dependencies are up-to-date? (y/n) " -n 1
-echo ""
-if [[ $REPLY =~ ^[Yy]$ ]]; then
-    execute "npm" "ci"
-fi
-
-# 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 [[ -n "$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
+# # Check that Github CLI is installed
+# command -v gh >/dev/null || abort "Error: The Github CLI must be installed."
+
+# # Check that Github CLI is logged
+# gh auth status >/dev/null 2>&1 || abort "Error: You are not logged into any GitHub hosts. Run 'gh auth login' to authenticate."
+
+# # Check that jq is installed
+# command -v jq >/dev/null || abort "Error: jq must be installed."
+
+# # Check that Aztec versions are set to release versions
+# aztec_version_problems="$(check_android_and_ios_aztec_versions)"
+# if [[ -n "$aztec_version_problems" ]]; then
+#     warn "There appear to be problems with the Aztec versions:\n$aztec_version_problems"
+#     confirm_to_proceed "Do you want to proceed with the release despite the ^above^ problem(s) with the Aztec version?"
+# else
+#     ohai "Confirmed that Aztec Libraries are set to release versions. Proceeding..."
+# fi
+
+# # Check if current HEAD is on trunk
+# CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+# if [[ ! "$CURRENT_BRANCH" =~ ^trunk$ ]]; then
+
+#     # Check if current HEAD is a release tag
+#     CURRENT_TAG=$(git tag --points-at HEAD)
+#     if [[ ! "$CURRENT_TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
+#         warn "Releases should generally only be based on 'trunk', or a release tag."
+#         warn "Gutenberg-Mobile is currently on the '$CURRENT_BRANCH' branch and '$CURRENT_TAG' tag."
+#         confirm_to_proceed "Are you sure you want to create a release branch from here?"
+#     fi
+# fi
+
+# # Confirm branch is clean
+# [[ -z "$(git status --porcelain)" ]] || { git status; abort "Uncommitted changes found. Aborting release script..."; }
+
+# # Ask for new version number
+# CURRENT_VERSION_NUMBER=$(jq '.version' package.json --raw-output)
+# echo "Current Version Number:$CURRENT_VERSION_NUMBER"
+# read -r -p "Enter the new version number: " VERSION_NUMBER
+# if [[ -z "$VERSION_NUMBER" ]]; then
+#     abort "Version number cannot be empty."
+# fi
+
+# # Ensure javascript dependencies are up-to-date
+# read -r -p "Run 'npm ci' to ensure javascript dependencies are up-to-date? (y/n) " -n 1
+# echo ""
+# if [[ $REPLY =~ ^[Yy]$ ]]; then
+#     execute "npm" "ci"
+# fi
+
+# # 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 [[ -n "$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"
+RELEASE_BRANCH="release/test"
 ohai "Create Git branch '$RELEASE_BRANCH' in gutenberg-mobile."
 execute "git" "switch" "-c" "$RELEASE_BRANCH"
 
-# Create Git branch in Gutenberg
-GB_RELEASE_BRANCH="rnmobile/release_$VERSION_NUMBER"
-ohai "Create Git branch '$GB_RELEASE_BRANCH' in gutenberg."
-cd gutenberg
-execute "git" "switch" "-c" "$GB_RELEASE_BRANCH"
-cd ..
-
-# Set version numbers
-ohai "Set version numbers in package.json files"
-for file in 'package.json' 'package-lock.json' 'gutenberg/packages/react-native-aztec/package.json' 'gutenberg/packages/react-native-bridge/package.json' 'gutenberg/packages/react-native-editor/package.json'; do
-    TEMP_FILE=$(mktemp)
-    execute "jq" ".version = \"$VERSION_NUMBER\"" "$file" > "$TEMP_FILE" "--tab"
-    execute "mv" "$TEMP_FILE" "$file"
-done
-
-# Commit react-native-aztec, react-native-bridge, react-native-editor version update
-ohai "Commit react-native-aztec, react-native-bridge, react-native-editor version update version update"
-cd gutenberg
-git add 'packages/react-native-aztec/package.json' 'packages/react-native-bridge/package.json' 'packages/react-native-editor/package.json'
-execute "git" "commit" "-m" "Release script: Update react-native-editor version to $VERSION_NUMBER"
-cd ..
-
-# Commit gutenberg-mobile version updates
-ohai "Commit gutenberg-mobile version updates"
-git add 'package.json' 'package-lock.json'
-execute "git" "commit" "-m" "Release script: Update gb mobile version to $VERSION_NUMBER"
-
-# Make sure podfile is updated
-ohai "Make sure podfile is updated"
-PRE_IOS_COMMAND="npm run core preios"
-eval "$PRE_IOS_COMMAND"
-
-# If preios results in changes, commit them
-cd gutenberg
-if [[ -n "$(git status --porcelain)" ]]; then
-    ohai "Commit changes from '$PRE_IOS_COMMAND'"
-    execute "git" "commit" "-a" "-m" "Release script: Update with changes from '$PRE_IOS_COMMAND'"
-else
-    ohai "There were no changes from '$PRE_IOS_COMMAND' to be committed."
-fi
-cd ..
-
-# Ask if a cherry-pick is needed before bundling (for example if this is a hotfix release)
-cd gutenberg
-CHERRY_PICK_PROMPT="Do you want to cherry-pick a commit from gutenberg? (y/n) "
-while
-  read -r -p "$CHERRY_PICK_PROMPT" -n 1
-  echo ""
-  [[ $REPLY =~ ^[Yy]$ ]]
-do
-  read -r -p "Enter the commit hash to cherry-pick: " GUTENBERG_COMMIT_HASH_TO_CHERRY_PICK
-  execute "git" "cherry-pick" "$GUTENBERG_COMMIT_HASH_TO_CHERRY_PICK"
-  CHERRY_PICK_PROMPT="Do you want to cherry-pick another commit from gutenberg? (y/n) "
-done
-cd ..
-
-# Commit updates to gutenberg submodule
-ohai "Commit updates to gutenberg submodule"
-execute "git" "add" "gutenberg"
-execute "git" "commit" "-m" "Release script: Update gutenberg ref"
-
-# Update the bundles
-ohai "Update the bundles"
-npm run bundle || abort "Error: '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 ci'."
-
-# Commit bundle changes
-ohai "Commit bundle changes"
-execute "git" "add" "bundle/"
-execute "git" "commit" "-m" "Release script: Update bundle for: $VERSION_NUMBER"
+# # Create Git branch in Gutenberg
+# GB_RELEASE_BRANCH="rnmobile/release_$VERSION_NUMBER"
+# ohai "Create Git branch '$GB_RELEASE_BRANCH' in gutenberg."
+# cd gutenberg
+# execute "git" "switch" "-c" "$GB_RELEASE_BRANCH"
+# cd ..
+
+# # Set version numbers
+# ohai "Set version numbers in package.json files"
+# for file in 'package.json' 'package-lock.json' 'gutenberg/packages/react-native-aztec/package.json' 'gutenberg/packages/react-native-bridge/package.json' 'gutenberg/packages/react-native-editor/package.json'; do
+#     TEMP_FILE=$(mktemp)
+#     execute "jq" ".version = \"$VERSION_NUMBER\"" "$file" > "$TEMP_FILE" "--tab"
+#     execute "mv" "$TEMP_FILE" "$file"
+# done
+
+# # Commit react-native-aztec, react-native-bridge, react-native-editor version update
+# ohai "Commit react-native-aztec, react-native-bridge, react-native-editor version update version update"
+# cd gutenberg
+# git add 'packages/react-native-aztec/package.json' 'packages/react-native-bridge/package.json' 'packages/react-native-editor/package.json'
+# execute "git" "commit" "-m" "Release script: Update react-native-editor version to $VERSION_NUMBER"
+# cd ..
+
+# # Commit gutenberg-mobile version updates
+# ohai "Commit gutenberg-mobile version updates"
+# git add 'package.json' 'package-lock.json'
+# execute "git" "commit" "-m" "Release script: Update gb mobile version to $VERSION_NUMBER"
+
+# # Make sure podfile is updated
+# ohai "Make sure podfile is updated"
+# PRE_IOS_COMMAND="npm run core preios"
+# eval "$PRE_IOS_COMMAND"
+
+# # If preios results in changes, commit them
+# cd gutenberg
+# if [[ -n "$(git status --porcelain)" ]]; then
+#     ohai "Commit changes from '$PRE_IOS_COMMAND'"
+#     execute "git" "commit" "-a" "-m" "Release script: Update with changes from '$PRE_IOS_COMMAND'"
+# else
+#     ohai "There were no changes from '$PRE_IOS_COMMAND' to be committed."
+# fi
+# cd ..
+
+# # Ask if a cherry-pick is needed before bundling (for example if this is a hotfix release)
+# cd gutenberg
+# CHERRY_PICK_PROMPT="Do you want to cherry-pick a commit from gutenberg? (y/n) "
+# while
+#   read -r -p "$CHERRY_PICK_PROMPT" -n 1
+#   echo ""
+#   [[ $REPLY =~ ^[Yy]$ ]]
+# do
+#   read -r -p "Enter the commit hash to cherry-pick: " GUTENBERG_COMMIT_HASH_TO_CHERRY_PICK
+#   execute "git" "cherry-pick" "$GUTENBERG_COMMIT_HASH_TO_CHERRY_PICK"
+#   CHERRY_PICK_PROMPT="Do you want to cherry-pick another commit from gutenberg? (y/n) "
+# done
+# cd ..
+
+# # Commit updates to gutenberg submodule
+# ohai "Commit updates to gutenberg submodule"
+# execute "git" "add" "gutenberg"
+# execute "git" "commit" "-m" "Release script: Update gutenberg ref"
+
+# # Update the bundles
+# ohai "Update the bundles"
+# npm run bundle || abort "Error: '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 ci'."
+
+# # Commit bundle changes
+# ohai "Commit bundle changes"
+# execute "git" "add" "bundle/"
+# execute "git" "commit" "-m" "Release script: Update bundle for: $VERSION_NUMBER"
 
 # Update the Podfile for the XCFramework builder project
 #
@@ -245,191 +245,191 @@ cd ..
 # Create PRs
 #####
 
-# Verify before creating PRs
-confirm_to_proceed "Do you want to proceed with creating a Gutenberg-Mobile PR for the $RELEASE_BRANCH branch and a Gutenberg PR for the $GB_RELEASE_BRANCH branch."
-ohai "Proceeding to create PRs..."
+## Verify before creating PRs
+#confirm_to_proceed "Do you want to proceed with creating a Gutenberg-Mobile PR for the $RELEASE_BRANCH branch and a Gutenberg PR for the $GB_RELEASE_BRANCH branch."
+#ohai "Proceeding to create PRs..."
 
-#####
-# Gutenberg-Mobile PR
-#####
+######
+## Gutenberg-Mobile PR
+######
 
-# Replace version number in GB-Mobile PR template
-PR_BODY=${PR_TEMPLATE//v1.XX.Y/$VERSION_NUMBER}
+## Replace version number in GB-Mobile PR template
+#PR_BODY=${PR_TEMPLATE//v1.XX.Y/$VERSION_NUMBER}
 
-execute "git" "push" "-u" "origin" "HEAD"
+#execute "git" "push" "-u" "origin" "HEAD"
 
-# Create Draft GB-Mobile Release PR in GitHub
-GB_MOBILE_PR_URL=$(execute "gh" "pr" "create" \
-"--title" "Release $VERSION_NUMBER" \
-"--body" "$PR_BODY" \
-"--repo" "$MOBILE_REPO/gutenberg-mobile" \
-"--head" "$MOBILE_REPO:$RELEASE_BRANCH" \
-"--base" "$GUTENBERG_MOBILE_TARGET_BRANCH" \
-"--label" "$GUTENBERG_MOBILE_PR_LABEL" \
-"--draft")
+## Create Draft GB-Mobile Release PR in GitHub
+#GB_MOBILE_PR_URL=$(execute "gh" "pr" "create" \
+#"--title" "Release $VERSION_NUMBER" \
+#"--body" "$PR_BODY" \
+#"--repo" "$MOBILE_REPO/gutenberg-mobile" \
+#"--head" "$MOBILE_REPO:$RELEASE_BRANCH" \
+#"--base" "$GUTENBERG_MOBILE_TARGET_BRANCH" \
+#"--label" "$GUTENBERG_MOBILE_PR_LABEL" \
+#"--draft")
 
-#####
-# Gutenberg PR
-#####
+######
+## 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" || abort "Error: Could not find PR template at $GUTENBERG_PR_TEMPLATE_PATH"
-# Get the checklist from the gutenberg PR template by removing everything before the '## Checklist:' line
-CHECKLIST_FROM_GUTENBERG_PR_TEMPLATE=$(sed -e/'## Checklist:'/\{ -e:1 -en\;b1 -e\} -ed < "$GUTENBERG_PR_TEMPLATE_PATH")
-
-# 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"
-
-execute "git" "push" "-u" "origin" "HEAD"
-
-# Create Draft Gutenberg Release PR in GitHub
-GUTENBERG_PR_URL=$(execute "gh" "pr" "create" \
-"--title" "Mobile Release v$VERSION_NUMBER" \
-"--body" "$GUTENBERG_PR_BODY" \
-"--repo" "$GUTENBERG_REPO/gutenberg" \
-"--head" "$GUTENBERG_REPO:$GB_RELEASE_BRANCH" \
-"--base" "$GUTENBERG_TARGET_BRANCH" \
-"--label" "$GUTENBERG_PR_LABEL" \
-"--draft")
-cd ..
+## Get Checklist from Gutenberg PR template
+#cd gutenberg
+#GUTENBERG_PR_TEMPLATE_PATH=".github/PULL_REQUEST_TEMPLATE.md"
+#test -f "$GUTENBERG_PR_TEMPLATE_PATH" || abort "Error: Could not find PR template at $GUTENBERG_PR_TEMPLATE_PATH"
+## Get the checklist from the gutenberg PR template by removing everything before the '## Checklist:' line
+#CHECKLIST_FROM_GUTENBERG_PR_TEMPLATE=$(sed -e/'## Checklist:'/\{ -e:1 -en\;b1 -e\} -ed < "$GUTENBERG_PR_TEMPLATE_PATH")
 
-echo "PRs Created"
-echo "==========="
-printf "Gutenberg-Mobile PR %s \n Gutenberg %s \n" "$GB_MOBILE_PR_URL" "$GUTENBERG_PR_URL" | column -t
+## Construct body for Gutenberg release PR
+#GUTENBERG_PR_BEGINNING="## Description
+#Release $VERSION_NUMBER of the react-native-editor and Gutenberg-Mobile.
 
-confirm_to_proceed "Do you want to proceed with creating main apps (WPiOS and WPAndroid) PRs?"
-ohai "Proceeding to create main apps PRs..."
+#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
 
-GB_MOBILE_PR_REF=$(git rev-parse HEAD)
+#$CHECKLIST_FROM_GUTENBERG_PR_TEMPLATE"
+
+#execute "git" "push" "-u" "origin" "HEAD"
 
-WP_APPS_PR_TITLE="Integrate gutenberg-mobile release $VERSION_NUMBER"
+## Create Draft Gutenberg Release PR in GitHub
+#GUTENBERG_PR_URL=$(execute "gh" "pr" "create" \
+#"--title" "Mobile Release v$VERSION_NUMBER" \
+#"--body" "$GUTENBERG_PR_BODY" \
+#"--repo" "$GUTENBERG_REPO/gutenberg" \
+#"--head" "$GUTENBERG_REPO:$GB_RELEASE_BRANCH" \
+#"--base" "$GUTENBERG_TARGET_BRANCH" \
+#"--label" "$GUTENBERG_PR_LABEL" \
+#"--draft")
+#cd ..
 
-WP_APPS_PR_BODY="## Description
-This PR incorporates the $VERSION_NUMBER release of gutenberg-mobile.
-For more information about this release and testing instructions, please see the related Gutenberg-Mobile PR: $GB_MOBILE_PR_URL
+#echo "PRs Created"
+#echo "==========="
+#printf "Gutenberg-Mobile PR %s \n Gutenberg %s \n" "$GB_MOBILE_PR_URL" "$GUTENBERG_PR_URL" | column -t
 
-Release Submission Checklist
+#confirm_to_proceed "Do you want to proceed with creating main apps (WPiOS and WPAndroid) PRs?"
+#ohai "Proceeding to create main apps PRs..."
 
-- [ ] I have considered if this change warrants user-facing release notes and have added them to \`RELEASE-NOTES.txt\` if necessary."
+#GB_MOBILE_PR_REF=$(git rev-parse HEAD)
 
-WP_APPS_INTEGRATION_BRANCH="gutenberg/integrate_release_$VERSION_NUMBER"
+#WP_APPS_PR_TITLE="Integrate gutenberg-mobile release $VERSION_NUMBER"
 
-#####
-# WPiOS PR
-#####
+#WP_APPS_PR_BODY="## Description
+#This PR incorporates the $VERSION_NUMBER release of gutenberg-mobile.
+#For more information about this release and testing instructions, please see the related Gutenberg-Mobile PR: $GB_MOBILE_PR_URL
 
-read -r -p "Do you want to target $WPIOS_TARGET_BRANCH branch for WPiOS PR? (y/n) " -n 1
-echo ""
-if [[ $REPLY =~ ^[Nn]$ ]]; then
-    read -r -p "Enter the branch name you want to target. Make sure a branch with this name already exists in WPiOS repository: " WPIOS_TARGET_BRANCH
-fi
+#Release Submission Checklist
 
-TEMP_WP_IOS_DIRECTORY=$(mktemp -d)
-ohai "Clone WordPress-iOS into '$TEMP_WP_IOS_DIRECTORY'"
-execute "git" "clone" "-b" "$WPIOS_TARGET_BRANCH" "--depth=1" "[email protected]:$MOBILE_REPO/WordPress-iOS.git" "$TEMP_WP_IOS_DIRECTORY"
+#- [ ] I have considered if this change warrants user-facing release notes and have added them to \`RELEASE-NOTES.txt\` if necessary."
 
-cd "$TEMP_WP_IOS_DIRECTORY"
+#WP_APPS_INTEGRATION_BRANCH="gutenberg/integrate_release_$VERSION_NUMBER"
 
-ohai "Create after_x.xx.x branch in WordPress-iOS"
-execute "git" "switch" "-c" "gutenberg/after_$VERSION_NUMBER"
+######
+## WPiOS PR
+######
 
-execute "git" "push" "-u" "origin" "HEAD"
+#read -r -p "Do you want to target $WPIOS_TARGET_BRANCH branch for WPiOS PR? (y/n) " -n 1
+#echo ""
+#if [[ $REPLY =~ ^[Nn]$ ]]; then
+#    read -r -p "Enter the branch name you want to target. Make sure a branch with this name already exists in WPiOS repository: " WPIOS_TARGET_BRANCH
+#fi
 
-ohai "Create release branch in WordPress-iOS"
-execute "git" "switch" "-c" "gutenberg/integrate_release_$VERSION_NUMBER"
+#TEMP_WP_IOS_DIRECTORY=$(mktemp -d)
+#ohai "Clone WordPress-iOS into '$TEMP_WP_IOS_DIRECTORY'"
+#execute "git" "clone" "-b" "$WPIOS_TARGET_BRANCH" "--depth=1" "[email protected]:$MOBILE_REPO/WordPress-iOS.git" "$TEMP_WP_IOS_DIRECTORY"
 
-ohai "Update GitHub organization and gutenberg-mobile ref"
-version_file="Gutenberg/version.rb"
-test -f "$version_file" || abort "Error: Could not find $version_file"
-sed -i'.orig' -E "s/GITHUB_ORG = 'wordpress-mobile'/GITHUB_ORG = '$MOBILE_REPO'/" $version_file || abort "Error: Failed updating GitHub organization in $version_file"
-sed -i'.orig' -E "s/# commit: '(.*)',/commit: '$GB_MOBILE_PR_REF'/" $version_file || abort "Error: Failed updating gutenberg ref in $version_file (part 1 of 2, setting the commit)"
-sed -i'.orig' -E "s/tag: '(.*)'/# &/" $version_file || abort "Error: Failed updating gutenberg ref in $version_file (part 2 of 2, commenting the tag)"
-execute "bundle" "install"
-execute_until_succeeds "rake" "dependencies"
+#cd "$TEMP_WP_IOS_DIRECTORY"
 
+#ohai "Create after_x.xx.x branch in WordPress-iOS"
+#execute "git" "switch" "-c" "gutenberg/after_$VERSION_NUMBER"
 
-execute "git" "add" "Podfile" "Podfile.lock" "$version_file"
-execute "git" "commit" "-m" "Release script: Update gutenberg-mobile ref"
+#execute "git" "push" "-u" "origin" "HEAD"
 
-ohai "Push integration branch"
-execute "git" "push" "-u" "origin" "HEAD"
+#ohai "Create release branch in WordPress-iOS"
+#execute "git" "switch" "-c" "gutenberg/integrate_release_$VERSION_NUMBER"
 
-# Create Draft WPiOS Release PR in GitHub
-ohai "Create Draft WPiOS Release PR in GitHub"
-WP_IOS_PR_URL=$(execute "gh" "pr" "create" \
-"--title" "$WP_APPS_PR_TITLE" \
-"--body" "$WP_APPS_PR_BODY" \
-"--repo" "$MOBILE_REPO/WordPress-iOS" \
-"--head" "$MOBILE_REPO:$WP_APPS_INTEGRATION_BRANCH" \
-"--base" "$WPIOS_TARGET_BRANCH" \
-"--label" "$WPIOS_PR_LABEL" \
-"--draft")
+#ohai "Update GitHub organization and gutenberg-mobile ref"
+#version_file="Gutenberg/version.rb"
+#test -f "$version_file" || abort "Error: Could not find $version_file"
+#sed -i'.orig' -E "s/GITHUB_ORG = 'wordpress-mobile'/GITHUB_ORG = '$MOBILE_REPO'/" $version_file || abort "Error: Failed updating GitHub organization in $version_file"
+#sed -i'.orig' -E "s/# commit: '(.*)',/commit: '$GB_MOBILE_PR_REF'/" $version_file || abort "Error: Failed updating gutenberg ref in $version_file (part 1 of 2, setting the commit)"
+#sed -i'.orig' -E "s/tag: '(.*)'/# &/" $version_file || abort "Error: Failed updating gutenberg ref in $version_file (part 2 of 2, commenting the tag)"
+#execute "bundle" "install"
+#execute_until_succeeds "rake" "dependencies"
 
-ohai "WPiOS PR Created: $WP_IOS_PR_URL"
-echo ""
 
-#####
-# WPAndroid PR
-#####
-read -r -p "Do you want to target $WPANDROID_TARGET_BRANCH branch for WPAndroid PR? (y/n) " -n 1
-echo ""
-if [[ $REPLY =~ ^[Nn]$ ]]; then
-    read -r -p "Enter the branch name you want to target. Make sure a branch with this name already exists in WPAndroid repository: " WPANDROID_TARGET_BRANCH
-fi
+#execute "git" "add" "Podfile" "Podfile.lock" "$version_file"
+#execute "git" "commit" "-m" "Release script: Update gutenberg-mobile ref"
 
-TEMP_WP_ANDROID_DIRECTORY=$(mktemp -d)
-ohai "Clone WordPress-Android into '$TEMP_WP_ANDROID_DIRECTORY'"
-execute "git" "clone" "-b" "$WPANDROID_TARGET_BRANCH" "--depth=1" "[email protected]:$MOBILE_REPO/WordPress-Android.git" "$TEMP_WP_ANDROID_DIRECTORY"
+#ohai "Push integration branch"
+#execute "git" "push" "-u" "origin" "HEAD"
 
-cd "$TEMP_WP_ANDROID_DIRECTORY"
+## Create Draft WPiOS Release PR in GitHub
+#ohai "Create Draft WPiOS Release PR in GitHub"
+#WP_IOS_PR_URL=$(execute "gh" "pr" "create" \
+#"--title" "$WP_APPS_PR_TITLE" \
+#"--body" "$WP_APPS_PR_BODY" \
+#"--repo" "$MOBILE_REPO/WordPress-iOS" \
+#"--head" "$MOBILE_REPO:$WP_APPS_INTEGRATION_BRANCH" \
+#"--base" "$WPIOS_TARGET_BRANCH" \
+#"--label" "$WPIOS_PR_LABEL" \
+#"--draft")
 
-# This is still needed because of Android Stories.
-execute "git" "submodule" "update" "--init" "--recursive" "--depth=1" "--recommend-shallow"
+#ohai "WPiOS PR Created: $WP_IOS_PR_URL"
+#echo ""
 
-ohai "Create after_x.xx.x branch in WordPress-Android"
-execute "git" "switch" "-c" "gutenberg/after_$VERSION_NUMBER"
+######
+## WPAndroid PR
+######
+#read -r -p "Do you want to target $WPANDROID_TARGET_BRANCH branch for WPAndroid PR? (y/n) " -n 1
+#echo ""
+#if [[ $REPLY =~ ^[Nn]$ ]]; then
+#    read -r -p "Enter the branch name you want to target. Make sure a branch with this name already exists in WPAndroid repository: " WPANDROID_TARGET_BRANCH
+#fi
 
-execute "git" "push" "-u" "origin" "HEAD"
+#TEMP_WP_ANDROID_DIRECTORY=$(mktemp -d)
+#ohai "Clone WordPress-Android into '$TEMP_WP_ANDROID_DIRECTORY'"
+#execute "git" "clone" "-b" "$WPANDROID_TARGET_BRANCH" "--depth=1" "[email protected]:$MOBILE_REPO/WordPress-Android.git" "$TEMP_WP_ANDROID_DIRECTORY"
 
-ohai "Create release branch in WordPress-Android"
-execute "git" "switch" "-c" "$WP_APPS_INTEGRATION_BRANCH"
+#cd "$TEMP_WP_ANDROID_DIRECTORY"
 
-# Get the last part of the path from GB_MOBILE_PR_URL
-PULL_ID=${GB_MOBILE_PR_URL##*/}
+## This is still needed because of Android Stories.
+#execute "git" "submodule" "update" "--init" "--recursive" "--depth=1" "--recommend-shallow"
 
-ohai "Update build.gradle file with the latest version"
-test -f "build.gradle" || abort "Error: Could not find build.gradle"
-sed -i '' -E "s/gutenbergMobileVersion = '(.*)'/gutenbergMobileVersion = '${PULL_ID}-$GB_MOBILE_PR_REF'/" build.gradle || abort "Error: Failed updating gutenbergMobileVersion in build.gradle"
+#ohai "Create after_x.xx.x branch in WordPress-Android"
+#execute "git" "switch" "-c" "gutenberg/after_$VERSION_NUMBER"
 
-execute "git" "add" "build.gradle"
-execute "git" "commit" "-m" "Release script: Update build.gradle gutenbergMobileVersion to ref"
+#execute "git" "push" "-u" "origin" "HEAD"
 
-ohai "Push integration branch"
-execute "git" "push" "-u" "origin" "HEAD"
+#ohai "Create release branch in WordPress-Android"
+#execute "git" "switch" "-c" "$WP_APPS_INTEGRATION_BRANCH"
 
-# Create Draft WPAndroid Release PR in GitHub
-ohai "Create Draft WPAndroid Release PR in GitHub"
-WP_ANDROID_PR_URL=$(execute "gh" "pr" "create" \
-"--title" "$WP_APPS_PR_TITLE" \
-"--body" "$WP_APPS_PR_BODY" --repo "$MOBILE_REPO/WordPress-Android" \
-"--head" "$MOBILE_REPO:$WP_APPS_INTEGRATION_BRANCH" \
-"--base" "$WPANDROID_TARGET_BRANCH" \
-"--label" "$WPANDROID_PR_LABEL" \
-"--draft")
+## Get the last part of the path from GB_MOBILE_PR_URL
+#PULL_ID=${GB_MOBILE_PR_URL##*/}
 
-ohai "WPAndroid PR Created: $WP_ANDROID_PR_URL"
-echo ""
+#ohai "Update build.gradle file with the latest version"
+#test -f "build.gradle" || abort "Error: Could not find build.gradle"
+#sed -i '' -E "s/gutenbergMobileVersion = '(.*)'/gutenbergMobileVersion = '${PULL_ID}-$GB_MOBILE_PR_REF'/" build.gradle || abort "Error: Failed updating gutenbergMobileVersion in build.gradle"
+
+#execute "git" "add" "build.gradle"
+#execute "git" "commit" "-m" "Release script: Update build.gradle gutenbergMobileVersion to ref"
+
+#ohai "Push integration branch"
+#execute "git" "push" "-u" "origin" "HEAD"
+
+## Create Draft WPAndroid Release PR in GitHub
+#ohai "Create Draft WPAndroid Release PR in GitHub"
+#WP_ANDROID_PR_URL=$(execute "gh" "pr" "create" \
+#"--title" "$WP_APPS_PR_TITLE" \
+#"--body" "$WP_APPS_PR_BODY" --repo "$MOBILE_REPO/WordPress-Android" \
+#"--head" "$MOBILE_REPO:$WP_APPS_INTEGRATION_BRANCH" \
+#"--base" "$WPANDROID_TARGET_BRANCH" \
+#"--label" "$WPANDROID_PR_LABEL" \
+#"--draft")
+
+#ohai "WPAndroid PR Created: $WP_ANDROID_PR_URL"
+#echo ""
 
 
 
-echo "Main apps PRs created"
-echo "==========="
-printf "WPAndroid %s \n WPiOS %s \n" "$WP_ANDROID_PR_URL" "$WP_IOS_PR_URL" | column -t
+#echo "Main apps PRs created"
+#echo "==========="
+#printf "WPAndroid %s \n WPiOS %s \n" "$WP_ANDROID_PR_URL" "$WP_IOS_PR_URL" | column -t

release_automation.sh Outdated Show resolved Hide resolved
release_automation.sh Outdated Show resolved Hide resolved
This is necessary after the introduction of the XCFramework builder
project in
wordpress-mobile/gutenberg-mobile#5739 and
wordpress-mobile/gutenberg-mobile#5740.

Worth noting that the XCFramework distribution pipeline and integration
in Jetpack and WordPress iOS is currently incomplete. The step is
required to avoid a CI failure but has not effect on the quality of the
final release. This will hopefully change within the next couple of
releases.
@mokagio mokagio force-pushed the mokagio/add-pod-install-to-automation branch from 6b692c7 to b5cf259 Compare May 25, 2023 02:17
Comment on lines 230 to 239
# Update the Podfile for the XCFramework builder project
#
# We use a dedicated Xcode project to build the iOS distribution XCFramework which uses CocoaPods to fetch React Native dependencies and which references the project version.
# It's necessary to keep the versions up to day in the project's lockfile.
ohai 'Update XCFramework builders project Podfile.lock'
cd ios-xcframework
execute 'bundle' 'install'
execute 'bundle' 'exec' 'pod' 'install'
execute 'git' 'commit' '-m' "Release script: Sync XCFramework \`Podfile.lock\` with $VERSION_NUMBER"
cd ..
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a straightforward way to test this in isolation?

For reference, here's a link to the ios-xcframework folder in the gutenberg-mobile.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a straightforward way to test this in isolation?

Not really, but you can follow these testing instructions from the script. It mainly implies forking the repositories.

# INSTRUCTIONS FOR TESTING FROM FORKED REPOS
# Prerequisites:
# 1. Fork the following repos to your github user repo:
# a) Gutenberg-Mobile: https://github.com/wordpress-mobile/gutenberg-mobile
# * .gitmodules on CURRENT_BRANCH should reference your gutenberg fork, replace 'WordPress' with GITHUB_USERNAME
# * (https://github.com/wordpress-mobile/gutenberg-mobile/blob/trunk/.gitmodules)
# b) Gutenberg: https://github.com/WordPress/gutenberg
# c) WordPress-Android: https://github.com/wordpress-mobile/WordPress-Android
# d) WordPress-iOS: https://github.com/wordpress-mobile/WordPress-iOS
# 2. Insure that each of your forked repos contains the PR labels specified below:
GUTENBERG_MOBILE_PR_LABEL="release-process"
GUTENBERG_PR_LABEL="Mobile App - i.e. Android or iOS"
WPANDROID_PR_LABEL="Gutenberg"
WPIOS_PR_LABEL="Gutenberg"
# 3. Ensure that each of your repos contains the target branch listed below:
GUTENBERG_MOBILE_TARGET_BRANCH="trunk"
GUTENBERG_TARGET_BRANCH="trunk"
WPANDROID_TARGET_BRANCH="trunk"
WPIOS_TARGET_BRANCH="trunk"
# 4. Update the repo names below to the user repo name for your fork
GUTENBERG_REPO="WordPress"
MOBILE_REPO="wordpress-mobile"
# GUTENBERG_REPO="YOUR_GITHUB_USERNAME"
# MOBILE_REPO="YOUR_GITHUB_USERNAME"
# 5. Clone the forked gutenberg-mobile repo
# 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 trunk, or a release tag
# - Release is being created off of a clean branch
# - Whether there are any open PRs targeting the milestone for the release

In my case, what I usually do is comment out parts of the script I don't want to be executed (e.g. PR/branch creation) and test locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought so 😄

In my case, what I usually do is comment out parts of the script I don't want to be executed (e.g. PR/branch creation) and test locally.

Cool. I did that too and updated the PR description. I'm glad I did, because it reveal that I had forgotten to git add the modified file.

Comment on lines 230 to 239
# Update the Podfile for the XCFramework builder project
#
# We use a dedicated Xcode project to build the iOS distribution XCFramework which uses CocoaPods to fetch React Native dependencies and which references the project version.
# It's necessary to keep the versions up to day in the project's lockfile.
ohai 'Update XCFramework builders project Podfile.lock'
cd ios-xcframework
execute 'bundle' 'install'
execute 'bundle' 'exec' 'pod' 'install'
execute 'git' 'commit' '-m' "Release script: Sync XCFramework \`Podfile.lock\` with $VERSION_NUMBER"
cd ..
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to use execute only for the bundle and git commands to be consistent with what the rest of the script does when calling cd.

@mokagio mokagio requested a review from fluiddot May 26, 2023 04:45
Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎊 ! I tested the script locally and confirmed that ios-xcframework/Podfile.lock was updated and committed. In my case, I tested bumping the editor version to 1.96.1 and got the following changes:

--- a/ios-xcframework/Podfile.lock
+++ b/ios-xcframework/Podfile.lock
@@ -386,7 +386,7 @@ PODS:
     - React-Core
   - RNSVG (9.13.6):
     - React-Core
-  - RNTAztecView (1.96.0):
+  - RNTAztecView (1.96.1):
     - React-Core
     - WordPress-Aztec-iOS (~> 1.19.8)
   - SDWebImage (5.11.1):
@@ -601,7 +601,7 @@ SPEC CHECKSUMS:
   RNReanimated: 8abe8173f54110a9ae98a629d0d8bf343a84f739
   RNScreens: bd1f43d7dfcd435bc11d4ee5c60086717c45a113
   RNSVG: 259ef12cbec2591a45fc7c5f09d7aa09e6692533
-  RNTAztecView: 0d03d4841b9c2086bb2fe23d9069882b6528ab34
+  RNTAztecView: cd31152d7c144a834b2103a9b5d6cba5b442fb76
   SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
   SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
   WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504

@fluiddot
Copy link
Contributor

fluiddot commented May 30, 2023

@mokagio I bumped into an issue when installing Pods in the XCFramework folder and generating the RN bundle (e.g. running npm command npm run bundle:android).

Error:

error While trying to resolve module `react-native` from file `<WORKSPACE>/gutenberg-mobile/block-experiments/blocks/layout-grid/src/grid/edit.native.js`, the package `<WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`<WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index`. Indeed, none of these files exist:

  * <WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index(.native|.android.js|.native.js|.js|.android.cjs|.native.cjs|.cjs|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * <WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index/index(.native|.android.js|.native.js|.js|.android.cjs|.native.cjs|.cjs|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx).
Error: While trying to resolve module `react-native` from file `<WORKSPACE>/gutenberg-mobile/block-experiments/blocks/layout-grid/src/grid/edit.native.js`, the package `<WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`<WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index`. Indeed, none of these files exist:

  * <WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index(.native|.android.js|.native.js|.js|.android.cjs|.native.cjs|.cjs|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * <WORKSPACE>/gutenberg-mobile/ios-xcframework/Pods/React/index/index(.native|.android.js|.native.js|.js|.android.cjs|.native.cjs|.cjs|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
    at DependencyGraph.resolveDependency (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/node-haste/DependencyGraph.js:243:17)
    at Object.resolve (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/lib/transformHelpers.js:129:24)
    at resolve (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
    at <WORKSPACE>/gutenberg-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
    at processModule (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async addDependency (<WORKSPACE>/gutenberg-mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)

Seems Metro is trying to resolve React Native using the React package from one of the Pods. Maybe we could tweak the Metro configuration somehow to ignore it. I can try to take a look at this in the next few days.

@mokagio
Copy link
Contributor Author

mokagio commented May 31, 2023

Thanks @fluiddot

Ah, I run into that too and tried to make the automation ignore the ios-xcframework folder tinkering the config files but didn't get to the bottom of it. My issue was when trying to run tests, though. The ones I tried were Jest's and Watchman's.

Ultimately, I brushed that away assuming that "no one would need to use the XCFramework project locally," 😓 That's obviously an unsatisfactory conclusion.

Fingers crossed you can sort it out 🤞

@mokagio mokagio merged commit ac0e2a3 into trunk May 31, 2023
@mokagio mokagio deleted the mokagio/add-pod-install-to-automation branch May 31, 2023 05:33
@fluiddot
Copy link
Contributor

Ultimately, I brushed that away assuming that "no one would need to use the XCFramework project locally," 😓 That's obviously an unsatisfactory conclusion.

I think I forgot to mention that I ran into the issue after running the release script for testing this PR. So, I think that with this change we might start experiencing it after cutting a new release. Note that the script by default will install the Pods in the same Gutenberg Mobile project we use for development.

I'll try to spare some time today on this and find out how to tweak Metro's configuration to ignore files/folders.

@fluiddot
Copy link
Contributor

I'll try to spare some time today on this and find out how to tweak Metro's configuration to ignore files/folders.

I found a Metro configuration parameter to solve this, I created wordpress-mobile/gutenberg-mobile#5819 with the fix. @mokagio let me know if you could take a quick look, thanks 🙇 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants