You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Explanation:** This workflow uses a single job for simplicity. It determines `RUNTIME` and `IS_CLI` via a bash step. Depending on `RUNTIME`, it sets up the appropriate environment and installs dependencies. It then calls `bin/publish.sh` and/or `bin/release.sh` to perform publishing and binary compilation. Finally, it creates a GitHub Release for the tag and uploads any release assets. (For library-only projects with no binaries, `bin/release.sh` will be skipped and the release will just be a tag with perhaps source code available.)
@@ -319,7 +297,7 @@ This script runs only for CLI tools that need standalone binaries (when `COMPILE
319
297
set -e
320
298
321
299
# Ensure output directory
322
-
mkdir -p dist
300
+
mkdir -p bin
323
301
324
302
# Get package/tool name (for naming binaries)
325
303
NAME=""
@@ -337,34 +315,34 @@ echo "Compiling binaries for $NAME..."
337
315
338
316
if [[ -f"deno.json"||-f"deno.jsonc" ]];then
339
317
# Deno cross-compilation for all targets:contentReference[oaicite:26]{index=26}
340
-
deno compile -A --output dist/"$NAME-linux" --target x86_64-unknown-linux-gnu ${ENTRY:-main.ts}
341
-
deno compile -A --output dist/"$NAME-macos" --target x86_64-apple-darwin ${ENTRY:-main.ts}
342
-
deno compile -A --output dist/"$NAME-macos-arm64" --target aarch64-apple-darwin ${ENTRY:-main.ts}
343
-
deno compile -A --output dist/"$NAME-windows.exe" --target x86_64-pc-windows-msvc ${ENTRY:-main.ts}
318
+
deno compile -A --output bin/"$NAME-linux" --target x86_64-unknown-linux-gnu ${ENTRY:-main.ts}
319
+
deno compile -A --output bin/"$NAME-macos" --target x86_64-apple-darwin ${ENTRY:-main.ts}
320
+
deno compile -A --output bin/"$NAME-macos-arm64" --target aarch64-apple-darwin ${ENTRY:-main.ts}
321
+
deno compile -A --output bin/"$NAME-windows.exe" --target x86_64-pc-windows-msvc ${ENTRY:-main.ts}
344
322
elif [[ -f"bun.json"||-f"bun.lockb" ]];then
345
323
# Bun cross-compilation (x64 targets):contentReference[oaicite:27]{index=27}:contentReference[oaicite:28]{index=28}
346
-
bun build --compile --target=bun-linux-x64 src/*.ts --outfile dist/"$NAME-linux"
347
-
bun build --compile --target=bun-darwin-x64 src/*.ts --outfile dist/"$NAME-macos"
348
-
bun build --compile --target=bun-windows-x64 src/*.ts --outfile dist/"$NAME-windows.exe"
324
+
bun build --compile --target=bun-linux-x64 src/*.ts --outfile bin/"$NAME-linux"
325
+
bun build --compile --target=bun-darwin-x64 src/*.ts --outfile bin/"$NAME-macos"
326
+
bun build --compile --target=bun-windows-x64 src/*.ts --outfile bin/"$NAME-windows.exe"
349
327
# Note: Bun will add .exe for Windows if not specified:contentReference[oaicite:29]{index=29}
350
328
else
351
329
# Node: use vercel/pkg to generate executables:contentReference[oaicite:30]{index=30}
# (Optional) compress the binaries for smaller download (not done here for simplicity)
365
343
366
344
echo"Binaries compiled. Verifying files:"
367
-
ls -lh dist/
345
+
ls -lh bin/
368
346
369
347
# Prepare install.sh (in repo root) if not present
370
348
if [ !-f"install.sh" ];then
@@ -422,7 +400,7 @@ A few points about `bin/release.sh`:
422
400
* Makes the binary executable and prints a success message.
423
401
* For Windows, since this is a Bash script, it would typically be run in WSL or Git Bash. Windows users not using a UNIX shell can manually download the `.exe` or use a PowerShell equivalent script (not included here).
424
402
425
-
After running `bin/release.sh`, the `dist/` folder contains our compiled binaries named `${NAME}-linux`, `${NAME}-macos`, `${NAME}-macos-arm64` (if Deno), and `${NAME}-windows.exe`. The workflow then attaches everything in `dist/` as well as the `install.sh` to the GitHub Release. Users can now go to the release page and download the binaries, or simply run the one-liner install command:
403
+
After running `bin/release.sh`, the `bin/` folder contains our compiled binaries named `${NAME}-linux`, `${NAME}-macos`, `${NAME}-macos-arm64` (if Deno), and `${NAME}-windows.exe`. The workflow then attaches everything in `bin/` as well as the `install.sh` to the GitHub Release. Users can now go to the release page and download the binaries, or simply run the one-liner install command:
0 commit comments