Skip to content

Commit 3ef3bcc

Browse files
committed
chore: wip
1 parent a41177c commit 3ef3bcc

File tree

3 files changed

+37
-30
lines changed

3 files changed

+37
-30
lines changed

.github/workflows/precompile-php.yml

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -983,22 +983,11 @@ jobs:
983983
find . -name "*.tar.gz" -type f
984984
echo ""
985985
986-
# Create a manifest of all built binaries
987-
cat > manifest.json << EOF
988-
{
989-
"version": "$(date +%Y.%m.%d)",
990-
"built_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
991-
"commit": "${{ github.sha }}",
992-
"binaries": [
993-
EOF
986+
# Create a temporary JSON array file
987+
echo "[]" > binaries_array.json
994988
995-
first=true
996-
# Find all tar.gz files recursively
989+
# Find all tar.gz files recursively and process them
997990
for tarball in $(find . -name "*.tar.gz" -type f); do
998-
if [[ $first == "false" ]]; then
999-
echo "," >> manifest.json
1000-
fi
1001-
1002991
filename=$(basename "$tarball")
1003992
size=$(stat -c%s "$tarball" 2>/dev/null || stat -f%z "$tarball")
1004993
@@ -1025,21 +1014,39 @@ jobs:
10251014
configuration="unknown"
10261015
fi
10271016
1028-
echo " {" >> manifest.json
1029-
echo " \"filename\": \"$filename\"," >> manifest.json
1030-
echo " \"size\": $size," >> manifest.json
1031-
echo " \"php_version\": \"$php_version\"," >> manifest.json
1032-
echo " \"platform\": \"$platform\"," >> manifest.json
1033-
echo " \"architecture\": \"$architecture\"," >> manifest.json
1034-
echo " \"configuration\": \"$configuration\"," >> manifest.json
1035-
echo " \"built_at\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"," >> manifest.json
1036-
echo " \"extensions\": \"$(cat temp_metadata.json | jq -r '.extensions // ""' 2>/dev/null || echo '')\"" >> manifest.json
1037-
echo " }" >> manifest.json
1038-
first=false
1017+
# Create JSON object for this binary
1018+
binary_json=$(cat <<EOF
1019+
{
1020+
"filename": "$filename",
1021+
"size": $size,
1022+
"php_version": "$php_version",
1023+
"platform": "$platform",
1024+
"architecture": "$architecture",
1025+
"configuration": "$configuration",
1026+
"built_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
1027+
"extensions": "$(cat temp_metadata.json | jq -r '.extensions // ""' 2>/dev/null || echo '')"
1028+
}
1029+
EOF
1030+
)
1031+
1032+
# Add this binary to the array using jq
1033+
jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json
1034+
mv temp_array.json binaries_array.json
10391035
done
10401036

1041-
echo " ]" >> manifest.json
1042-
echo " }" >> manifest.json
1037+
# Create the final manifest with proper structure and sorted binaries
1038+
jq --arg version "$(date +%Y.%m.%d)" \
1039+
--arg built_at "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
1040+
--arg commit "${{ github.sha }}" \
1041+
'{
1042+
version: $version,
1043+
built_at: $built_at,
1044+
commit: $commit,
1045+
binaries: (. | sort_by(.php_version))
1046+
}' binaries_array.json > manifest.json
1047+
1048+
# Clean up temporary files
1049+
rm -f binaries_array.json temp_metadata.json
10431050

10441051
echo ""
10451052
echo "📋 Generated manifest.json:"

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@stacksjs/docs": "^0.70.23",
88
"@stacksjs/eslint-config": "^4.14.0-beta.3",
99
"@types/bun": "^1.2.19",
10-
"buddy-bot": "^0.7.1",
10+
"buddy-bot": "^0.7.3",
1111
"bumpp": "^10.2.2",
1212
"bun-plugin-dtsx": "0.9.5",
1313
"changelogen": "^0.6.2",
@@ -848,7 +848,7 @@
848848

849849
"browserslist": ["[email protected]", "", { "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw=="],
850850

851-
"buddy-bot": ["[email protected].1", "", { "dependencies": { "@types/prompts": "^2.4.9", "bunfig": "^0.10.1", "cac": "6.7.13", "prompts": "^2.4.2", "ts-pkgx": "0.4.25" }, "bin": { "buddy-bot": "dist/bin/cli.js" } }, "sha512-FLZOElOZEydoEybCAcNdV9/FrGm3mIcXyZzcQFeocP3/OJ7ZqSfsxE9eilz9U0zi4xiMktcXFcH/5Eej95aubA=="],
851+
"buddy-bot": ["[email protected].3", "", { "dependencies": { "@types/prompts": "^2.4.9", "bunfig": "^0.10.1", "cac": "6.7.13", "prompts": "^2.4.2", "ts-pkgx": "0.4.25" }, "bin": { "buddy-bot": "dist/bin/cli.js" } }, "sha512-mO1fPq8ewn+9+OwgPmNC2U9fyMI52F2ZK3V8GUQK1QvaUGIph1oUYoTTRvIgk32I+lf493ng1KOab76ZIBmLeg=="],
852852

853853
"buffer-crc32": ["[email protected]", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="],
854854

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@stacksjs/docs": "^0.70.23",
3333
"@stacksjs/eslint-config": "^4.14.0-beta.3",
3434
"@types/bun": "^1.2.19",
35-
"buddy-bot": "^0.7.1",
35+
"buddy-bot": "^0.7.3",
3636
"bumpp": "^10.2.2",
3737
"bun-plugin-dtsx": "0.9.5",
3838
"changelogen": "^0.6.2",

0 commit comments

Comments
 (0)