Skip to content

Commit f56060c

Browse files
committed
Publish release to GitHub after NPM
1 parent 8c8867c commit f56060c

1 file changed

Lines changed: 28 additions & 14 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ on:
1010
PUBLISH_DOCS_TOKEN:
1111
required: true
1212
jobs:
13-
publish-release:
14-
permissions:
15-
contents: write
13+
build:
14+
name: Build
1615
runs-on: ubuntu-latest
1716
steps:
1817
- name: Checkout and setup environment
1918
uses: MetaMask/action-checkout-and-setup@v3
2019
with:
2120
is-high-risk-environment: true
2221
ref: ${{ github.sha }}
23-
- uses: MetaMask/action-publish-release@v3
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
- run: yarn build
22+
- name: Build
23+
run: yarn build
2724
- name: Upload build artifacts
2825
uses: actions/upload-artifact@v7
2926
with:
@@ -35,13 +32,13 @@ jobs:
3532
./node_modules/.yarn-state.yml
3633
3734
publish-npm-dry-run:
38-
needs: publish-release
35+
name: Publish to NPM (dry run)
36+
needs: build
3937
runs-on: ubuntu-latest
4038
steps:
41-
- name: Checkout and setup environment
42-
uses: MetaMask/action-checkout-and-setup@v3
39+
- name: Checkout repository
40+
uses: actions/checkout@v6
4341
with:
44-
is-high-risk-environment: true
4542
ref: ${{ github.sha }}
4643
- name: Restore build artifacts
4744
uses: actions/download-artifact@v8
@@ -57,14 +54,14 @@ jobs:
5754
SKIP_PREPACK: true
5855

5956
publish-npm:
57+
name: Publish to NPM
6058
needs: publish-npm-dry-run
6159
runs-on: ubuntu-latest
6260
environment: npm-publish
6361
steps:
64-
- name: Checkout and setup environment
65-
uses: MetaMask/action-checkout-and-setup@v3
62+
- name: Checkout repository
63+
uses: actions/checkout@v6
6664
with:
67-
is-high-risk-environment: true
6865
ref: ${{ github.sha }}
6966
- name: Restore build artifacts
7067
uses: actions/download-artifact@v8
@@ -80,6 +77,7 @@ jobs:
8077
SKIP_PREPACK: true
8178

8279
get-release-version:
80+
name: Get release version
8381
needs: publish-npm
8482
runs-on: ubuntu-latest
8583
outputs:
@@ -113,3 +111,19 @@ jobs:
113111
destination_dir: latest
114112
secrets:
115113
PUBLISH_DOCS_TOKEN: ${{ secrets.PUBLISH_DOCS_TOKEN }}
114+
115+
publish-release:
116+
name: Publish release to GitHub
117+
needs: publish-npm
118+
permissions:
119+
contents: write
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Checkout and setup environment
123+
uses: MetaMask/action-checkout-and-setup@v3
124+
with:
125+
is-high-risk-environment: true
126+
ref: ${{ github.sha }}
127+
- uses: MetaMask/action-publish-release@v3
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)