graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Publish the unsigned Linux desktop package with tag releases
Cursor Agent007a80579591
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex ccfd38a7..74a73448 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -78,3 +78,25 @@ jobs:exit 1}done++ # Linux desktop package. macOS stays a notarized upload from a Mac+ # (publish-updates.sh). This runner can build the unsigned .deb the+ # packager already writes; signing is not a gate (ADR 0157).+ desktop-linux:+ needs: release+ runs-on: ubuntu-latest+ timeout-minutes: 40+ steps:+ - uses: actions/checkout@v7+ - uses: oven-sh/setup-bun@v2+ with:+ bun-version: "1.4.2"+ - uses: ./.github/actions/setup-codegraff-zig+ - name: Package the Linux desktop+ run: |+ set -euo pipefail+ GRAFF_VERSION="${GITHUB_REF_NAME#v}" bash apps/native/electron/build.sh+ - name: Upload the Linux desktop package+ env:+ GH_TOKEN: ${{ github.token }}+ run: bash apps/native/electron/publish-linux.sh "$GITHUB_REF_NAME" zig-out/electrondiff --git a/README.md b/README.mdindex 314b5649..5a09c5a2 100644--- a/README.md+++ b/README.md@@ -39,6 +39,17 @@ The signed and notarized app includes its runtime; no developer tools or localserver are needed. [Verify the download checksum](https://github.com/justrach/codegraff/releases/latest/download/Codegraff-DMG-SHA256SUMS).For a `graff` command in your terminal, install the CLI below.+### Desktop for Linux++x86_64++1. [Download the package](https://github.com/justrach/codegraff/releases/latest/download/Codegraff-linux-amd64.deb).+2. Install it with `sudo apt install ./Codegraff-linux-amd64.deb`.+3. Open **Codegraff** from the app menu, or run `codegraff`.++[Verify the download checksum](https://github.com/justrach/codegraff/releases/latest/download/Codegraff-linux-amd64-SHA256SUMS).+The package is unsigned. It includes its runtime.+### TerminalOn macOS or Linux:diff --git a/apps/native/electron/README.md b/apps/native/electron/README.mdindex 46ca569e..1bd4e75d 100644--- a/apps/native/electron/README.md+++ b/apps/native/electron/README.md@@ -250,3 +250,17 @@ are attached. Every latest stable release must carry `latest-mac.yml` and itsversioned ZIP alongside the DMG; a CLI-only latest release cannot serve a desktopupdate. Publish the complete release atomically. Versions older than the firstupdater-enabled release need one manual DMG installation.++The tag workflow also builds this tree on Linux and uploads the unsigned+package next to the CLI tarballs:++```sh+GRAFF_VERSION=VERSION bash apps/native/electron/build.sh+bash apps/native/electron/publish-linux.sh vVERSION zig-out/electron+```++That attaches `Codegraff-linux-amd64.deb` (or `arm64`) and+`Codegraff-linux-<arch>-SHA256SUMS`. An AppImage is included when+`appimagetool` was on `PATH` during the build. There is no notarization step+on Linux; the upload is the unsigned `.deb` `build.sh` wrote. A development+bundle (`GRAFF_DEV=1`) is not a release asset.diff --git a/apps/native/electron/publish-linux.sh b/apps/native/electron/publish-linux.shnew file mode 100755index 00000000..44c58485--- /dev/null+++ b/apps/native/electron/publish-linux.sh@@ -0,0 +1,85 @@+#!/usr/bin/env bash+# Attach the Linux desktop package to a GitHub release.+#+# apps/native/electron/build.sh writes an unsigned .deb, and an AppImage when+# appimagetool is installed. There is no Linux equivalent of the macOS+# notarization gate, so this uploads those bytes the same way the tag+# workflow uploads CLI tarballs. Development builds (GRAFF_DEV=1) are not+# release assets.+#+# Usage: publish-linux.sh vVERSION package-directory+# publish-linux.sh --prepare DEST vVERSION package-directory+set -euo pipefail++prepare=""+if [[ "${1:-}" == "--prepare" ]]; then+ prepare="${2:?Provide a directory for the staged assets}"+ shift 2+fi+tag="${1:?Usage: publish-linux.sh vVERSION package-directory}"+src="${2:?Provide the directory that contains the .deb}"+ver="${tag#v}"+if [[ "$tag" == "$ver" || -z "$ver" ]]; then+ echo "tag must look like v0.0.1" >&2+ exit 1+fi++shopt -s nullglob+debs=("$src"/codegraff_"${ver}"_*.deb)+if [[ ${#debs[@]} -ne 1 ]]; then+ echo "expected one codegraff_${ver}_*.deb in $src" >&2+ exit 1+fi+deb="${debs[0]}"+base="$(basename "$deb")"+arch="${base#codegraff_${ver}_}"+arch="${arch%.deb}"+case "$arch" in+ amd64|arm64) ;;+ *) echo "unexpected deb architecture: $arch" >&2; exit 1 ;;+esac++dest="${prepare:-$(mktemp -d)}"+mkdir -p "$dest"+cp "$deb" "$dest/Codegraff-linux-${arch}.deb"+imgs=("$src"/codegraff-"${ver}"-*.AppImage)+if [[ ${#imgs[@]} -gt 1 ]]; then+ echo "expected at most one AppImage in $src" >&2+ exit 1+fi+if [[ ${#imgs[@]} -eq 1 ]]; then+ cp "${imgs[0]}" "$dest/Codegraff-linux-${arch}.AppImage"+fi++(+ cd "$dest"+ files=("Codegraff-linux-${arch}.deb")+ if [[ -f "Codegraff-linux-${arch}.AppImage" ]]; then+ files+=("Codegraff-linux-${arch}.AppImage")+ fi+ if command -v sha256sum >/dev/null 2>&1; then+ sha256sum "${files[@]}" > "Codegraff-linux-${arch}-SHA256SUMS"+ else+ shasum -a 256 "${files[@]}" > "Codegraff-linux-${arch}-SHA256SUMS"+ fi+)++assets=("$dest/Codegraff-linux-${arch}.deb" "$dest/Codegraff-linux-${arch}-SHA256SUMS")+if [[ -f "$dest/Codegraff-linux-${arch}.AppImage" ]]; then+ assets+=("$dest/Codegraff-linux-${arch}.AppImage")+fi+if [[ -n "$prepare" ]]; then+ printf '%s\n' "${assets[@]}"+ exit 0+fi++repo="${GRAFF_RELEASE_REPO:-justrach/codegraff}"+gh release upload "$tag" --repo "$repo" "${assets[@]}" --clobber+uploaded="$(gh release view "$tag" --repo "$repo" --json assets --jq '.assets[].name')"+for asset in "${assets[@]}"; do+ grep -Fxq "$(basename "$asset")" <<<"$uploaded" || {+ echo "release is missing asset: $(basename "$asset")" >&2+ exit 1+ }+done+echo "Linux desktop assets uploaded."diff --git a/apps/native/electron/publish-linux.test.cjs b/apps/native/electron/publish-linux.test.cjsnew file mode 100644index 00000000..d02f379a--- /dev/null+++ b/apps/native/electron/publish-linux.test.cjs@@ -0,0 +1,49 @@+const { test } = require('node:test');+const assert = require('node:assert/strict');+const { spawnSync } = require('node:child_process');+const crypto = require('node:crypto');+const fs = require('node:fs');+const os = require('node:os');+const path = require('node:path');++const script = path.join(__dirname, 'publish-linux.sh');++function stage(files) {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'graff-linux-release-'));+ const src = path.join(root, 'pkg');+ const dest = path.join(root, 'staged');+ fs.mkdirSync(src);+ for (const [name, body] of Object.entries(files)) fs.writeFileSync(path.join(src, name), body);+ return { root, src, dest };+}++test('release assets take the desktop name and record their checksum', () => {+ const { root, src, dest } = stage({+ 'codegraff_0.0.302.4_amd64.deb': 'deb-bytes',+ 'codegraff-0.0.302.4-x86_64.AppImage': 'image-bytes',+ });+ try {+ const run = spawnSync('bash', [script, '--prepare', dest, 'v0.0.302.4', src], { encoding: 'utf8' });+ assert.equal(run.status, 0, run.stderr);+ assert.equal(fs.readFileSync(path.join(dest, 'Codegraff-linux-amd64.deb'), 'utf8'), 'deb-bytes');+ assert.equal(fs.readFileSync(path.join(dest, 'Codegraff-linux-amd64.AppImage'), 'utf8'), 'image-bytes');+ const sums = fs.readFileSync(path.join(dest, 'Codegraff-linux-amd64-SHA256SUMS'), 'utf8');+ const debHash = crypto.createHash('sha256').update('deb-bytes').digest('hex');+ const imageHash = crypto.createHash('sha256').update('image-bytes').digest('hex');+ assert.match(sums, new RegExp(`${debHash}\\s+Codegraff-linux-amd64\\.deb`));+ assert.match(sums, new RegExp(`${imageHash}\\s+Codegraff-linux-amd64\\.AppImage`));+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test('a deb for a different version is not a release asset', () => {+ const { root, src, dest } = stage({ 'codegraff_0.0.1_amd64.deb': 'deb-bytes' });+ try {+ const run = spawnSync('bash', [script, '--prepare', dest, 'v0.0.302.4', src], { encoding: 'utf8' });+ assert.notEqual(run.status, 0);+ assert.match(run.stderr, /expected one codegraff_0\.0\.302\.4_/);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});diff --git a/docs/adr/0156-linux-desktop-sandbox-fallback.md b/docs/adr/0156-linux-desktop-sandbox-fallback.mdindex 94a276a1..288e1d59 100644--- a/docs/adr/0156-linux-desktop-sandbox-fallback.md+++ b/docs/adr/0156-linux-desktop-sandbox-fallback.md@@ -23,5 +23,6 @@ usual case for an unpacked tree before a deb install.## ConsequencesAn unpacked Linux build opens without a root step. A deb install can turn-the sandbox helper setuid. Signing the packages is still a separate release-step.+the sandbox helper setuid. The tag workflow uploads that unsigned `.deb`+(ADR 0157). Signing remains a later replacement of the same asset, not a+reason to skip the upload.diff --git a/docs/adr/0157-linux-desktop-release-is-the-unsigned-deb.md b/docs/adr/0157-linux-desktop-release-is-the-unsigned-deb.mdnew file mode 100644index 00000000..67007c8f--- /dev/null+++ b/docs/adr/0157-linux-desktop-release-is-the-unsigned-deb.md@@ -0,0 +1,28 @@+# 0157. Linux desktop releases ship the unsigned deb++Status: accepted 2026-09-21++## Context++The tag workflow publishes CLI tarballs from Linux. The desktop download is a+separate step: `publish-updates.sh` attaches a notarized macOS DMG and update+zip, and refuses anything that fails Gatekeeper. Linux packaging already+writes a `.deb` (and an AppImage when `appimagetool` is installed) from+`apps/native/electron/build.sh`. Package signing is still open, and there is+no notarization gate to satisfy on Linux.++## Decision++- A tag release also uploads `Codegraff-linux-<arch>.deb` and+ `Codegraff-linux-<arch>-SHA256SUMS`. An AppImage produced by the same+ packager is uploaded beside them as `Codegraff-linux-<arch>.AppImage`.+- The bytes are the unsigned package `build.sh` writes. Do not skip the+ upload because it is unsigned, and do not publish a `GRAFF_DEV=1` bundle.+- macOS stays on `publish-updates.sh`. An unsigned macOS build is still not+ a release asset.++## Consequences++Linux users can install the desktop from the GitHub release. The package is+not signed. When signing exists, replace these assets with the signed bytes+under the same names; do not add a second upload path.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 76241147..438de9cd 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -178,6 +178,7 @@ record only when you need the evidence or the edge cases.| [0154](0154-parked-shells-yield-the-parent.md) | Interactive parked shells yield the parent like subagents: 15s foreground wait, then the prompt is yours until the job-exit wake. || [0155](0155-resume-reenters-saved-worktree.md) | Resume of a linked-worktree save re-enters that tree; `$HOME` origin stays history-only. || [0156](0156-linux-desktop-sandbox-fallback.md) | Linux desktop uses system window decorations, a POSIX terminal, and a sandbox fallback when user namespaces or the setuid helper are unavailable. |+| [0157](0157-linux-desktop-release-is-the-unsigned-deb.md) | Tag releases upload the unsigned Linux `.deb` (and AppImage when the packager built one). macOS stays notarized; do not skip the Linux upload for lack of a signature. |## When to write one