Skip to content

Commit fcc79fc

Browse files
committed
Merge branch 'main' into jl/mmp-3814/fix-grant-permissions-add-ethereum-chain
2 parents d21a6bc + ed2fb49 commit fcc79fc

File tree

96 files changed

+1413
-2534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1413
-2534
lines changed

.circleci/config.yml

-55
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ workflows:
9999
<<: *rc_branch_only
100100
requires:
101101
- prep-deps
102-
- trigger-beta-build:
103-
requires:
104-
- prep-deps
105102
- prep-deps
106103
- get-changed-files-with-git-diff:
107104
filters:
@@ -198,9 +195,6 @@ workflows:
198195
- validate-source-maps-mv2:
199196
requires:
200197
- prep-build-mv2
201-
- validate-source-maps-beta:
202-
requires:
203-
- trigger-beta-build
204198
- validate-source-maps-flask:
205199
requires:
206200
- prep-build-flask
@@ -218,7 +212,6 @@ workflows:
218212
- all-tests-pass:
219213
requires:
220214
- validate-source-maps
221-
- validate-source-maps-beta
222215
- validate-source-maps-flask
223216
- test-mozilla-lint-mv2
224217
- test-mozilla-lint-flask-mv2
@@ -250,7 +243,6 @@ workflows:
250243
- prep-build-test-mv2
251244
- prep-build-test-flask
252245
- prep-build-test-flask-mv2
253-
- trigger-beta-build
254246
- prep-build-storybook
255247
- prep-build-ts-migration-dashboard
256248
- benchmark
@@ -316,35 +308,6 @@ workflows:
316308
- validate-locales-only
317309

318310
jobs:
319-
trigger-beta-build:
320-
executor: node-browsers-small
321-
steps:
322-
- run: *shallow-git-clone-and-enable-vnc
323-
- run: sudo corepack enable
324-
- attach_workspace:
325-
at: .
326-
- when:
327-
condition:
328-
not:
329-
matches:
330-
pattern: /^master$/
331-
value: << pipeline.git.branch >>
332-
steps:
333-
- run:
334-
name: Build beta prod
335-
command: .circleci/scripts/trigger-beta-build.sh
336-
- run:
337-
name: Move beta build to 'dist-beta' to avoid conflict with production build
338-
command: mv ./dist ./dist-beta
339-
- run:
340-
name: Move beta zips to 'builds-beta' to avoid conflict with production build
341-
command: mv ./builds ./builds-beta
342-
- persist_to_workspace:
343-
root: .
344-
paths:
345-
- dist-beta
346-
- builds-beta
347-
348311
create_release_pull_request:
349312
executor: node-browsers-medium
350313
steps:
@@ -1089,25 +1052,18 @@ jobs:
10891052
- store_artifacts:
10901053
path: dist/sourcemaps
10911054
destination: builds/sourcemaps
1092-
- store_artifacts:
1093-
path: dist-beta/sourcemaps
1094-
destination: builds-beta/sourcemaps
10951055
- store_artifacts:
10961056
path: dist-flask/sourcemaps
10971057
destination: builds-flask/sourcemaps
10981058
- store_artifacts:
10991059
path: builds
11001060
destination: builds
1101-
- store_artifacts:
1102-
path: builds-beta
1103-
destination: builds-beta
11041061
- store_artifacts:
11051062
path: builds-flask
11061063
destination: builds-flask
11071064
- store_artifacts:
11081065
path: builds-flask-mv2
11091066
destination: builds-flask-mv2
1110-
11111067
- store_artifacts:
11121068
path: builds-mv2
11131069
destination: builds-mv2
@@ -1204,17 +1160,6 @@ jobs:
12041160
name: Validate source maps
12051161
command: yarn validate-source-maps
12061162

1207-
validate-source-maps-beta:
1208-
executor: node-browsers-small
1209-
steps:
1210-
- run: *shallow-git-clone-and-enable-vnc
1211-
- run: sudo corepack enable
1212-
- attach_workspace:
1213-
at: .
1214-
- run:
1215-
name: Validate source maps
1216-
command: .circleci/scripts/validate-source-maps-beta.sh
1217-
12181163
validate-source-maps-flask:
12191164
executor: node-browsers-small
12201165
steps:

.circleci/scripts/check-working-tree.sh

-11
This file was deleted.

.circleci/scripts/trigger-beta-build.sh

