Skip to content

Commit 20b6a0e

Browse files
committed
add pre-condition for early exit
1 parent 31a6b89 commit 20b6a0e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/publish.yml

+21
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,27 @@ jobs:
281281
# Refer to https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners#about-macos-larger-runners.
282282
os: [ macos-latest-xlarge, macos-latest-large ]
283283
steps:
284+
- name: Verify Runner Architecture
285+
run: |
286+
ARCH=$(uname -m)
287+
echo "Detected architecture: $ARCH"
288+
289+
if [ "${{ matrix.runner }}" == "macos-latest-xlarge" ]; then
290+
if [ "$ARCH" != "arm64" ]; then
291+
echo "Error: Expected ARM architecture (arm64) for macos-latest-xlarge, but got $ARCH."
292+
exit 1
293+
fi
294+
elif [ "${{ matrix.runner }}" == "macos-latest-large" ]; then
295+
if [ "$ARCH" != "x86_64" ]; then
296+
echo "Error: Expected Intel architecture (x86_64) for macos-latest-large, but got $ARCH."
297+
exit 1
298+
fi
299+
else
300+
echo "Error: Unexpected runner type ${{ matrix.runner }}!"
301+
exit 1
302+
fi
303+
304+
echo "Runner architecture verified successfully."
284305
- name: Checkout Vector
285306
uses: actions/checkout@v4
286307
with:

0 commit comments

Comments
 (0)