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

chore: cicd error handling #12194

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ jobs:
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: ${{ github.event.inputs.base-branch }}
run: |
./scripts/create-release-pr.sh ${{ github.event.inputs.previous-version-tag }} ${{ github.event.inputs.semver-version }} ${{ needs.generate-build-version.outputs.build-version }}
16 changes: 13 additions & 3 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ 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 "Fetching from remote..."
git fetch

# Check if the release branch already exists on the remote
if git branch -a | grep -q "remotes/origin/${RELEASE_BRANCH_NAME}"; then
echo "Release branch exists on remote, checking out."
git checkout "${RELEASE_BRANCH_NAME}"
else
echo "Release branch does not exist on remote, creating from ${BASE_BRANCH}."
git checkout -b "${RELEASE_BRANCH_NAME}"
fi

echo "Release Branch Checked Out"

echo "Running version update scripts.."
Expand All @@ -50,7 +60,7 @@ echo "Running version update scripts.."

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

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