@@ -33,17 +33,15 @@ jobs:
3333 contents : write
3434 runs-on : ubuntu-latest
3535 steps :
36- - uses : actions/checkout@v3
36+ - name : Checkout and setup environment
37+ uses : MetaMask/action-checkout-and-setup@v1
3738 with :
39+ is-high-risk-environment : true
3840 ref : ${{ github.sha }}
39- - name : Setup Node.js
40- uses : actions/setup-node@v3
41- with :
42- node-version-file : ' .nvmrc'
4341 - uses : MetaMask/action-publish-release@v3
4442 env :
4543 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46- - name : Install
44+ - name : Build
4745 run : |
4846 yarn install
4947 yarn workspace @metamask/solana-wallet-snap build
@@ -59,36 +57,31 @@ jobs:
5957 TOKEN_API_BASE_URL : ${{ secrets.TOKEN_API_BASE_URL }}
6058 STATIC_API_BASE_URL : ${{ secrets.STATIC_API_BASE_URL }}
6159 SECURITY_ALERTS_API_BASE_URL : ${{ secrets.SECURITY_ALERTS_API_BASE_URL }}
62- - uses : actions/cache@v4
63- id : restore-build
60+ - name : Upload build artifacts
61+ uses : actions/upload-artifact@v4
6462 with :
65- # We must cache the `snap.manifest.json` file because it might change
66- # during the release build due to secrets being injected by the CI.
63+ name : publish-release-artifacts-${{ github.sha }}
64+ include-hidden-files : true
65+ retention-days : 4
6766 path : |
68- ./packages/*/dist
67+ ./packages/** /dist
6968 ./packages/snap/snap.manifest.json
7069 ./node_modules/.yarn-state.yml
71- key : ${{ github.sha }}
7270
7371 publish-npm-dry-run :
7472 runs-on : ubuntu-latest
7573 needs : publish-release
7674 steps :
77- - uses : actions/checkout@v3
75+ - name : Checkout and setup environment
76+ uses : MetaMask/action-checkout-and-setup@v1
7877 with :
78+ is-high-risk-environment : true
7979 ref : ${{ github.sha }}
80- - uses : actions/cache@v4
81- id : restore-build
80+ - name : Restore build artifacts
81+ uses : actions/download-artifact@v4
8282 with :
83- # We must cache the `snap.manifest.json` file because it might change
84- # during the release build due to secrets being injected by the CI.
85- path : |
86- ./packages/*/dist
87- ./packages/snap/snap.manifest.json
88- ./node_modules/.yarn-state.yml
89- key : ${{ github.sha }}
83+ name : publish-release-artifacts-${{ github.sha }}
9084 - name : Dry Run Publish
91- # Omit npm-token token to perform dry-run publish
9285 uses : MetaMask/action-npm-publish@v4
9386 with :
9487 slack-webhook-url : ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -101,24 +94,18 @@ jobs:
10194 runs-on : ubuntu-latest
10295 needs : publish-npm-dry-run
10396 steps :
104- - uses : actions/checkout@v3
97+ - name : Checkout and setup environment
98+ uses : MetaMask/action-checkout-and-setup@v1
10599 with :
100+ is-high-risk-environment : true
106101 ref : ${{ github.sha }}
107- - uses : actions/cache@v4
108- id : restore-build
102+ - name : Restore build artifacts
103+ uses : actions/download-artifact@v4
109104 with :
110- # We must cache the `snap.manifest.json` file because it might change
111- # during the release build due to secrets being injected by the CI.
112- path : |
113- ./packages/*/dist
114- ./packages/snap/snap.manifest.json
115- ./node_modules/.yarn-state.yml
116- key : ${{ github.sha }}
105+ name : publish-release-artifacts-${{ github.sha }}
117106 - name : Publish
118107 uses : MetaMask/action-npm-publish@v2
119108 with :
120- # This `NPM_TOKEN` needs to be manually set per-repository.
121- # Look in the repository settings under "Environments", and set this token in the `npm-publish` environment.
122109 npm-token : ${{ secrets.NPM_TOKEN }}
123110 env :
124111 SKIP_PREPACK : true
0 commit comments