Commit c80c69b
authored
ci: Upgrade Yarn to 4.16.0 and align workflows with module template (#204)
## Summary
- Upgrades Yarn from 3.2.1 to 4.16.0 and aligns `.yarnrc.yml` with the
module template (Corepack, `approvedGitRepositories: []`,
`npmMinimalAgeGate: 4320`, `npmPreapprovedPackages`)
- Updates `action-npm-publish` from v1 to v6
- Fully aligns CI workflows with the
[metamask-module-template](https://github.com/MetaMask/metamask-module-template):
- **Added** `main.yml` — top-level orchestration workflow (actionlint,
security scan, build/lint/test, release gating)
- **Added** `build-lint-test.yml` — reusable workflow with
`prepare`/`build`/`lint`/`test`/`compatibility-test` jobs on Node
20/22/24 using `action-checkout-and-setup@v3`
- **Rewrote** `publish-release.yml` as a reusable `workflow_call` —
restructured as `build → publish-npm-dry-run → publish-npm →
publish-release`; GitHub release now happens after npm publish; uses
`action-publish-release@v3`
- **Updated** `create-release-pr.yml` — uses
`action-checkout-and-setup@v3`, `action-create-release-pr@v5`,
`release-type` is now a `choice` input
- **Updated** `publish-preview.yml` — `action-checkout-and-setup@v1` →
`v3`
- **Deleted** `build-test.yml` and `security-code-scanner.yml` —
consolidated into `main.yml`
- **Added** `actionlint-matcher.json` and `actionlint.yml`
- Adds `lint:changelog` script (`auto-changelog validate --formatter
prettier`) and wires it into `lint` and `lint:fix`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes npm publish ordering, release gating, and Node matrix
coverage, which can block merges or alter how/when packages ship if
misconfigured.
>
> **Overview**
> Replaces the monolithic **`build-test.yml`** CI with a **`main.yml`**
entrypoint that runs **actionlint** (with a GitHub problem matcher),
invokes the reusable **MetaMask security scan** workflow, and calls a
new reusable **`build-lint-test.yml`** for prepare/build/lint/test plus
a **lockfile-free compatibility test** on Node **20/22/24** via
**`MetaMask/action-checkout-and-setup@v3`**.
>
> **Release and publish** behavior shifts: **`publish-release.yml`** is
now **`workflow_call`-only** and runs **`build → npm dry-run → npm
publish → GitHub release`** (GitHub release after npm), using **artifact
upload/download** instead of commit-keyed cache and
**`action-npm-publish@v6`** / **`action-publish-release@v3`**.
**`main.yml`** gates publishing on **`all-jobs-pass`**,
**`action-is-release@v2`**, and **push** events whose head commit author
is **`github-actions`**.
>
> **`create-release-pr.yml`** moves to
**`action-create-release-pr@v5`**, makes **`release-type`** a **choice**
input (including empty), and drops the release-authors artifact upload.
**`publish-preview.yml`** bumps checkout/setup to **v3**. Adds
**`actionlint.yml`** to ignore the intentional empty **`release-type`**
option.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9e17710. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c6a5d49 commit c80c69b
13 files changed
Lines changed: 3710 additions & 4390 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | | - | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | | - | |
27 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
0 commit comments