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
62 changes: 21 additions & 41 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
outputs:
child-workspace-package-names: ${{ steps.workspace-package-names.outputs.child-workspace-package-names }}
steps:
- uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable
is-high-risk-environment: true
cache-node-modules: ${{ matrix.node-version == '22.x' }}
- name: Fetch workspace package names
id: workspace-package-names
run: |
Expand All @@ -33,15 +31,12 @@ jobs:
- prepare
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable --immutable-cache
is-high-risk-environment: true
- run: yarn lint
- name: Require clean working directory
shell: bash
Expand All @@ -57,22 +52,13 @@ jobs:
needs: prepare
strategy:
matrix:
node-version: [20.x]
node-version: [22.x]
package-name: ${{ fromJson(needs.prepare.outputs.child-workspace-package-names) }}
steps:
- uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable --immutable-cache
is-high-risk-environment: true
- run: yarn workspace ${{ matrix.package-name }} changelog:validate
- name: Require clean working directory
shell: bash
Expand All @@ -89,15 +75,12 @@ jobs:
- prepare
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable --immutable-cache
is-high-risk-environment: true
- run: yarn build
- name: Require clean working directory
shell: bash
Expand All @@ -114,15 +97,12 @@ jobs:
- prepare
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable --immutable-cache
is-high-risk-environment: true
- run: yarn build
- run: yarn test
- name: Require clean working directory
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
- name: Install Node
uses: actions/setup-node@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn install --immutable
is-high-risk-environment: true
- name: Get commit SHA
id: commit-sha
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
Expand Down
81 changes: 27 additions & 54 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,85 +14,58 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
ref: ${{ github.sha }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- uses: actions/cache@v4
with:
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
is-high-risk-environment: true
- uses: MetaMask/action-publish-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn install --immutable --immutable-cache
- run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: publish-release-artifacts-${{ github.sha }}
include-hidden-files: true
retention-days: 4
path: |
./packages/**/dist
./node_modules/.yarn-state.yml

publish-npm-dry-run:
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
ref: ${{ github.sha }}
- name: Install Node
uses: actions/setup-node@v4
is-high-risk-environment: true
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- uses: actions/cache@v4
with:
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
fail-on-cache-miss: true
- name: Dry Run Publish
name: publish-release-artifacts-${{ github.sha }}
- name: Dry run publish to NPM
# omit npm-token token to perform dry run publish
uses: MetaMask/action-npm-publish@v5
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
subteam: S042S7RE4AE # @metamask-npm-publishers
env:
SKIP_PREPACK: true

publish-npm:
name: Publish to NPM
environment: npm-publish
runs-on: ubuntu-latest
needs: publish-npm-dry-run
steps:
- uses: actions/checkout@v4
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
ref: ${{ github.sha }}
- name: Install Node
uses: actions/setup-node@v4
is-high-risk-environment: true
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- uses: actions/cache@v4
with:
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
fail-on-cache-miss: true
- name: Publish
name: publish-release-artifacts-${{ github.sha }}
- name: Publish to NPM
uses: MetaMask/action-npm-publish@v5
with:
npm-token: ${{ secrets.NPM_TOKEN }}
env:
SKIP_PREPACK: true
Loading