Skip to content

Commit ec148ff

Browse files
committed
build: add composite action to build with Bun and package single zip (bundle/opencode.zip)
1 parent 779961a commit ec148ff

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build and package (Bun -> single zip)
2+
description: Build with Bun and package a single distributable archive
3+
outputs:
4+
archive_path:
5+
description: Absolute path to the archive
6+
value: ${{ steps.pkg.outputs.archive_path }}
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Setup Bun
11+
uses: ./.github/actions/setup-bun
12+
13+
- name: Verify Bun
14+
shell: bash
15+
run: bun --version
16+
17+
- name: Install dependencies
18+
shell: bash
19+
run: bun install --frozen-lockfile || bun install
20+
21+
- name: Build
22+
shell: bash
23+
run: bun run build
24+
25+
- name: Ensure zip is available
26+
shell: bash
27+
run: sudo apt-get update -y && sudo apt-get install -y zip
28+
29+
- name: Package single file
30+
id: pkg
31+
shell: bash
32+
run: |
33+
set -e
34+
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
39+
echo "archive_path=$(pwd)/bundle/opencode.zip" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)