Skip to content

Commit

Permalink
chore: fix release action (#10531)
Browse files Browse the repository at this point in the history
## **Description**

The current [release action
fails](https://github.com/MetaMask/metamask-mobile/actions/runs/10011339127/job/27674536322#step:6:25)
due when it tries to push the changelog updates to the protected release
branch.

It also updates the build_all_targets_pipeline to start QA and Prod
builds at the same time instead of staggering them.

## **Related issues**

Fixes: AN

## **Manual testing steps**

1. NA
2.
3.

## **Screenshots/Recordings**

NA

### **Before**

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

### **After**

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

## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.

---------

Co-authored-by: metamaskbot <[email protected]>
  • Loading branch information
sethkfman and metamaskbot authored Aug 1, 2024
1 parent 144fd92 commit d7586ee
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
11 changes: 7 additions & 4 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ pipelines:
#Builds MetaMask, MetaMask-QA apps and stores apk/ipa in Bitrise
build_all_targets_pipeline:
stages:
- create_build_release: {}
- create_build_qa: {} #Generate QA builds for E2E app upgrade tests
- create_build_all_targets: {}
#Releases MetaMask apps and stores apk/ipa into Play(Internal Testing)/App(TestFlight) Store
release_builds_to_store_pipeline:
stages:
Expand Down Expand Up @@ -73,6 +72,12 @@ pipelines:

#Stages reference workflows. Those workflows cannot but utility "_this-is-a-utility"
stages:
create_build_all_targets:
workflows:
- build_android_release: {}
- build_ios_release: {}
- build_android_qa: {}
- build_ios_qa: {}
create_build_release:
workflows:
- build_android_release: {}
Expand Down Expand Up @@ -1498,8 +1503,6 @@ trigger_map:
pipeline: release_e2e_pipeline
- push_branch: main
pipeline: pr_smoke_e2e_pipeline
- tag: 'v*.*.*-RC-*'
pipeline: release_builds_to_store_pipeline
- tag: 'qa-*'
pipeline: create_qa_builds_pipeline
- tag: 'dev-e2e-*'
Expand Down
27 changes: 24 additions & 3 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ if [[ -z $NEW_VERSION ]]; then
fi

RELEASE_BRANCH_NAME="${RELEASE_BRANCH_PREFIX}${NEW_VERSION}"
RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}. The test plan can be found at [commit.csv](https://github.com/MetaMask/metamask-mobile/blob/${RELEASE_BRANCH_NAME}/commits.csv)"
CHANGELOG_BRANCH_NAME="chore/${NEW_VERSION}-Changelog"
RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}. The changelog will be found in another PR ${CHANGELOG_BRANCH_NAME}."

git config user.name metamaskbot
git config user.email [email protected]
Expand All @@ -35,9 +36,29 @@ gh pr create \
--body "${RELEASE_BODY}" \
--head "${RELEASE_BRANCH_NAME}";


git checkout -b "${CHANGELOG_BRANCH_NAME}"


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

git add ./commits.csv
git commit -am "updated changelog and generated feature test plan"
git push

if ! (git commit -am "updated changelog and generated feature test plan");
then
echo "Error: No changes detected."
exit 1
fi

PR_BODY="This is PR updateds 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)"

git push --set-upstream origin "${CHANGELOG_BRANCH_NAME}"

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

0 comments on commit d7586ee

Please sign in to comment.