attempt build from source of opencode
CI / build-from-source (push) Failing after 2m0s

This commit is contained in:
2026-07-21 05:31:39 +08:00
parent 85be151eac
commit cf2f4ef06e
2 changed files with 58 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
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
RUN adduser -D -h /home/builder 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 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 ./packages/opencode/script/build.ts
RUN --mount=type=cache,target=/home/builder/.bun/install/cache ./packages/cli/script/build.ts
RUN rm ./opencode.tgz
RUN adduser -D -h /var/lib/opencode opencode
USER opencode
WORKDIR /var/lib/opencode