From bfa3055309d5c292367c8ed3d876d59541a29e0c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Mar 2026 06:59:59 -0700 Subject: [PATCH] ci: add distcheck for lib-vt source tarball Add a build-dist-lib-vt job that runs distcheck with -Demit-lib-vt=true and verifies the resulting tarball stays under 5 MB. Also downsize the build-dist runner from -md to -sm. --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48e8ba1cf..70e903fba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,6 +85,7 @@ jobs: - skip - build-bench - build-dist + - build-dist-lib-vt - build-examples-zig - build-examples-cmake - build-examples-cmake-windows @@ -652,7 +653,7 @@ jobs: run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'main_ghostty.main' build-dist: - runs-on: namespace-profile-ghostty-md + runs-on: namespace-profile-ghostty-sm needs: test outputs: artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }} @@ -693,6 +694,48 @@ jobs: path: |- ghostty-source.tar.gz + build-dist-lib-vt: + runs-on: namespace-profile-ghostty-sm + needs: test + env: + ZIG_LOCAL_CACHE_DIR: /zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /zig/global-cache + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup Cache + uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 + with: + path: | + /nix + /zig + + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@51f3067b56fe8ae331890c77d4e454f6d60615ff # v31.10.2 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17 + with: + name: ghostty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + + - name: Build and Check Source Tarball + run: | + rm -rf zig-out/dist + nix develop -c zig build distcheck -Demit-lib-vt=true + + - name: Verify tarball size + run: | + tarball=$(ls zig-out/dist/*.tar.gz) + size=$(stat --format=%s "$tarball") + max=$((5 * 1024 * 1024)) + echo "Tarball size: $size bytes (max: $max)" + if [ "$size" -gt "$max" ]; then + echo "ERROR: tarball exceeds 5 MB" + exit 1 + fi + trigger-snap: if: github.event_name != 'pull_request' runs-on: namespace-profile-ghostty-xsm