Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: making some tests before passing draft
  • Loading branch information
alucardzom committed Jul 4, 2025
commit b3aff485a505dca99dced3ce85fee7d76270ddea
27 changes: 14 additions & 13 deletions .github/scripts/create-platform-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ if [[ -z $NEW_VERSION_NUMBER && $PLATFORM == "mobile" ]]; then
exit 1
fi

if [[ -z $RELEASE_BRANCH_NAMING ]]; then
echo "Error: No release branch naming specified."
exit 1
fi


# Helper Functions
# ---------------
Expand Down Expand Up @@ -78,9 +73,9 @@ get_release_branch_name() {
fi

# Use consistent release branch naming for all platforms
echo "$RELEASE_BRANCH_NAMING${new_version}"
echo "release/${new_version}"

# Different release branch naming for different platforms
# Different release branch naming for different platforms, commented in case of need it
# if [[ "$platform" == "mobile" ]]; then
# echo "release/${new_version}"
# elif [[ "$platform" == "extension" ]]; then
Expand Down Expand Up @@ -220,17 +215,23 @@ yarn --cwd install
echo "Generating test plan csv.."
yarn run gen:commits "${PLATFORM}" "${PREVIOUS_VERSION}" "${RELEASE_BRANCH_NAME}" "${PROJECT_GIT_DIR}"

# if [[ "${TEST_ONLY:-false}" == 'false' ]]; then
# echo "Updating release sheet.."
# # Create a new Release Sheet Page for the new version with our commits.csv content
# yarn run update-release-sheet "${PLATFORM}" "${NEW_VERSION}" "${GOOGLE_DOCUMENT_ID}" "./commits.csv" "${PROJECT_GIT_DIR}" "${MOBILE_TEMPLATE_SHEET_ID}" "${EXTENSION_TEMPLATE_SHEET_ID}"
# fi
if [[ "${TEST_ONLY:-false}" == 'false' ]]; then
echo "Updating release sheet.."
# Create a new Release Sheet Page for the new version with our commits.csv content
yarn run update-release-sheet "${PLATFORM}" "${NEW_VERSION}" "${GOOGLE_DOCUMENT_ID}" "./commits.csv" "${PROJECT_GIT_DIR}" "${MOBILE_TEMPLATE_SHEET_ID}" "${EXTENSION_TEMPLATE_SHEET_ID}"
fi
cd ../

# Commit and Push Changelog Changes
# -------------------------------
echo "Adding and committing changes.."
git add ./commits.csv
# Add commits.csv file if it exists
if [ -f "./commits.csv" ]; then
echo "commits.csv found, adding to git..."
git add ./commits.csv
else
echo "--> commits.csv not found, skipping..."
fi


if ! (git commit -am "updated changelog and generated feature test plan");
Expand Down
39 changes: 39 additions & 0 deletions .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,45 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
try {
const git = simpleGit();

// Fetch all branches from remote to ensure we have the latest references
console.log('Fetching branches from remote...');
await git.fetch('origin', ['--all']);

// Check if branches exist
console.log(`Checking if branches exist: ${branchA} and ${branchB}`);

try {
await git.revparse(['--verify', branchA]);
console.log(`✓ Branch ${branchA} exists`);
} catch (error) {
console.error(`✗ Branch ${branchA} does not exist locally`);
// Try to check if it exists remotely
try {
await git.revparse(['--verify', `origin/${branchA}`]);
console.log(`✓ Branch origin/${branchA} exists, using remote reference`);
branchA = `origin/${branchA}`;
} catch (remoteError) {
console.error(`✗ Branch ${branchA} does not exist remotely either`);
throw new Error(`Branch ${branchA} not found locally or remotely`);
}
}

try {
await git.revparse(['--verify', branchB]);
console.log(`✓ Branch ${branchB} exists`);
} catch (error) {
console.error(`✗ Branch ${branchB} does not exist locally`);
// Try to check if it exists remotely
try {
await git.revparse(['--verify', `origin/${branchB}`]);
console.log(`✓ Branch origin/${branchB} exists, using remote reference`);
branchB = `origin/${branchB}`;
} catch (remoteError) {
console.error(`✗ Branch ${branchB} does not exist remotely either`);
throw new Error(`Branch ${branchB} not found locally or remotely`);
}
}

const logOptions = {
from: branchB,
to: branchA,
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,10 @@ on:
type: string
description: 'The platform for which the release PR is being created.'
github-tools-version:
required: false
type: string
description: 'The version of github-tools to use. Defaults to main.'
default: 'main'
release-branch-naming:
required: false
type: string
description: 'The naming convention for the release branch.'
default: 'release/'
secrets:
github-token:
required: true
Expand All @@ -71,6 +67,11 @@ jobs:
pull-requests: write
steps:

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

# Step 1: Checkout invoking repository (metamask-mobile | metamask-extension )
- name: Checkout invoking repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -103,7 +104,6 @@ jobs:
echo "Semver Version: ${{ inputs.semver-version }}"
echo "Previous Version Tag: ${{ inputs.previous-version-tag }}"
echo "Test Only Mode: ${{ inputs.test-only }}"
echo "Release Branch Naming: ${{ inputs.release-branch-naming }}"
if [[ "${{ inputs.platform }}" == "mobile" ]]; then
echo "Mobile Build Version: ${{ inputs.mobile-build-version }}"
fi
Expand All @@ -116,7 +116,7 @@ jobs:
echo "GitHub SHA: ${{ github.sha }}"
echo "-------------"

# Step 5: Create Release PR
# # Step 5: Create Release PR
- name: Create Release PR
id: create-release-pr
shell: bash
Expand All @@ -125,7 +125,6 @@ jobs:
BASE_BRANCH: ${{ inputs.base-branch }}
GITHUB_REPOSITORY_URL: '${{ github.server_url }}/${{ github.repository }}'
TEST_ONLY: ${{ inputs.test-only }}
RELEASE_BRANCH_NAMING: ${{ inputs.release-branch-naming }}
GOOGLE_DOCUMENT_ID: ${{ inputs.release-sheet-google-document-id }}
GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.google-application-creds-base64 }}
NEW_VERSION: ${{ inputs.semver-version }}
Expand Down
Loading