Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
acc6082
feat(gh-actions): unify version release workflows
alucardzom Jun 10, 2025
efa39e0
chore(prettier): executed on the gh workflow
alucardzom Jun 10, 2025
dc8d22a
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jun 10, 2025
8ef8ad7
chore: set SHA github-tools same as script has
alucardzom Jun 11, 2025
5ec60d2
chore(stable): added compatibility with stable branch
alucardzom Jun 11, 2025
e509d66
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jun 11, 2025
a09dc87
chore(prettier): run it for codeql
alucardzom Jun 11, 2025
b6f1968
chore: rename release/v to release/
alucardzom Jun 11, 2025
1e0f5ba
chore(fix): fix extract version for bug report
alucardzom Jun 24, 2025
4311c64
chore(ts): update close release bug report issue ts script
alucardzom Jun 24, 2025
2743ced
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jun 24, 2025
7cd5da9
chore(prerelease): add also compatibility with the new branch
alucardzom Jun 24, 2025
bc72aed
chore(gh-action): remove duplicated block pr release
alucardzom Jun 24, 2025
00ff911
chore: update create pr
alucardzom Jul 4, 2025
3cbd31a
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 4, 2025
e72dd82
chore: remove unused input
alucardzom Jul 4, 2025
a8807c2
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 4, 2025
89bcb5a
chore: added info
alucardzom Jul 4, 2025
406a0e3
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 9, 2025
dcae6ec
chore: fix typo oin create-bug-report yaml
alucardzom Jul 11, 2025
af1430b
chore: restore create release to execute last stable branch
alucardzom Jul 14, 2025
77bbf07
chore: forgot to add the prefix
alucardzom Jul 14, 2025
6b00dea
chore: restore value
alucardzom Jul 14, 2025
c59ae7c
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 17, 2025
63e4649
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 18, 2025
3afb402
Merge branch 'main' into ale/unify-release-branch-naming
alucardzom Jul 21, 2025
24d6dae
chore: added control on 2 more workflows
alucardzom Jul 30, 2025
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
2 changes: 1 addition & 1 deletion .github/scripts/close-release-bug-report-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function main(): Promise<void> {

// 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) {
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/create-bug-report-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function main(): Promise<void> {
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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Check Attributions

on:
push:
branches: Version-v*
branches:
- Version-v*
- release/*

jobs:
check-attributions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/close-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ 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'
required: true
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/identify-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
branches:
- main
- master
- stable
- Version-v*
- release/*
- trigger-ci*
pull_request:
types:
Expand All @@ -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``.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/needs-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repository-health-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading