diff --git a/.gitea/workflows/release-keeper-ziren.yml b/.gitea/workflows/release-keeper-ziren.yml new file mode 100644 index 0000000000..63557b52dc --- /dev/null +++ b/.gitea/workflows/release-keeper-ziren.yml @@ -0,0 +1,31 @@ +on: + push: + branches: + - "master" + tags: + - "v*" + workflow_dispatch: + +jobs: + keeper-ziren: + name: Keeper ZKVM Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.25 + cache: false + + - name: Install cross toolchain for MIPS + run: | + apt-get update + apt-get -yq --no-install-suggests --no-install-recommends install gcc-mipsel-linux-gnu libc6-dev-mipsel-cross + + - name: Build keeper with ziren tag (mipsle) + run: | + go run build/ci.go install -static -arch mipsle -os linux -cc mipsel-linux-gnu-gcc -tags ziren -dlgo ./cmd/keeper + env: + GOMIPS: "softfloat" diff --git a/build/ci.go b/build/ci.go index 6a9848876d..500e204b68 100644 --- a/build/ci.go +++ b/build/ci.go @@ -183,14 +183,16 @@ func doInstall(cmdline []string) { var ( dlgo = flag.Bool("dlgo", false, "Download Go and build with it") arch = flag.String("arch", "", "Architecture to cross build for") + goos = flag.String("os", "", "Operating system to cross build for") cc = flag.String("cc", "", "C compiler to cross build with") staticlink = flag.Bool("static", false, "Create statically-linked executable") + tags = flag.String("tags", "", "Additional build tags (comma-separated)") ) flag.CommandLine.Parse(cmdline) env := build.Env() // Configure the toolchain. - tc := build.GoToolchain{GOARCH: *arch, CC: *cc} + tc := build.GoToolchain{GOARCH: *arch, GOOS: *goos, CC: *cc} if *dlgo { csdb := download.MustLoadChecksums("build/checksums.txt") tc.Root = build.DownloadGo(csdb) @@ -203,6 +205,20 @@ func doInstall(cmdline []string) { buildTags = append(buildTags, "ckzg") } + // Add custom tags if provided + if *tags != "" { + // Split by both comma and whitespace + customTags := strings.FieldsFunc(*tags, func(r rune) bool { + return r == ',' || r == ' ' || r == '\t' + }) + for _, tag := range customTags { + tag = strings.TrimSpace(tag) + if tag != "" { + buildTags = append(buildTags, tag) + } + } + } + // Configure the build. gobuild := tc.Go("build", buildFlags(env, *staticlink, buildTags)...)