-25
This file was deleted.

.circleci/scripts/validate-source-maps-beta.sh

-22
This file was deleted.

.github/workflows/build-beta.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build beta
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-beta:
8+
name: Build beta
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
# By default, the checkout action checks out the last merge commit for pull requests.
15+
# Source: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
16+
# However, we need the head commit (the latest commit pushed to the source branch)
17+
# because in the workflow, we would like to parse the latest commit message.
18+
# Specifying `ref` ensures that the head commit is checked out directly.
19+
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`.
20+
# For a `push` event, the head commit hash is `github.sha`.
21+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
22+
23+
- name: Needs beta build
24+
# For a `pull_request` event, the branch is `github.head_ref``.
25+
# For a `push` event, the branch is `github.ref_name`.
26+
if: ${{ (github.head_ref || github.ref_name) != 'master' }}
27+
id: needs-beta-build
28+
env:
29+
BRANCH: ${{ github.head_ref || github.ref_name }}
30+
run: |
31+
version="${BRANCH/Version-v/}"
32+
commit_message=$(git show -s --format=%s HEAD)
33+
beta_version_regex="Version v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+"
34+
35+
if [[ "$commit_message" =~ $beta_version_regex ]]; then
36+
printf '%s\n' "Creating a build for $version with $commit_message"
37+
echo "NEEDS_BETA_BUILD=true" >> "$GITHUB_OUTPUT"
38+
else
39+
printf '%s\n' 'Commit message does not match commit message for beta pattern; skipping beta build'
40+
echo "NEEDS_BETA_BUILD=false" >> "$GITHUB_OUTPUT"
41+
fi
42+
43+
- name: Setup environment
44+
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
45+
uses: metamask/github-tools/.github/actions/setup-environment@main
46+
47+
- name: Run beta build
48+
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
49+
env:
50+
INFURA_PROJECT_ID: 00000000000
51+
INFURA_BETA_PROJECT_ID: 00000000000
52+
SEGMENT_BETA_WRITE_KEY: 00000000000
53+
ENABLE_MV3: true
54+
run: |
55+
yarn build --build-type beta --platform='chrome' dist
56+
yarn build --build-type beta --platform='chrome' prod
57+
58+
- name: Validate source maps
59+
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
60+
run: yarn validate-source-maps
61+
62+
- name: Upload 'dist-beta' to S3
63+
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
64+
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d
65+
with:
66+
aws-region: ${{ vars.AWS_REGION }}
67+
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
68+
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/dist-beta
69+
path: dist
70+
71+
- name: Upload 'builds-beta' to S3
72+
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
73+
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d
74+
with:
75+
aws-region: ${{ vars.AWS_REGION }}
76+
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
77+
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/builds-beta
78+
path: builds

.github/workflows/main.yml

+9
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,19 @@ jobs:
7575
- wait-for-circleci-workflow-status
7676
uses: ./.github/workflows/runway.yml
7777

78+
build-beta:
79+
name: Build beta
80+
uses: ./.github/workflows/build-beta.yml
81+
permissions:
82+
contents: read
83+
id-token: write
84+
7885
publish-prerelease:
7986
name: Publish prerelease
8087
if: ${{ github.event_name == 'pull_request' }}
8188
needs:
8289
- wait-for-circleci-workflow-status
90+
- build-beta
8391
uses: ./.github/workflows/publish-prerelease.yml
8492
secrets:
8593
PR_COMMENT_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}
@@ -100,6 +108,7 @@ jobs:
100108
- validate-lavamoat-policy-webapp
101109
- run-tests
102110
- wait-for-circleci-workflow-status
111+
- build-beta
103112
outputs:
104113
PASSED: ${{ steps.set-output.outputs.PASSED }}
105114
steps:

.github/workflows/publish-prerelease.yml

+1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ jobs:
7272
MERGE_BASE_COMMIT_HASH: ${{ steps.get-merge-base.outputs.MERGE_BASE }}
7373
CIRCLE_BUILD_NUM: ${{ steps.get-circleci-job-details.outputs.CIRCLE_BUILD_NUM }}
7474
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
75+
HOST_URL: ${{ vars.AWS_CLOUDFRONT_URL }}/${{ github.event.repository.name }}/${{ github.run_id }}
7576
run: ./development/metamaskbot-build-announce.js

app/_locales/de/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/el/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en_GB/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/es/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/fr/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/hi/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/id/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)