From 10b7158e8cd57f21f7327c73a6b2cdb2f498fdae Mon Sep 17 00:00:00 2001 From: Uzair Aftab Date: Sun, 30 Aug 2026 16:53:31 +0200 Subject: [PATCH] ci: cross-compile freestanding libghostty-vt --- .github/workflows/freestanding.yml | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/freestanding.yml diff --git a/.github/workflows/freestanding.yml b/.github/workflows/freestanding.yml new file mode 100644 index 000000000..b2bc3a674 --- /dev/null +++ b/.github/workflows/freestanding.yml @@ -0,0 +1,51 @@ +on: + push: {} + pull_request: {} + workflow_dispatch: {} + +name: Freestanding + +# We only want the latest commit to test for any non-main ref. +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + build-libghostty-vt: + if: github.repository == 'ghostty-org/ghostty' + strategy: + matrix: + include: + - target: riscv32-freestanding-eabi + cpu: baseline + - target: thumb-freestanding-eabi + cpu: cortex_m4 + runs-on: namespace-profile-ghostty-sm + env: + ZIG_LOCAL_CACHE_DIR: /zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /zig/global-cache + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Setup Cache + uses: namespacelabs/nscloud-cache-action@c5f8dab7560444c4bf8dbc64f1b203431873c547 # v1.6.1 + with: + path: | + /nix + /zig + + - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17 + with: + name: ghostty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + + - name: Build + run: | + nix develop -c zig build -Demit-lib-vt \ + -Dtarget=${{ matrix.target }} \ + -Dcpu=${{ matrix.cpu }} \ + -Doptimize=ReleaseSafe