Skip to content

Commit 8df6e35

Browse files
committed
fix(ci): use mktemp for xlings extraction on macOS
macOS /tmp symlinks to /private/tmp which breaks find. Use explicit mktemp -d and construct the expected directory name directly.
1 parent 646faf4 commit 8df6e35

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

.github/workflows/ci-macos.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,16 @@ jobs:
5959
run: |
6060
# Download and install xlings for macOS ARM64
6161
# xlings release uses "macosx-arm64" naming convention
62+
WORK=$(mktemp -d)
6263
tarball="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
63-
curl -fsSL -o "/tmp/${tarball}" \
64+
curl -fsSL -o "${WORK}/${tarball}" \
6465
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
65-
tar -xzf "/tmp/${tarball}" -C /tmp
66-
# Find the extracted directory
67-
XLINGS_DIR=$(find /tmp -maxdepth 1 -name "xlings-*" -type d | head -1)
66+
tar -xzf "${WORK}/${tarball}" -C "${WORK}"
67+
XLINGS_DIR="${WORK}/xlings-${XLINGS_VERSION}-macosx-arm64"
6868
echo "xlings dir: $XLINGS_DIR"
6969
ls "$XLINGS_DIR/"
7070
# Install xlings
71-
if [ -f "$XLINGS_DIR/subos/default/bin/xlings" ]; then
72-
"$XLINGS_DIR/subos/default/bin/xlings" self install
73-
elif [ -f "$XLINGS_DIR/bin/xlings" ]; then
74-
"$XLINGS_DIR/bin/xlings" self install
75-
else
76-
echo "::error::Cannot find xlings binary in extracted tarball"
77-
find "$XLINGS_DIR" -name xlings -type f
78-
exit 1
79-
fi
71+
"$XLINGS_DIR/subos/default/bin/xlings" self install
8072
export PATH="$HOME/.xlings/subos/default/bin:$HOME/.xlings/bin:$PATH"
8173
xlings --version
8274
# Install mcpp

0 commit comments

Comments
 (0)