mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
build(cli): zstd-compress the tar before artifact upload
Uncompressed tar left the artifact at ~2.7 GB (same as no-compression zip on the previous attempt). zstd compresses the tree-sitter wasms ~4x while being near-native speed on the already-compact binaries, which should bring the artifact close to ~1 GB. zstd 1.5.7 and GNU tar 1.35 are preinstalled on both github-hosted and blacksmith ubuntu-2404 images (per the actions/runner-images Ubuntu2404 manifest and blacksmith's drop-in-replacement docs). Already used in this same workflow by actions/cache@v4 for bun pm cache restoration, so availability is empirically confirmed.
This commit is contained in:
@@ -95,20 +95,22 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
|
||||
# kilocode_change start - tar the whole dist tree into a single file before upload.
|
||||
# download-artifact@v4's streaming unzip is CPU-bound and processes entries one by
|
||||
# one; collapsing ~480 files into one tar cuts build-vscode download from >30m to
|
||||
# seconds. compression-level: 0 avoids double-compressing binaries on the outer zip.
|
||||
# kilocode_change start - pack dist tree into a single zstd-compressed tar before upload.
|
||||
# download-artifact@v4's streaming unzip is CPU-bound and processes entries one by one;
|
||||
# collapsing ~480 files into one tar cuts build-vscode download from >30m to seconds.
|
||||
# zstd compresses the wasms (~4x) and leaves the already-compact binaries alone, for
|
||||
# ~1 GB artifact. compression-level: 0 on the outer zip avoids double-compression.
|
||||
# zstd + GNU tar are preinstalled on both github-hosted and blacksmith ubuntu-2404.
|
||||
# See actions/upload-artifact#36, actions/toolkit#1533.
|
||||
- name: Pack CLI dist into tar
|
||||
- name: Pack CLI dist into tar.zst
|
||||
run: |
|
||||
find packages/opencode/dist -name '*.map' -delete
|
||||
tar -cf /tmp/kilo-cli.tar -C packages/opencode/dist .
|
||||
tar --zstd -cf /tmp/kilo-cli.tar.zst -C packages/opencode/dist .
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kilo-cli
|
||||
path: /tmp/kilo-cli.tar
|
||||
path: /tmp/kilo-cli.tar.zst
|
||||
compression-level: 0
|
||||
# kilocode_change end
|
||||
|
||||
@@ -137,11 +139,11 @@ jobs:
|
||||
name: kilo-cli
|
||||
path: /tmp
|
||||
|
||||
# kilocode_change start - extract the tar packed by build-cli
|
||||
# kilocode_change start - extract the tar.zst packed by build-cli
|
||||
- name: Unpack CLI dist
|
||||
run: |
|
||||
mkdir -p packages/opencode/dist
|
||||
tar -xf /tmp/kilo-cli.tar -C packages/opencode/dist
|
||||
tar --zstd -xf /tmp/kilo-cli.tar.zst -C packages/opencode/dist
|
||||
# kilocode_change end
|
||||
- name: Build VSIX packages
|
||||
run: bun script/build.ts
|
||||
@@ -335,11 +337,11 @@ jobs:
|
||||
name: kilo-cli
|
||||
path: /tmp
|
||||
|
||||
# kilocode_change start - extract the tar packed by build-cli
|
||||
# kilocode_change start - extract the tar.zst packed by build-cli
|
||||
- name: Unpack CLI dist
|
||||
run: |
|
||||
mkdir -p packages/opencode/dist
|
||||
tar -xf /tmp/kilo-cli.tar -C packages/opencode/dist
|
||||
tar --zstd -xf /tmp/kilo-cli.tar.zst -C packages/opencode/dist
|
||||
# kilocode_change end
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user