Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
9 changes: 9 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please see the documentation for all configuration options:
# https://github.com/rhysd/actionlint/blob/main/docs/config.md#configuration-file

paths:
.github/workflows/create-release-pr.yml:
ignore:
# `create-release-pr` has an empty string value for the `release-type`
# input, which is intentional and valid.
- 'string should not be empty'
120 changes: 120 additions & 0 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build, Lint, and Test

on:
workflow_call:

permissions:
contents: read

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
cache-node-modules: ${{ matrix.node-version == '24.x' }}

build:
name: Build
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn build
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

lint:
name: Lint
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn lint
- name: Validate RC changelog
if: ${{ startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog --rc
- name: Validate changelog
if: ${{ !startsWith(github.head_ref, 'release/') }}
run: yarn lint:changelog
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

test:
name: Test
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- run: yarn test
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi

compatibility-test:
name: Compatibility test
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
node-version: ${{ matrix.node-version }}
- name: Install dependencies via Yarn
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
- run: yarn test
- name: Restore lockfile
run: git restore yarn.lock
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
148 changes: 0 additions & 148 deletions .github/workflows/build-test.yml

This file was deleted.

36 changes: 18 additions & 18 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on:
default: 'main'
required: true
release-type:
description: 'A SemVer version diff, i.e. major, minor, patch, prerelease etc. Mutually exclusive with "release-version".'
description: 'A SemVer version diff, i.e. major, minor, or patch. Mutually exclusive with "release-version".'
required: false
type: choice
options:
- ''
- major
- minor
- patch
release-version:
description: 'A specific version to bump to. Mutually exclusive with "release-type".'
required: false
Expand All @@ -21,28 +27,22 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
# This is to guarantee that the most recent tag is fetched.
# This can be configured to a more reasonable value by consumers.
is-high-risk-environment: true

# This is to guarantee that the most recent tag is fetched. This can
# be configured to a more reasonable value by consumers.
fetch-depth: 0

# We check out the specified branch, which will be used as the base
# branch for all git operations and the release PR.
ref: ${{ github.event.inputs.base-branch }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: MetaMask/action-create-release-pr@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: MetaMask/action-create-release-pr@v5
with:
release-type: ${{ github.event.inputs.release-type }}
release-version: ${{ github.event.inputs.release-version }}
artifacts-path: gh-action__release-authors
# Upload the release author artifact for use in subsequent workflows
- uses: actions/upload-artifact@v4
with:
name: release-authors
path: gh-action__release-authors
if-no-files-found: error
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading