Skip to content

Commit 2facd0b

Browse files
committed
build(composite): use bunx turbo run build (root build script not present); package dist/build if present else repo minus heavy dirs
1 parent 2b38bbe commit 2facd0b

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/actions/build-package/action.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build and package (Bun -> single zip)
2-
description: Build with Bun and package a single distributable archive
2+
description: Build with Bun (Turbo) and package a single distributable archive
33
outputs:
44
archive_path:
55
description: Absolute path to the archive
@@ -18,9 +18,9 @@ runs:
1818
shell: bash
1919
run: bun install --frozen-lockfile || bun install
2020

21-
- name: Build
21+
- name: Build (Turbo)
2222
shell: bash
23-
run: bun run build
23+
run: bunx turbo run build
2424

2525
- name: Ensure zip is available
2626
shell: bash
@@ -32,8 +32,11 @@ runs:
3232
run: |
3333
set -e
3434
mkdir -p bundle
35-
if [ -d dist ]; then SRC=dist; elif [ -d build ]; then SRC=build; else echo 'No dist/ or build/ after build. Check project build output path.' >&2; exit 1; fi
36-
cd "$SRC"
37-
zip -r ../bundle/opencode.zip .
38-
cd - >/dev/null
35+
# Prefer a top-level dist/ or build/ if produced; else package repo (minus heavy dirs)
36+
if [ -d dist ]; then SRC=dist; elif [ -d build ]; then SRC=build; else SRC=.; fi
37+
if [ "$SRC" = "." ]; then
38+
zip -r bundle/opencode.zip . -x '.git/*' '.github/*' 'node_modules/*'
39+
else
40+
(cd "$SRC" && zip -r ../bundle/opencode.zip .)
41+
fi
3942
echo "archive_path=$(pwd)/bundle/opencode.zip" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)