diff --git a/.github/scripts/close-release-bug-report-issue.ts b/.github/scripts/close-release-bug-report-issue.ts index 814d7fbaef68..55dc2c0b01a3 100644 --- a/.github/scripts/close-release-bug-report-issue.ts +++ b/.github/scripts/close-release-bug-report-issue.ts @@ -33,7 +33,7 @@ async function main(): Promise { // Extract semver version number from the branch name const releaseVersionNumberMatch = branchName.match( - /^Version-v(\d+\.\d+\.\d+)$/, + /^(?:Version-v|release\/)(\d+\.\d+\.\d+)$/, ); if (!releaseVersionNumberMatch) { diff --git a/.github/scripts/create-bug-report-issue.ts b/.github/scripts/create-bug-report-issue.ts index cfd2d7da93ae..83bee28424a7 100644 --- a/.github/scripts/create-bug-report-issue.ts +++ b/.github/scripts/create-bug-report-issue.ts @@ -103,7 +103,7 @@ async function main(): Promise { process.exit(1); } - const issueBody = `**What is this bug report issue for?**\n\n1. This issue is used to track release dates on this [Github Project board](https://github.com/orgs/MetaMask/projects/${projectNumber}/views/${projectViewNumber}), which content then gets pulled into our metrics system.\n\n2. This issue is also used by our Zapier automations, to determine if automated notifications shall be sent on Slack for release \`${releaseVersion}\`. Notifications will only be sent as long as this issue is open.\n\n**Who created and/or closed this issue?**\n\n- This issue was automatically created by a GitHub action upon the creation of the release branch \`Version-v${releaseVersion}\`, indicating the release was cut.\n\n- This issue gets automatically closed by another GitHub action, once the \`Version-v${releaseVersion}\` branch merges into \`main\`, indicating the release is prepared for store submission.`; + const issueBody = `**What is this bug report issue for?**\n\n1. This issue is used to track release dates on this [Github Project board](https://github.com/orgs/MetaMask/projects/${projectNumber}/views/${projectViewNumber}), which content then gets pulled into our metrics system.\n\n2. This issue is also used by our Zapier automations, to determine if automated notifications shall be sent on Slack for release \`${releaseVersion}\`. Notifications will only be sent as long as this issue is open.\n\n**Who created and/or closed this issue?**\n\n- This issue was automatically created by a GitHub action upon the creation of the release branch \`Version-v${releaseVersion}\`, indicating the release was cut.\n\n- This issue gets automatically closed by another GitHub action, once the release branch \`Version-v${releaseVersion}\` or \`release/${releaseVersion}\` merges into \`main\`, indicating the release is prepared for store submission.`; const issueId = await createIssue(octokit, repoOwner, planningRepoName, issueTitle, issueBody, [regressionLabelTestingId, typeBugLabelId, teamLabelId]); // Retrieve project, in order to obtain its ID diff --git a/.github/workflows/auto-update-pr-targeting-release.yml b/.github/workflows/auto-update-pr-targeting-release.yml index b08f0452b233..1bbe6cb343b1 100644 --- a/.github/workflows/auto-update-pr-targeting-release.yml +++ b/.github/workflows/auto-update-pr-targeting-release.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - Version-v* + - release/* jobs: auto-update: diff --git a/.github/workflows/check-attributions.yml b/.github/workflows/check-attributions.yml index 008c15168d8f..352ffd71b19d 100644 --- a/.github/workflows/check-attributions.yml +++ b/.github/workflows/check-attributions.yml @@ -2,7 +2,9 @@ name: Check Attributions on: push: - branches: Version-v* + branches: + - Version-v* + - release/* jobs: check-attributions: diff --git a/.github/workflows/check-pr-labels.yml b/.github/workflows/check-pr-labels.yml index c7c7541b6267..7ed7a3579e51 100644 --- a/.github/workflows/check-pr-labels.yml +++ b/.github/workflows/check-pr-labels.yml @@ -12,7 +12,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master')) }} + cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/stable')) }} jobs: check-pr-labels: diff --git a/.github/workflows/check-pr-max-lines.yml b/.github/workflows/check-pr-max-lines.yml index ddd311c3d315..6c0b6d2e69f2 100644 --- a/.github/workflows/check-pr-max-lines.yml +++ b/.github/workflows/check-pr-max-lines.yml @@ -9,7 +9,9 @@ on: branches-ignore: # Do not count lines on PRs targeting master or releases - master + - stable - Version-v* + - release/* jobs: check-pr-max-lines: diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 6cf4a50270bb..5e55d631d832 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -7,7 +7,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master')) }} + cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/stable')) }} jobs: CLABot: diff --git a/.github/workflows/close-bug-report.yml b/.github/workflows/close-bug-report.yml index 4c52fa707adc..6d8edf418c6a 100644 --- a/.github/workflows/close-bug-report.yml +++ b/.github/workflows/close-bug-report.yml @@ -4,13 +4,14 @@ on: pull_request: branches: - master + - stable types: - closed jobs: close-bug-report: runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'Version-v') + if: github.event.pull_request.merged == true && ( startsWith(github.event.pull_request.head.ref, 'Version-v') || startsWith(github.event.pull_request.head.ref, 'release/') ) steps: - name: Checkout and setup environment uses: MetaMask/action-checkout-and-setup@v1 diff --git a/.github/workflows/create-bug-report.yml b/.github/workflows/create-bug-report.yml index a1a5133575d1..5df83723df93 100644 --- a/.github/workflows/create-bug-report.yml +++ b/.github/workflows/create-bug-report.yml @@ -9,8 +9,8 @@ jobs: - name: Extract version from branch name if release branch id: extract_version run: | - if [[ "$GITHUB_REF" =~ ^refs/heads/Version-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - version="${GITHUB_REF#refs/heads/Version-v}" + if [[ "$GITHUB_REF" =~ ^refs/heads/(Version-v|release/)[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + version=$(echo "$GITHUB_REF" | sed -E 's#^refs/heads/(Version-v|release/)##') echo "New release branch($version), continue next steps" echo "version=$version" >> "$GITHUB_OUTPUT" else diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 5057d3ce17b5..d8470982dd5d 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: base-branch: - description: 'The base branch, tag, or SHA for git operations and the pull request (usually `main`)' + description: 'The base branch, tag, or SHA for git operations and the pull request. Usually `main`' required: true semver-version: description: 'A semantic version, eg: x.x.x' @@ -12,8 +12,10 @@ on: previous-semver-version: description: 'Previous semantic version, eg: x.x.x' required: true + jobs: create-release-pr: + name: Create Release Pull Request using Github Tools uses: MetaMask/github-tools/.github/workflows/create-release-pr.yml@fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7 with: platform: extension diff --git a/.github/workflows/identify-codeowners.yml b/.github/workflows/identify-codeowners.yml index 3e6185edf47f..a47ff297aff1 100644 --- a/.github/workflows/identify-codeowners.yml +++ b/.github/workflows/identify-codeowners.yml @@ -10,7 +10,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master')) }} + cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/stable')) }} jobs: identify-codeowners: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 002c989b396a..d182f989d3d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,9 @@ on: branches: - main - master + - stable - Version-v* + - release/* - trigger-ci* pull_request: types: @@ -23,7 +25,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master')) }} + cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/stable')) }} env: # For a `pull_request` event, the branch is `github.head_ref``. @@ -99,14 +101,14 @@ jobs: uses: ./.github/workflows/run-build.yml with: build-name: build-dist-browserify - build-command: ${{ (github.head_ref || github.ref_name) == 'master' && 'yarn build prod' || 'yarn build dist' }} + build-command: ${{ ((github.head_ref || github.ref_name) == 'master' || (github.head_ref || github.ref_name) == 'stable') && 'yarn build prod' || 'yarn build dist' }} secrets: inherit build-dist-mv2-browserify: uses: ./.github/workflows/run-build.yml with: build-name: build-dist-mv2-browserify - build-command: ${{ (github.head_ref || github.ref_name) == 'master' && 'yarn build prod' || 'yarn build dist' }} + build-command: ${{ ((github.head_ref || github.ref_name) == 'master' || (github.head_ref || github.ref_name) == 'stable') && 'yarn build prod' || 'yarn build dist' }} mozilla-lint: true enable-mv3: false secrets: inherit @@ -131,14 +133,14 @@ jobs: uses: ./.github/workflows/run-build.yml with: build-name: build-flask-browserify - build-command: ${{ (github.head_ref || github.ref_name) == 'master' && 'yarn build --build-type flask prod' || 'yarn build --build-type flask dist' }} + build-command: ${{ ((github.head_ref || github.ref_name) == 'master' || (github.head_ref || github.ref_name) == 'stable') && 'yarn build --build-type flask prod' || 'yarn build --build-type flask dist' }} secrets: inherit build-flask-mv2-browserify: uses: ./.github/workflows/run-build.yml with: build-name: build-flask-mv2-browserify - build-command: ${{ (github.head_ref || github.ref_name) == 'master' && 'yarn build --build-type flask prod' || 'yarn build --build-type flask dist' }} + build-command: ${{ ((github.head_ref || github.ref_name) == 'master' || (github.head_ref || github.ref_name) == 'stable') && 'yarn build --build-type flask prod' || 'yarn build --build-type flask dist' }} mozilla-lint: true enable-mv3: false secrets: inherit @@ -353,7 +355,7 @@ jobs: publish-release: name: Publish release - if: ${{ github.event_name == 'push' && github.ref_name == 'master' }} + if: ${{ github.event_name == 'push' && (github.ref_name == 'master' || github.ref_name == 'stable') }} needs: - build-dist-browserify - build-dist-mv2-browserify diff --git a/.github/workflows/needs-e2e.yml b/.github/workflows/needs-e2e.yml index e14e569bd758..0dbc3a5a4987 100644 --- a/.github/workflows/needs-e2e.yml +++ b/.github/workflows/needs-e2e.yml @@ -40,7 +40,7 @@ jobs: prep-e2e: # For a `pull_request` event, the branch is `github.head_ref``. # For a `push` event, the branch is `github.ref_name`. - if: ${{ needs.needs-e2e.outputs.needs-e2e == 'true' && (github.head_ref || github.ref_name) != 'master' }} + if: ${{ needs.needs-e2e.outputs.needs-e2e == 'true' && (github.head_ref || github.ref_name) != 'master' && (github.head_ref || github.ref_name) != 'stable' }} needs: - needs-e2e runs-on: ubuntu-latest diff --git a/.github/workflows/publish-prerelease.yml b/.github/workflows/publish-prerelease.yml index 788f71ecf60b..ffa5afccfe1b 100644 --- a/.github/workflows/publish-prerelease.yml +++ b/.github/workflows/publish-prerelease.yml @@ -34,7 +34,7 @@ jobs: yarn-custom-url: ${{ vars.YARN_URL }} - name: Find the associated PR - if: ${{ startsWith(env.BRANCH, 'Version-v') && (!env.PR_NUMBER || !env.BASE_COMMIT_HASH || !env.HEAD_COMMIT_HASH) }} + if: ${{ (startsWith(env.BRANCH, 'Version-v') || startsWith(env.BRANCH, 'release/')) && (!env.PR_NUMBER || !env.BASE_COMMIT_HASH || !env.HEAD_COMMIT_HASH) }} uses: actions/github-script@v7 with: script: | diff --git a/.github/workflows/repository-health-checks.yml b/.github/workflows/repository-health-checks.yml index d98bf4d4da20..dd635ed98d4b 100644 --- a/.github/workflows/repository-health-checks.yml +++ b/.github/workflows/repository-health-checks.yml @@ -24,11 +24,11 @@ jobs: run: ./development/shellcheck.sh - name: Validate changelog - if: ${{ !startsWith(env.BRANCH, 'Version-v') }} + if: ${{ !startsWith(env.BRANCH, 'Version-v') && !startsWith(env.BRANCH, 'release/') }} run: yarn lint:changelog - name: Validate release candidate changelog - if: ${{ startsWith(env.BRANCH, 'Version-v') }} + if: ${{ startsWith(env.BRANCH, 'Version-v') || startsWith(env.BRANCH, 'release/') }} run: .github/scripts/validate-changelog-in-rc.sh - name: Lint lockfile diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml index c28502e5e28b..5e7213b92a69 100644 --- a/.github/workflows/security-code-scanner.yml +++ b/.github/workflows/security-code-scanner.yml @@ -11,7 +11,8 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master')) }} + # This cancels in-progress workflows for all branches except main as it is, we can remove the rest of the conditions as the first one acts as break circuit with the OR + cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/stable')) }} jobs: run-security-scan: