attempt build from source of opencode
CI / build-from-source (push) Failing after 23s

This commit is contained in:
2026-07-21 10:28:15 +08:00
parent 85be151eac
commit cbdae63217
2 changed files with 79 additions and 6 deletions
+30 -6
View File
@@ -7,7 +7,32 @@ on:
- 'opencode/*' - 'opencode/*'
- '.gitea/workflows/build-opencode.yaml' - '.gitea/workflows/build-opencode.yaml'
jobs: jobs:
"Build opencode docker images": # "Build opencode docker images":
# runs-on: hostinger
# steps:
# -
# name: Login to Gitea container registry
# uses: docker/login-action@v3
# with:
# registry: gitea.woggioni.net
# username: woggioni
# password: ${{ secrets.PUBLISHER_TOKEN }}
# -
# name: Build and push opencode images
# uses: docker/build-push-action@v6
# with:
# builder: multiplatform-builder
# context: "{{defaultContext}}:opencode"
# build-args: |
# OPENCODE_VERSION=1.18.4
# platforms: |
# linux/amd64
# push: true
# pull: true
# tags: |
# "gitea.woggioni.net/woggioni/opencode:1.18.4"
# "gitea.woggioni.net/woggioni/opencode:latest"
build-from-source:
runs-on: hostinger runs-on: hostinger
steps: steps:
- -
@@ -23,13 +48,12 @@ jobs:
with: with:
builder: multiplatform-builder builder: multiplatform-builder
context: "{{defaultContext}}:opencode" context: "{{defaultContext}}:opencode"
file: from-source.dockerfile
ssh: default=/var/lib/gitea-runner/.ssh/id_ed25519
build-args: | build-args: |
OPENCODE_VERSION=1.18.4 VERSION=1.18.4
platforms: | platforms: |
linux/amd64 linux/amd64
push: true push: false
pull: true pull: true
tags: |
"gitea.woggioni.net/woggioni/opencode:1.18.4"
"gitea.woggioni.net/woggioni/opencode:latest"
+49
View File
@@ -0,0 +1,49 @@
FROM oven/bun:1.3.14-alpine AS builder
#FROM node:25-alpine AS builder
ARG VERSION
ENTRYPOINT sh
RUN apk update
RUN --mount=type=cache,target=/var/cache/apk apk update
RUN --mount=type=cache,target=/var/cache/apk apk add python3 make g++ npm zip
RUN adduser -D -h /home/builder -u 1126 builder
USER builder
WORKDIR /home/builder
ADD --chown=builder:builder git@github.com:anomalyco/opencode.git#v${VERSION} opencode
WORKDIR /home/builder/opencode
# RUN bun install
RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 bun install
# WORKDIR /home/builder/opencode/packages/opencode
# ENV OPENCODE_CHANNEL=latest
# ENV OPENCODE_VERSION=${VERSION}
# ENV OPENCODE_RELEASE=${VERSION}
#bun run ./script/build.ts --single
# RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 ./packages/opencode/script/build.ts
RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 bun build --compile \
--target="bun-linux-x64-musl" \
--outfile="dist/opencode-linux-x64-musl/bin/opencode" \
--external="node-gyp" \
--minify \
--splitting \
--conditions="bun" \
--conditions="node" \
--format="esm" \
--tsconfig-override="./tsconfig.json" \
--define="FFF_LIBC=\"musl\"" \
--define="OPENCODE_LIBC=\"musl\"" \
--define="OPENCODE_CHANNEL=\"latest\"" \
--define="OPENCODE_VERSION=\"${VERSION}\"" \
--define="OTUI_TREE_SITTER_WORKER_PATH=/\$bunfs/root/opentui-tree-sitter-worker.js" \
--define="OPENCODE_WORKER_PATH=./src/cli/tui/worker.ts" \
--define="process.env.OPENTUI_LIBC=\"musl\"" \
./packages/opencode/src/index.ts \
./packages/opencode/src/cli/tui/worker.ts
#RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 ./packages/cli/script/build.ts
#RUN rm ./opencode.tgz
RUN adduser -D -h /var/lib/opencode opencode
USER opencode
WORKDIR /var/lib/opencode