Skip to content

Commit 9a85201

Browse files
fix build release files
1 parent f52a922 commit 9a85201

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,10 @@ jobs:
7474
uses: actions/download-artifact@v4
7575
with:
7676
path: dist
77-
- name: Archive binaries
78-
run: |
79-
cd dist
80-
zip json-to-sql-Linux.zip json-to-sql-Linux
81-
zip json-to-sql-macOS.zip json-to-sql-macOS
8277
- name: Create GitHub Release
8378
uses: softprops/action-gh-release@v2
8479
with:
85-
files: dist/*.zip
80+
files: dist/
8681
tag_name: ${{ github.ref }}
8782
name: Release ${{ github.ref }}
8883
body: |

setup.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,33 @@ if [[ -z "$BINARY_URL" ]]; then
2222
exit 1
2323
fi
2424

25-
# Download and extract the binary
25+
# Download the binary zip file
2626
echo "Downloading json-to-sql ($OS)..."
2727
curl -L "$BINARY_URL" -o "$TEMP_DIR/$FILE"
2828

29-
echo "Extracting..."
30-
unzip -q "$TEMP_DIR/$FILE" -d "$TEMP_DIR"
29+
# Check if the zip file is empty
30+
if [[ $(unzip -l "$TEMP_DIR/$FILE" | wc -l) -le 3 ]]; then
31+
echo "Error: The zip file is empty or does not contain the expected binary."
32+
exit 1
33+
fi
3134

32-
# List contents of the temporary directory for debugging
33-
echo "Contents of $TEMP_DIR:"
34-
ls -l "$TEMP_DIR"
35+
# Extract the binary
36+
unzip -q "$TEMP_DIR/$FILE" -d "$TEMP_DIR"
3537

3638
# Check if the extracted directory exists
37-
EXTRACTED_DIR="$TEMP_DIR/json-to-sql-${OS}"
39+
EXTRACTED_DIR="$TEMP_DIR/json-to-sql-macOS"
40+
if [[ "$OS" == "Linux" ]]; then
41+
EXTRACTED_DIR="$TEMP_DIR/json-to-sql-Linux"
42+
fi
43+
3844
if [[ ! -d "$EXTRACTED_DIR" ]]; then
3945
echo "Error: Extracted directory not found."
4046
exit 1
4147
fi
4248

4349
# Check if the binary exists in the extracted directory
44-
BINARY_PATH="$EXTRACTED_DIR/json-to-sql"
45-
if [[ ! -f "$BINARY_PATH" ]]; then
50+
BINARY_PATH=$(find "$TEMP_DIR" -type f -name "json-to-sql" | head -n 1)
51+
if [[ -z "$BINARY_PATH" ]]; then
4652
echo "Error: Extracted binary not found."
4753
exit 1
4854
fi

0 commit comments

Comments
 (0)