Skip to content

Commit 0eb313f

Browse files
stainless-app[bot]batuhan
authored andcommitted
chore: zip READMEs as part of build artifact
1 parent 1de48f2 commit 0eb313f

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

scripts/utils/upload-artifact.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ BINARY_NAME="beeper-desktop-cli"
55
DIST_DIR="dist"
66
FILENAME="dist.zip"
77

8-
mapfile -d '' files < <(
9-
find "$DIST_DIR" -regextype posix-extended -type f \
10-
-regex ".*/[^/]*(amd64|arm64)[^/]*/${BINARY_NAME}(\\.exe)?$" -print0
11-
)
8+
files=()
9+
while IFS= read -r -d '' file; do
10+
files+=("$file")
11+
done < <(find "$DIST_DIR" -type f \( \
12+
-path "*amd64*/$BINARY_NAME" -o \
13+
-path "*arm64*/$BINARY_NAME" -o \
14+
-path "*amd64*/${BINARY_NAME}.exe" -o \
15+
-path "*arm64*/${BINARY_NAME}.exe" \
16+
\) -print0)
1217

1318
if [[ ${#files[@]} -eq 0 ]]; then
1419
echo -e "\033[31mNo binaries found for packaging.\033[0m"
@@ -20,7 +25,8 @@ rm -f "${DIST_DIR}/${FILENAME}"
2025
while IFS= read -r -d '' dir; do
2126
printf "Remove the quarantine attribute before running the executable:\n\nxattr -d com.apple.quarantine %s\n" \
2227
"$BINARY_NAME" >"${dir}/README.txt"
23-
done < <(find "$DIST_DIR" -type d -name '*macos*' -print0)
28+
files+=("${dir}/README.txt")
29+
done < <(find "$DIST_DIR" -type d -path '*macos*' -print0)
2430

2531
relative_files=()
2632
for file in "${files[@]}"; do
@@ -46,7 +52,7 @@ UPLOAD_RESPONSE=$(curl -v -X PUT \
4652

4753
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
4854
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
49-
echo -e "\033[32mInstallation: Download and unzip: 'https://pkg.stainless.com/s/beeper-desktop-api-cli/$SHA/$FILENAME'. On macOS, run `xattr -d com.apple.quarantine {executable name}.`\033[0m"
55+
echo -e "\033[32mInstallation: Download and unzip: 'https://pkg.stainless.com/s/beeper-desktop-api-cli/$SHA/$FILENAME'. On macOS, run 'xattr -d com.apple.quarantine {executable name}'.\033[0m"
5056
else
5157
echo -e "\033[31mFailed to upload artifact.\033[0m"
5258
exit 1

0 commit comments

Comments
 (0)