Skip to content

Commit

Permalink
chore: fix release pr fixes (#12192)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This PR is an attempt to resolve deficiencies with the "Create Release
Pull Request" shared workflow.
Currently it is not correctly provisioning the release branch before
creating a PR which is causing the script to fail.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes:

Execution bug

## **Manual testing steps**

Unfortunately this cannot be tested outside of the main branch CI,
however we have a high confidence of this fix as a previous version of
this workflow used to do this step so we are reintroducing the logic

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

N/A - CICD Only

### **Before**

<!-- [screenshots/recordings] -->
N/A

### **After**

<!-- [screenshots/recordings] -->
N/A

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
jake-perkins authored Nov 5, 2024
1 parent 6511a0d commit b2259b8
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,50 @@ RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}. The chan
# Reference
- Testing plan sheet - https://docs.google.com/spreadsheets/d/1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ/edit?gid=404070372#gid=404070372"

echo "Configuring git.."
git config user.name metamaskbot
git config user.email [email protected]

echo "Checking out ${RELEASE_BRANCH_NAME}"
git checkout "${RELEASE_BRANCH_NAME}"
echo "Release Branch Checked Out"

echo "Running version update scripts.."
# Bump versions for the release
./scripts/set-semvar-version.sh "${NEW_VERSION}"
./scripts/set-build-version.sh "${NEW_VERSION_NUMBER}"

echo "Adding and committing changes.."
# Track our changes
git add package.json android/app/build.gradle ios/MetaMask/Info.plist bitrise.yml

# Generate a commit
git commit -m "bump semvar version to ${NEW_VERSION} && build version to ${NEW_VERSION_NUMBER}"

echo "Pushing changes to the remote.."
git push --set-upstream origin "${RELEASE_BRANCH_NAME}"

echo Creating release PR..

gh pr create \
--draft \
--title "feat: ${NEW_VERSION}" \
--body "${RELEASE_BODY}" \
--head "${RELEASE_BRANCH_NAME}";

echo "Release PR Created"

git checkout "${RELEASE_BRANCH_NAME}"
echo "Release Branch Checked Out"

echo "Checking out ${CHANGELOG_BRANCH_NAME}"
git checkout -b "${CHANGELOG_BRANCH_NAME}"
echo "Changelog Branch Created"

#Generate changelog and test plan csv
echo "Generating changelog and test plan csv.."
node ./scripts/generate-rc-commits.mjs "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}"
./scripts/changelog-csv.sh "${RELEASE_BRANCH_NAME}"

echo "Adding and committing changes.."
git add ./commits.csv

if ! (git commit -am "updated changelog and generated feature test plan");
Expand All @@ -74,11 +89,15 @@ fi

PR_BODY="This PR updates the change log for ${NEW_VERSION} and generates the test plan here [commit.csv](https://github.com/MetaMask/metamask-mobile/blob/${RELEASE_BRANCH_NAME}/commits.csv)"

echo "Pushing changes to the remote.."
git push --set-upstream origin "${CHANGELOG_BRANCH_NAME}"

echo Creating release PR..
gh pr create \
--draft \
--title "chore: ${CHANGELOG_BRANCH_NAME}" \
--body "${PR_BODY}" \
--base "${RELEASE_BRANCH_NAME}" \
--head "${CHANGELOG_BRANCH_NAME}";
--head "${CHANGELOG_BRANCH_NAME}";

echo "Changelog PR Created"

0 comments on commit b2259b8

Please sign in to comment.