-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/29712?quickstart=1) This PR migrates the beta build from CircleCI to GitHub Actions. ## **Related issues** Fixes: #28572, #29446 ## **Manual testing steps** For commit messages matching the pattern: `Version v0.0.0-beta.0` on any branch other than `master,` the following should happen: 1. Build should run on GH Actions 2. Build should be uploaded on S3 3. Build should appear in the metamaskbot comment ## **Screenshots/Recordings** Not applicable ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/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.
- Loading branch information
1 parent
615c469
commit 5024615
Showing
8 changed files
with
107 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Build beta | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-beta: | ||
name: Build beta | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# By default, the checkout action checks out the last merge commit for pull requests. | ||
# Source: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request | ||
# However, we need the head commit (the latest commit pushed to the source branch) | ||
# because in the workflow, we would like to parse the latest commit message. | ||
# Specifying `ref` ensures that the head commit is checked out directly. | ||
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`. | ||
# For a `push` event, the head commit hash is `github.sha`. | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
||
- name: Needs beta build | ||
# For a `pull_request` event, the branch is `github.head_ref``. | ||
# For a `push` event, the branch is `github.ref_name`. | ||
if: ${{ (github.head_ref || github.ref_name) != 'master' }} | ||
id: needs-beta-build | ||
env: | ||
BRANCH: ${{ github.head_ref || github.ref_name }} | ||
run: | | ||
version="${BRANCH/Version-v/}" | ||
commit_message=$(git show -s --format=%s HEAD) | ||
beta_version_regex="Version v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+" | ||
if [[ "$commit_message" =~ $beta_version_regex ]]; then | ||
printf '%s\n' "Creating a build for $version with $commit_message" | ||
echo "NEEDS_BETA_BUILD=true" >> "$GITHUB_OUTPUT" | ||
else | ||
printf '%s\n' 'Commit message does not match commit message for beta pattern; skipping beta build' | ||
echo "NEEDS_BETA_BUILD=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Setup environment | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
uses: metamask/github-tools/.github/actions/setup-environment@main | ||
|
||
- name: Run beta build | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
env: | ||
INFURA_PROJECT_ID: 00000000000 | ||
INFURA_BETA_PROJECT_ID: 00000000000 | ||
SEGMENT_BETA_WRITE_KEY: 00000000000 | ||
ENABLE_MV3: true | ||
run: | | ||
yarn build --build-type beta --platform='chrome' dist | ||
yarn build --build-type beta --platform='chrome' prod | ||
- name: Validate source maps | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
run: yarn validate-source-maps | ||
|
||
- name: Upload 'dist-beta' to S3 | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: ${{ vars.AWS_IAM_ROLE }} | ||
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/dist-beta | ||
path: dist | ||
|
||
- name: Upload 'builds-beta' to S3 | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: ${{ vars.AWS_IAM_ROLE }} | ||
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/builds-beta | ||
path: builds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters