From 69165c38354d5994b9bcf6c741b616d08942e513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 29 Aug 2024 12:47:08 +0100 Subject: [PATCH 01/18] feat(INFRA-2045): ci and script to push bundle size --- .github/workflows/ci.yml | 18 +++++++++ scripts/push-bundle-size.sh | 75 +++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 scripts/push-bundle-size.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64bd5bea831..2ed0d90bff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,6 +174,24 @@ jobs: - name: Check bundle size run: ./scripts/js-bundle-stats.sh ios/main.jsbundle 40 + - name: Upload iOS bundle + uses: actions/upload-artifact@v3 + with: + name: ios-bundle + path: ios/main.jsbundle + + ship-js-bundle-size-check: + runs-on: ubuntu-20.04 + needs: [setup, js-bundle-size-check] + steps: + - name: Download iOS bundle + uses: actions/download-artifact@v3 + with: + name: ios-bundle + + - name: Push bundle size to mobile_bundlesize_stats repo + run: ./scripts/push-bundle-size.sh + sonar-cloud: runs-on: ubuntu-20.04 needs: merge-unit-tests diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh new file mode 100644 index 00000000000..b2f4b7efe1f --- /dev/null +++ b/scripts/push-bundle-size.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# Function to log messages +log() { + echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1" +} + +# Check if running in GitHub Actions +if [[ "${GITHUB_ACTIONS:-}" != 'true' ]]; then + log "Error: This script must be run in a GitHub Actions environment" + exit 1 +fi + +# Check for GITHUB_TOKEN +if [[ -z "${GITHUB_TOKEN:-}" ]]; then + log "Error: GITHUB_TOKEN environment variable must be set" + exit 1 +fi + +# Set up git configuration +git config --global user.email "metamaskbot@users.noreply.github.com" +git config --global user.name "MetaMask Bot" + +# Create a temporary directory +temp_dir=$(mktemp -d) +trap 'rm -rf "$temp_dir"' EXIT + +# Clone the repository +repo_url="https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/mobile_bundlesize_stats.git" +if ! git clone "$repo_url" "$temp_dir"; then + log "Error: Failed to clone repository" + exit 1 +fi + +# Get commit ID and bundle size +commit_id=$(git rev-parse HEAD) +bundle_size=$(stat -f%z "ios/main.jsbundle" 2>/dev/null || stat -c%s "ios/main.jsbundle") +timestamp=$(date +%s%3N) + +# Update or create bundle_size.js file +output_file="$temp_dir/stats/bundle_size.js" +if [ -f "$output_file" ]; then + # Remove trailing comma and closing brace + sed -i.bak '$d' "$output_file" + sed -i.bak '$ s/,$//' "$output_file" +else + echo "const data = {" > "$output_file" +fi + +# Append new data +cat << EOF >> "$output_file" + "$commit_id": { + "ios": $bundle_size, + "timestamp": $timestamp + } +}; +EOF + +# Commit and push changes +cd "$temp_dir" +git add "$output_file" +if git commit -m "Add bundle size for commit: ${commit_id}"; then + if git push origin HEAD:main; then + log "Success: Bundle size data updated and pushed to main branch" + else + log "Error: Failed to push changes" + exit 1 + fi +else + log "Info: No changes to commit" +fi + +log "Script completed successfully" From 1e0aa323651a3d49901bd09b397f2ab2b57de591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Fri, 30 Aug 2024 09:40:08 +0100 Subject: [PATCH 02/18] feat(INFRA-2045): ios bundlesize ship --- .github/workflows/ci.yml | 1 + scripts/push-bundle-size.sh | 19 +------------- scripts/update_bundle_size.py | 48 +++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) create mode 100755 scripts/update_bundle_size.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ed0d90bff9..6d413b4bdf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,6 +183,7 @@ jobs: ship-js-bundle-size-check: runs-on: ubuntu-20.04 needs: [setup, js-bundle-size-check] + #if: github.ref == 'refs/heads/main' steps: - name: Download iOS bundle uses: actions/download-artifact@v3 diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index b2f4b7efe1f..6e5a63a0781 100644 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -39,24 +39,7 @@ commit_id=$(git rev-parse HEAD) bundle_size=$(stat -f%z "ios/main.jsbundle" 2>/dev/null || stat -c%s "ios/main.jsbundle") timestamp=$(date +%s%3N) -# Update or create bundle_size.js file -output_file="$temp_dir/stats/bundle_size.js" -if [ -f "$output_file" ]; then - # Remove trailing comma and closing brace - sed -i.bak '$d' "$output_file" - sed -i.bak '$ s/,$//' "$output_file" -else - echo "const data = {" > "$output_file" -fi - -# Append new data -cat << EOF >> "$output_file" - "$commit_id": { - "ios": $bundle_size, - "timestamp": $timestamp - } -}; -EOF +./scripts/update_bundle_size.py "./stats/bundle_size_data.js" "$commit_id" "$bundle_size" "$timestamp" # Commit and push changes cd "$temp_dir" diff --git a/scripts/update_bundle_size.py b/scripts/update_bundle_size.py new file mode 100755 index 00000000000..44822b3ea61 --- /dev/null +++ b/scripts/update_bundle_size.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 + +import argparse +import json +import os + +def update_bundle_size(file_path, commit_id, bundle_size, timestamp): + # Read the existing content of the file + if os.path.exists(file_path): + with open(file_path, 'r') as file: + content = file.read() + # Extract the data object from the content + data_start = content.find('{') + data_end = content.rfind('}') + if data_start != -1 and data_end != -1: + data_str = content[data_start:data_end+1] + data = json.loads(data_str) + else: + data = {} + else: + data = {} + + # Update the data with new information + # If commit_id already exists, it will overwrite the existing data + data[commit_id] = { + "ios": int(bundle_size), + "timestamp": int(timestamp) + } + + # Write the updated data back to the file + with open(file_path, 'w') as file: + file.write("const data = ") + json.dump(data, file, indent=4, separators=(',', ': ')) + file.write(";\n") + +def main(): + parser = argparse.ArgumentParser(description="Update bundle size data") + parser.add_argument("file_path", help="Path to the data file") + parser.add_argument("commit_id", help="Commit ID") + parser.add_argument("bundle_size", type=int, help="Bundle size") + parser.add_argument("timestamp", type=int, help="Timestamp") + + args = parser.parse_args() + + update_bundle_size(args.file_path, args.commit_id, args.bundle_size, args.timestamp) + +if __name__ == "__main__": + main() From e7904fea9909ba685805425d8eff629a62e0bb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 19 Sep 2024 10:04:31 +0100 Subject: [PATCH 03/18] feat(INFRA-2045): execute script --- scripts/push-bundle-size.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/push-bundle-size.sh diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh old mode 100644 new mode 100755 From f29d7edd643562bbca0c09cfa448536d9bfe3163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 19 Sep 2024 10:27:26 +0100 Subject: [PATCH 04/18] feat(INFRA-2045): forgot checkout --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d413b4bdf5..4ee33bd2f26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,6 +185,8 @@ jobs: needs: [setup, js-bundle-size-check] #if: github.ref == 'refs/heads/main' steps: + - uses: actions/checkout@v3 + - name: Download iOS bundle uses: actions/download-artifact@v3 with: From b23b1194f536c6766e7d2d408b90ea82dc467c35 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Fri, 27 Sep 2024 09:15:58 +0200 Subject: [PATCH 05/18] feat(INFRA-2045): fixed github token for bundle push --- .github/workflows/ci.yml | 5 ++++- scripts/push-bundle-size.sh | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ee33bd2f26..20252118a34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,7 @@ jobs: ship-js-bundle-size-check: runs-on: ubuntu-20.04 - needs: [setup, js-bundle-size-check] + needs: [check-diff, js-bundle-size-check] #if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v3 @@ -194,6 +194,9 @@ jobs: - name: Push bundle size to mobile_bundlesize_stats repo run: ./scripts/push-bundle-size.sh + env: + GITHUB_ACTOR: metamaskbot + MOBILE_BUNDLESIZE_TOKEN: ${{ secrets.MOBILE_BUNDLESIZE_TOKEN }} sonar-cloud: runs-on: ubuntu-20.04 diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 6e5a63a0781..4e610c23c73 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -13,9 +13,9 @@ if [[ "${GITHUB_ACTIONS:-}" != 'true' ]]; then exit 1 fi -# Check for GITHUB_TOKEN -if [[ -z "${GITHUB_TOKEN:-}" ]]; then - log "Error: GITHUB_TOKEN environment variable must be set" +# Check for MOBILE_BUNDLESIZE_TOKEN +if [[ -z "${MOBILE_BUNDLESIZE_TOKEN:-}" ]]; then + log "Error: MOBILE_BUNDLESIZE_TOKEN environment variable must be set" exit 1 fi @@ -28,7 +28,7 @@ temp_dir=$(mktemp -d) trap 'rm -rf "$temp_dir"' EXIT # Clone the repository -repo_url="https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/mobile_bundlesize_stats.git" +repo_url="https://$GITHUB_ACTOR:$MOBILE_BUNDLESIZE_TOKEN@github.com/mobile_bundlesize_stats.git" if ! git clone "$repo_url" "$temp_dir"; then log "Error: Failed to clone repository" exit 1 From 54c2a4c33d790534a7a18bbf720f2c74dd84bd26 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Fri, 27 Sep 2024 09:38:18 +0200 Subject: [PATCH 06/18] feat(INFRA-2045): updated repo name --- .github/workflows/ci.yml | 2 +- scripts/push-bundle-size.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20252118a34..b2714072ce3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,7 @@ jobs: ship-js-bundle-size-check: runs-on: ubuntu-20.04 - needs: [check-diff, js-bundle-size-check] + needs: [js-bundle-size-check] #if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v3 diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 4e610c23c73..0c4e2f59981 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -13,6 +13,11 @@ if [[ "${GITHUB_ACTIONS:-}" != 'true' ]]; then exit 1 fi +if [[ -z "${GITHUB_ACTOR:-}" ]]; then + log "Error: GITHUB_ACTOR environment variable must be set" + exit 1 +fi + # Check for MOBILE_BUNDLESIZE_TOKEN if [[ -z "${MOBILE_BUNDLESIZE_TOKEN:-}" ]]; then log "Error: MOBILE_BUNDLESIZE_TOKEN environment variable must be set" @@ -28,7 +33,7 @@ temp_dir=$(mktemp -d) trap 'rm -rf "$temp_dir"' EXIT # Clone the repository -repo_url="https://$GITHUB_ACTOR:$MOBILE_BUNDLESIZE_TOKEN@github.com/mobile_bundlesize_stats.git" +repo_url="https://$GITHUB_ACTOR:$MOBILE_BUNDLESIZE_TOKEN@github.com/metamask/mobile_bundlesize_stats.git" if ! git clone "$repo_url" "$temp_dir"; then log "Error: Failed to clone repository" exit 1 From ff5a2f6b2c9ce5d817dca4fe1bdfcfff4a3fa1dd Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Fri, 27 Sep 2024 09:50:43 +0200 Subject: [PATCH 07/18] feat(INFRA-2045): fixed bundle filepath --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2714072ce3..a8428788b31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,6 +191,8 @@ jobs: uses: actions/download-artifact@v3 with: name: ios-bundle + path: ios/main.jsbundle + - name: Push bundle size to mobile_bundlesize_stats repo run: ./scripts/push-bundle-size.sh From 7aa694fe2142d996d9145d40c8890cbc1b668e60 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Fri, 27 Sep 2024 11:35:45 +0200 Subject: [PATCH 08/18] feat(INFRA-2045): fixed bundle js file name --- scripts/push-bundle-size.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 0c4e2f59981..2a99734d314 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -43,11 +43,12 @@ fi commit_id=$(git rev-parse HEAD) bundle_size=$(stat -f%z "ios/main.jsbundle" 2>/dev/null || stat -c%s "ios/main.jsbundle") timestamp=$(date +%s%3N) +output_file="$temp_dir/stats/bundle_size_data.js" -./scripts/update_bundle_size.py "./stats/bundle_size_data.js" "$commit_id" "$bundle_size" "$timestamp" +./scripts/update_bundle_size.py "$output_file" "$commit_id" "$bundle_size" "$timestamp" -# Commit and push changes cd "$temp_dir" +# Commit and push changes git add "$output_file" if git commit -m "Add bundle size for commit: ${commit_id}"; then if git push origin HEAD:main; then From 37988958785dbe23437bff2ac2eb3ff9c84b6089 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:23:56 -0700 Subject: [PATCH 09/18] Update scripts/push-bundle-size.sh Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- scripts/push-bundle-size.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 2a99734d314..7ed5f45473c 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -40,9 +40,9 @@ if ! git clone "$repo_url" "$temp_dir"; then fi # Get commit ID and bundle size -commit_id=$(git rev-parse HEAD) -bundle_size=$(stat -f%z "ios/main.jsbundle" 2>/dev/null || stat -c%s "ios/main.jsbundle") -timestamp=$(date +%s%3N) +commit_id="$(git rev-parse HEAD)" +bundle_size="$(stat -f%z 'ios/main.jsbundle' 2>/dev/null || stat -c%s 'ios/main.jsbundle')" +timestamp="$(date +%s%3N)" output_file="$temp_dir/stats/bundle_size_data.js" ./scripts/update_bundle_size.py "$output_file" "$commit_id" "$bundle_size" "$timestamp" From e055412f86c3da8b78239ab040046657309aef6e Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:24 -0700 Subject: [PATCH 10/18] Update .github/workflows/ci.yml Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8428788b31..7c0c6478738 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,7 @@ jobs: path: ios/main.jsbundle ship-js-bundle-size-check: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: [js-bundle-size-check] #if: github.ref == 'refs/heads/main' steps: From 13dbb39ce1941e371cc58f686a3456b107c8efec Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:29 -0700 Subject: [PATCH 11/18] Update .github/workflows/ci.yml Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c0c6478738..e354c33be83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: needs: [js-bundle-size-check] #if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download iOS bundle uses: actions/download-artifact@v3 From bb1b6d07815052fedf4624a0f84ce414a3999453 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:36 -0700 Subject: [PATCH 12/18] Update scripts/push-bundle-size.sh Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- scripts/push-bundle-size.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 7ed5f45473c..89c0e1f23f1 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -18,9 +18,9 @@ if [[ -z "${GITHUB_ACTOR:-}" ]]; then exit 1 fi -# Check for MOBILE_BUNDLESIZE_TOKEN -if [[ -z "${MOBILE_BUNDLESIZE_TOKEN:-}" ]]; then - log "Error: MOBILE_BUNDLESIZE_TOKEN environment variable must be set" +# Check for GITHUB_TOKEN +if [[ -z "${GITHUB_TOKEN:-}" ]]; then + log "Error: GITHUB_TOKEN environment variable must be set" exit 1 fi From 825ed1a55bcd8deb841684b37620a54b778152c5 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:42 -0700 Subject: [PATCH 13/18] Update .github/workflows/ci.yml Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e354c33be83..d5f356e748c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,7 +198,7 @@ jobs: run: ./scripts/push-bundle-size.sh env: GITHUB_ACTOR: metamaskbot - MOBILE_BUNDLESIZE_TOKEN: ${{ secrets.MOBILE_BUNDLESIZE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.MOBILE_BUNDLESIZE_TOKEN }} sonar-cloud: runs-on: ubuntu-20.04 From 313e753857d111a3f82cd3617917004dd88e05aa Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:49 -0700 Subject: [PATCH 14/18] Update scripts/push-bundle-size.sh Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- scripts/push-bundle-size.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 89c0e1f23f1..67d9026a85b 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -29,7 +29,7 @@ git config --global user.email "metamaskbot@users.noreply.github.com" git config --global user.name "MetaMask Bot" # Create a temporary directory -temp_dir=$(mktemp -d) +temp_dir="$(mktemp -d)" trap 'rm -rf "$temp_dir"' EXIT # Clone the repository From 5df9928d130de201aa6cb496fe73b0dac8967b42 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:24:57 -0700 Subject: [PATCH 15/18] Update .github/workflows/ci.yml Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5f356e748c..a8fd5a0a66c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,7 +188,7 @@ jobs: - uses: actions/checkout@v4 - name: Download iOS bundle - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ios-bundle path: ios/main.jsbundle From 1fdbd04090ccd5dd7b21b8cc0b0f9322a32b7828 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 04:25:03 -0700 Subject: [PATCH 16/18] Update scripts/push-bundle-size.sh Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- scripts/push-bundle-size.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/push-bundle-size.sh b/scripts/push-bundle-size.sh index 67d9026a85b..c09e0d39436 100755 --- a/scripts/push-bundle-size.sh +++ b/scripts/push-bundle-size.sh @@ -33,7 +33,7 @@ temp_dir="$(mktemp -d)" trap 'rm -rf "$temp_dir"' EXIT # Clone the repository -repo_url="https://$GITHUB_ACTOR:$MOBILE_BUNDLESIZE_TOKEN@github.com/metamask/mobile_bundlesize_stats.git" +repo_url="https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/metamask/mobile_bundlesize_stats.git" if ! git clone "$repo_url" "$temp_dir"; then log "Error: Failed to clone repository" exit 1 From b945ccd904910d9944ac43a3a5b9291de574f75d Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 15:23:09 +0300 Subject: [PATCH 17/18] Updated ci workflow download and upload step versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8fd5a0a66c..0b93b2ec5ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,7 +175,7 @@ jobs: run: ./scripts/js-bundle-stats.sh ios/main.jsbundle 40 - name: Upload iOS bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ios-bundle path: ios/main.jsbundle From 6a31ba8c596f38b1d4645fc7e883b03655618eda Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Tue, 1 Oct 2024 15:41:34 +0300 Subject: [PATCH 18/18] Updated to run on main only --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b93b2ec5ae..e1b92a4d58d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,7 @@ jobs: ship-js-bundle-size-check: runs-on: ubuntu-latest needs: [js-bundle-size-check] - #if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' }} steps: - uses: actions/checkout@v4