Skip to content

Commit 2702bed

Browse files
committed
Update action versions, add strict type to create-release-pr and fix order in publish-release
1 parent eff1b66 commit 2702bed

5 files changed

Lines changed: 50 additions & 40 deletions

File tree

.github/workflows/build-lint-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
node-version: [20.x, 22.x, 24.x]
1313
steps:
1414
- name: Checkout and setup environment
15-
uses: MetaMask/action-checkout-and-setup@v2
15+
uses: MetaMask/action-checkout-and-setup@v3
1616
with:
1717
is-high-risk-environment: false
1818
node-version: ${{ matrix.node-version }}
@@ -27,7 +27,7 @@ jobs:
2727
node-version: [24.x]
2828
steps:
2929
- name: Checkout and setup environment
30-
uses: MetaMask/action-checkout-and-setup@v2
30+
uses: MetaMask/action-checkout-and-setup@v3
3131
with:
3232
is-high-risk-environment: false
3333
node-version: ${{ matrix.node-version }}
@@ -49,7 +49,7 @@ jobs:
4949
node-version: [24.x]
5050
steps:
5151
- name: Checkout and setup environment
52-
uses: MetaMask/action-checkout-and-setup@v2
52+
uses: MetaMask/action-checkout-and-setup@v3
5353
with:
5454
is-high-risk-environment: false
5555
node-version: ${{ matrix.node-version }}
@@ -77,7 +77,7 @@ jobs:
7777
node-version: [20.x, 22.x, 24.x]
7878
steps:
7979
- name: Checkout and setup environment
80-
uses: MetaMask/action-checkout-and-setup@v2
80+
uses: MetaMask/action-checkout-and-setup@v3
8181
with:
8282
is-high-risk-environment: false
8383
node-version: ${{ matrix.node-version }}
@@ -99,7 +99,7 @@ jobs:
9999
node-version: [20.x, 22.x, 24.x]
100100
steps:
101101
- name: Checkout and setup environment
102-
uses: MetaMask/action-checkout-and-setup@v2
102+
uses: MetaMask/action-checkout-and-setup@v3
103103
with:
104104
is-high-risk-environment: false
105105
node-version: ${{ matrix.node-version }}

.github/workflows/create-release-pr.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ on:
44
workflow_dispatch:
55
inputs:
66
base-branch:
7-
description: 'The base branch for git operations and the pull request.'
8-
default: 'main'
7+
description: "The base branch for git operations and the pull request."
8+
default: "main"
99
required: true
1010
release-type:
1111
description: 'A SemVer version diff, i.e. major, minor, or patch. Mutually exclusive with "release-version".'
1212
required: false
13+
type: choice
14+
options:
15+
- ""
16+
- major
17+
- minor
18+
- patch
1319
release-version:
1420
description: 'A specific version to bump to. Mutually exclusive with "release-type".'
1521
required: false
@@ -22,7 +28,7 @@ jobs:
2228
pull-requests: write
2329
steps:
2430
- name: Checkout and setup environment
25-
uses: MetaMask/action-checkout-and-setup@v2
31+
uses: MetaMask/action-checkout-and-setup@v3
2632
with:
2733
is-high-risk-environment: true
2834

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout and setup environment
14-
uses: MetaMask/action-checkout-and-setup@v2
14+
uses: MetaMask/action-checkout-and-setup@v3
1515
with:
1616
is-high-risk-environment: false
1717
- name: Download actionlint
1818
id: download-actionlint
19-
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.23
19+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash) 1.7.12
2020
shell: bash
2121
- name: Check workflow files
2222
run: ${{ steps.download-actionlint.outputs.executable }} -color

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: ${{ inputs.destination_dir == '' }}
2323
run: exit 1
2424
- name: Checkout and setup environment
25-
uses: MetaMask/action-checkout-and-setup@v2
25+
uses: MetaMask/action-checkout-and-setup@v3
2626
with:
2727
is-high-risk-environment: true
2828
- name: Run build script

.github/workflows/publish-release.yml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,17 @@ on:
1010
PUBLISH_DOCS_TOKEN:
1111
required: true
1212
jobs:
13-
publish-release:
14-
permissions:
15-
contents: write
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Checkout and setup environment
19-
uses: MetaMask/action-checkout-and-setup@v2
20-
with:
21-
is-high-risk-environment: true
22-
ref: ${{ github.sha }}
23-
- uses: MetaMask/action-publish-release@v3
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
- run: yarn build
27-
- name: Upload build artifacts
28-
uses: actions/upload-artifact@v5
29-
with:
30-
name: publish-release-artifacts-${{ github.sha }}
31-
retention-days: 4
32-
include-hidden-files: true
33-
path: |
34-
./dist
35-
./node_modules/.yarn-state.yml
36-
3713
publish-npm-dry-run:
38-
needs: publish-release
14+
name: Publish to NPM (dry run)
3915
runs-on: ubuntu-latest
4016
steps:
4117
- name: Checkout and setup environment
42-
uses: MetaMask/action-checkout-and-setup@v2
18+
uses: MetaMask/action-checkout-and-setup@v3
4319
with:
4420
is-high-risk-environment: true
4521
ref: ${{ github.sha }}
4622
- name: Restore build artifacts
47-
uses: actions/download-artifact@v6
23+
uses: actions/download-artifact@v8
4824
with:
4925
name: publish-release-artifacts-${{ github.sha }}
5026
- name: Dry Run Publish
@@ -57,17 +33,18 @@ jobs:
5733
SKIP_PREPACK: true
5834

5935
publish-npm:
36+
name: Publish to NPM
6037
needs: publish-npm-dry-run
6138
runs-on: ubuntu-latest
6239
environment: npm-publish
6340
steps:
6441
- name: Checkout and setup environment
65-
uses: MetaMask/action-checkout-and-setup@v2
42+
uses: MetaMask/action-checkout-and-setup@v3
6643
with:
6744
is-high-risk-environment: true
6845
ref: ${{ github.sha }}
6946
- name: Restore build artifacts
70-
uses: actions/download-artifact@v6
47+
uses: actions/download-artifact@v8
7148
with:
7249
name: publish-release-artifacts-${{ github.sha }}
7350
- name: Publish
@@ -80,6 +57,7 @@ jobs:
8057
SKIP_PREPACK: true
8158

8259
get-release-version:
60+
name: Get release version
8361
needs: publish-npm
8462
runs-on: ubuntu-latest
8563
outputs:
@@ -113,3 +91,29 @@ jobs:
11391
destination_dir: latest
11492
secrets:
11593
PUBLISH_DOCS_TOKEN: ${{ secrets.PUBLISH_DOCS_TOKEN }}
94+
95+
publish-release:
96+
name: Publish release to GitHub
97+
needs: publish-npm
98+
permissions:
99+
contents: write
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: Checkout and setup environment
103+
uses: MetaMask/action-checkout-and-setup@v3
104+
with:
105+
is-high-risk-environment: true
106+
ref: ${{ github.sha }}
107+
- uses: MetaMask/action-publish-release@v3
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
- run: yarn build
111+
- name: Upload build artifacts
112+
uses: actions/upload-artifact@v7
113+
with:
114+
name: publish-release-artifacts-${{ github.sha }}
115+
retention-days: 4
116+
include-hidden-files: true
117+
path: |
118+
./dist
119+
./node_modules/.yarn-state.yml

0 commit comments

Comments
 (0)