build-demo: a recipe whose artifacts are a Go binary and an npm package

Two things hanzo.app could not build before: nothing here is a container
image, so nothing here has a Dockerfile. The declaration is the same
hanzo.yml both CI lanes already read.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-07-27 22:42:09 -07:00
co-authored by Hanzo Dev
commit 75a45a3b92
7 changed files with 70 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
# build-demo
The smallest proof that `hanzo.app` builds software, not just container images.
`hanzo.yml` declares two artifacts and no Dockerfile:
- **`hanzo-demo`** — a static Go binary, cross-built for `linux/amd64` and `darwin/arm64`
- **`@hanzo/build-demo`** — a real npm package: `tsc` compiles `src/`, `npm pack` tars it
Both are built by `POST /v1/runner` on the platform's own cluster and published to
`https://s3.hanzo.ai/plugins/hanzoai/build-demo/<tag>/`, with a `binaries.json`
index carrying the URL and SHA-256 of each file.
+10
View File
@@ -0,0 +1,10 @@
// Command demo is the smallest thing hanzo.app can build that is not a
// container image: a static Go binary, published by name+digest.
package main
import "fmt"
// Version is stamped by the build (-ldflags "-X main.Version=…").
var Version = "dev"
func main() { fmt.Printf("hanzo build demo %s\n", Version) }
+3
View File
@@ -0,0 +1,3 @@
module github.com/hanzoai/build-demo
go 1.21
+22
View File
@@ -0,0 +1,22 @@
# The build recipe. ONE declaration, read by hanzoai/ci (GitHub lane) and by
# platform.hanzo.ai (POST /v1/runner, in-cluster) — neither of which needs a
# Dockerfile, because neither of these artifacts is a container image.
#
# `main:` is the zero-config Go lane. `run:` + `out:` is every other toolchain:
# the command that builds, and the glob of what it produced. `image:` names the
# toolchain the platform runs that command in (on a GitHub runner the toolchain
# is the runner, so the GitHub lane ignores it).
binaries:
- name: hanzo-demo
main: ./cmd/demo
platforms: [linux/amd64, darwin/arm64]
- name: hanzo-demo-sdk
image: node:22-bookworm
run: npm install --no-audit --no-fund --loglevel=error && npm run build && npm pack --pack-destination .
out: "*.tgz"
# Where the artifacts land: hanzoai/s3, as
# https://s3.hanzo.ai/plugins/<owner>/<repo>/<tag>/ with a binaries.json index
# beside them (url + sha256 for each), which is the one file a host reads.
bucket: plugins
+11
View File
@@ -0,0 +1,11 @@
{
"name": "@hanzo/build-demo",
"version": "0.1.0",
"description": "The TypeScript half of the hanzo.app build demo: a real npm package, built and published by POST /v1/runner.",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist"],
"scripts": { "build": "tsc" },
"devDependencies": { "typescript": "^5.6.0" }
}
+2
View File
@@ -0,0 +1,2 @@
/** greet is the whole package: proof a TS toolchain ran, compiled and packed. */
export const greet = (who: string): string => `hanzo build demo greets ${who}`
+10
View File
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"declaration": true,
"outDir": "dist",
"strict": true
},
"include": ["src"]
}