@@ -98,38 +98,19 @@ jobs:
9898 node-version : ' 20'
9999
100100 - name : Validate artifact compatibility (PR commit)
101- run : |
102- NODE_VERSION=$(node --version | sed 's/v//')
103- OS_NAME=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
104- EXPECTED_ARTIFACT="node-modules-eas-update-pr-node${NODE_VERSION}-${OS_NAME}"
105-
106- echo "🔍 Validating PR artifact compatibility..."
107- echo " Expected artifact: $EXPECTED_ARTIFACT"
108- echo " Actual artifact: ${{ env.PR_ARTIFACT_NAME }}"
109-
110- if [ "$EXPECTED_ARTIFACT" != "${{ env.PR_ARTIFACT_NAME }}" ]; then
111- echo "::error title=Artifact Incompatibility::Node version or OS mismatch detected!"
112- echo "❌ The node_modules artifact was built with different Node version or OS"
113- echo " This could cause issues with native node modules"
114- echo " Expected: $EXPECTED_ARTIFACT"
115- echo " Actual: ${{ env.PR_ARTIFACT_NAME }}"
116- exit 1
117- fi
118- echo "✅ PR artifact compatibility validated"
101+ uses : ./.github/actions/validate-artifact-compatibility
102+ with :
103+ artifact-name : ${{ env.PR_ARTIFACT_NAME }}
104+ artifact-prefix : node-modules-eas-update-pr
105+ validation-context : PR commit
119106
120107 - name : Download node_modules artifact (PR commit)
121108 uses : actions/download-artifact@v4
122109 with :
123110 name : ${{ env.PR_ARTIFACT_NAME }}
124111
125112 - name : Restore executable permissions
126- run : |
127- echo "🔧 Restoring executable permissions..."
128- find node_modules/.bin -type f -exec chmod +x {} \; 2>/dev/null || true
129- find node_modules -type f -name "*.node" -exec chmod +x {} \; 2>/dev/null || true
130- find node_modules -path "*/bin/*" -type f -exec chmod +x {} \; 2>/dev/null || true
131- find node_modules -path "*/sdks/*" -type f -exec chmod +x {} \; 2>/dev/null || true
132- echo "✅ Permissions restored"
113+ uses : ./.github/actions/restore-node-modules-permissions
133114
134115 - name : Verify downloaded artifacts
135116 run : |
@@ -153,24 +134,11 @@ jobs:
153134 echo "Target PR fingerprint: $FINGERPRINT"
154135
155136 - name : Validate artifact compatibility (base branch)
156- run : |
157- NODE_VERSION=$(node --version | sed 's/v//')
158- OS_NAME=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
159- EXPECTED_ARTIFACT="node-modules-eas-update-base-node${NODE_VERSION}-${OS_NAME}"
160-
161- echo "🔍 Validating base branch artifact compatibility..."
162- echo " Expected artifact: $EXPECTED_ARTIFACT"
163- echo " Actual artifact: ${{ env.BASE_ARTIFACT_NAME }}"
164-
165- if [ "$EXPECTED_ARTIFACT" != "${{ env.BASE_ARTIFACT_NAME }}" ]; then
166- echo "::error title=Artifact Incompatibility::Node version or OS mismatch detected!"
167- echo "❌ The node_modules artifact was built with different Node version or OS"
168- echo " This could cause issues with native node modules"
169- echo " Expected: $EXPECTED_ARTIFACT"
170- echo " Actual: ${{ env.BASE_ARTIFACT_NAME }}"
171- exit 1
172- fi
173- echo "✅ Base branch artifact compatibility validated"
137+ uses : ./.github/actions/validate-artifact-compatibility
138+ with :
139+ artifact-name : ${{ env.BASE_ARTIFACT_NAME }}
140+ artifact-prefix : node-modules-eas-update-base
141+ validation-context : base branch
174142
175143 - name : Download node_modules artifact (base branch)
176144 uses : actions/download-artifact@v4
@@ -179,14 +147,9 @@ jobs:
179147 path : main
180148
181149 - name : Restore executable permissions (base branch)
182- working-directory : main
183- run : |
184- echo "🔧 Restoring executable permissions..."
185- find node_modules/.bin -type f -exec chmod +x {} \; 2>/dev/null || true
186- find node_modules -type f -name "*.node" -exec chmod +x {} \; 2>/dev/null || true
187- find node_modules -path "*/bin/*" -type f -exec chmod +x {} \; 2>/dev/null || true
188- find node_modules -path "*/sdks/*" -type f -exec chmod +x {} \; 2>/dev/null || true
189- echo "✅ Permissions restored"
150+ uses : ./.github/actions/restore-node-modules-permissions
151+ with :
152+ working-directory : main
190153
191154 - name : Generate fingerprint (base branch)
192155 id : main_fingerprint
@@ -265,10 +228,10 @@ jobs:
265228 if : ${{ needs.fingerprint-comparison.outputs.fingerprints_equal == 'true' }}
266229 runs-on : ubuntu-latest
267230 steps :
268- - name : Await approval from mobile platform team
231+ - name : Await approval from mobile release team
269232 uses : op5dev/require-team-approval@dfd7b8b9a88bf82a955c103f7e19642b0411aecd
270233 with :
271- team : mobile-platform
234+ team : release-team
272235 pr-number : ${{ needs.validate-pr.outputs.pr_number }}
273236 token : ${{ secrets.METAMASK_MOBILE_ORG_READ_TOKEN }}
274237
@@ -345,38 +308,19 @@ jobs:
345308 node-version : ' 20'
346309
347310 - name : Validate artifact compatibility
348- run : |
349- NODE_VERSION=$(node --version | sed 's/v//')
350- OS_NAME=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
351- EXPECTED_ARTIFACT="node-modules-eas-update-pr-node${NODE_VERSION}-${OS_NAME}"
352-
353- echo "🔍 Validating artifact compatibility..."
354- echo " Expected artifact: $EXPECTED_ARTIFACT"
355- echo " Actual artifact: ${{ env.ARTIFACT_NAME }}"
356-
357- if [ "$EXPECTED_ARTIFACT" != "${{ env.ARTIFACT_NAME }}" ]; then
358- echo "::error title=Artifact Incompatibility::Node version or OS mismatch detected!"
359- echo "❌ The node_modules artifact was built with different Node version or OS"
360- echo " This could cause issues with native node modules"
361- echo " Expected: $EXPECTED_ARTIFACT"
362- echo " Actual: ${{ env.ARTIFACT_NAME }}"
363- exit 1
364- fi
365- echo "✅ Artifact compatibility validated"
311+ uses : ./.github/actions/validate-artifact-compatibility
312+ with :
313+ artifact-name : ${{ env.ARTIFACT_NAME }}
314+ artifact-prefix : node-modules-eas-update-pr
315+ validation-context : artifact
366316
367317 - name : Download node_modules artifact
368318 uses : actions/download-artifact@v4
369319 with :
370320 name : ${{ env.ARTIFACT_NAME }}
371321
372322 - name : Restore executable permissions
373- run : |
374- echo "🔧 Restoring executable permissions..."
375- find node_modules/.bin -type f -exec chmod +x {} \; 2>/dev/null || true
376- find node_modules -type f -name "*.node" -exec chmod +x {} \; 2>/dev/null || true
377- find node_modules -path "*/bin/*" -type f -exec chmod +x {} \; 2>/dev/null || true
378- find node_modules -path "*/sdks/*" -type f -exec chmod +x {} \; 2>/dev/null || true
379- echo "✅ Permissions restored"
323+ uses : ./.github/actions/restore-node-modules-permissions
380324
381325 - name : Verify downloaded artifacts
382326 run : |
0 commit comments