revert opencode to version 1.x
CI / Build opencode docker images (push) Successful in 50s

This commit is contained in:
2026-09-22 21:06:57 +08:00
parent 75fff0e585
commit 86d2c817fc
2 changed files with 25 additions and 26 deletions
+21 -21
View File
@@ -17,25 +17,25 @@ jobs:
registry: gitea.woggioni.net registry: gitea.woggioni.net
username: woggioni username: woggioni
password: ${{ secrets.PUBLISHER_TOKEN }} password: ${{ secrets.PUBLISHER_TOKEN }}
# - -
# name: Build and push opencode binary images name: Build and push opencode binary images
# uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
# with: with:
# builder: multiplatform-builder builder: multiplatform-builder
# context: "{{defaultContext}}:opencode" context: "{{defaultContext}}:opencode"
# ssh: default=/var/lib/gitea-runner/.ssh/id_ed25519 ssh: default=/var/lib/gitea-runner/.ssh/id_ed25519
# target: release-bin target: release-bin
# build-args: | build-args: |
# OPENCODE_VERSION=2.0.12 OPENCODE_VERSION=1.18.32
# BUN_VERSION=1.4.2 BUN_VERSION=1.4.2
# platforms: | platforms: |
# linux/amd64 linux/amd64
# push: true push: true
# pull: true pull: true
# tags: | tags: |
# "gitea.woggioni.net/woggioni/opencode:2.0.12-bin" "gitea.woggioni.net/woggioni/opencode:1.18.32-bin"
# "gitea.woggioni.net/woggioni/opencode:2.0.12" "gitea.woggioni.net/woggioni/opencode:1.18.32"
# "gitea.woggioni.net/woggioni/opencode:latest" "gitea.woggioni.net/woggioni/opencode:latest"
- -
name: Build and push opencode build-from-source images name: Build and push opencode build-from-source images
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
@@ -45,11 +45,11 @@ jobs:
ssh: default=/var/lib/gitea-runner/.ssh/id_ed25519 ssh: default=/var/lib/gitea-runner/.ssh/id_ed25519
target: release target: release
build-args: | build-args: |
OPENCODE_VERSION=2.0.12 OPENCODE_VERSION=1.18.32
BUN_VERSION=1.4.2 BUN_VERSION=1.4.2
platforms: | platforms: |
linux/amd64 linux/amd64
push: true push: true
pull: true pull: true
tags: | tags: |
"gitea.woggioni.net/woggioni/opencode:2.0.12-bfs" "gitea.woggioni.net/woggioni/opencode:1.18.32-bfs"
+4 -5
View File
@@ -14,12 +14,13 @@ USER builder
WORKDIR /home/builder WORKDIR /home/builder
ADD --chown=builder:builder --keep-git-dir=true git@github.com:anomalyco/opencode.git#v${OPENCODE_VERSION} opencode ADD --chown=builder:builder --keep-git-dir=true git@github.com:anomalyco/opencode.git#v${OPENCODE_VERSION} opencode
WORKDIR /home/builder/opencode WORKDIR /home/builder/opencode
ENV BUN_COMPILE_RELEASE=bun-v${BUN_VERSION} ENV BUN_COMPILE_RELEASE=bun-v${BUN_VERSION}
ENV OPENCODE_CHANNEL=prod ENV OPENCODE_CHANNEL=prod
ENV OPENCODE_VERSION=${OPENCODE_VERSION} ENV OPENCODE_VERSION=${OPENCODE_VERSION}
RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 bun install RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 bun install
#ADD --chown=builder:builder ./build.ts ./packages/cli/script/build.ts --single ADD --chown=builder:builder ./build.ts ./packages/opencode/script/build.ts
RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 ./packages/cli/script/build.ts --single RUN --mount=type=cache,target=/home/builder/.bun/install/cache,uid=1126 ./packages/opencode/script/build.ts
@@ -40,7 +41,7 @@ RUN echo 'PATH DEFAULT=${HOME}/.local/bin:${HOME}/.cargo/bin:/usr/local/bin:/bin
RUN rm repository.key RUN rm repository.key
RUN --mount=type=cache,target=/var/cache/pacman pacman -Syu --noconfirm RUN --mount=type=cache,target=/var/cache/pacman pacman -Syu --noconfirm
RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed \ RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed \
xdg-utils rustup rust-analyzer jdtls python-pipx ripgrep git rustup gradle curl sccache openssh \ xdg-utils rustup rust-analyzer python-pipx ripgrep git rustup gradle curl sccache openssh \
bash-language-server marksman python-lsp-server vscode-css-languageserver x86_64-unknown-linux-musl-zlib x86_64-unknown-linux-musl-gcc \ bash-language-server marksman python-lsp-server vscode-css-languageserver x86_64-unknown-linux-musl-zlib x86_64-unknown-linux-musl-gcc \
vscode-html-languageserver vscode-json-languageserver yaml-language-server base-devel docker docker-buildx docker-compose less websocat \ vscode-html-languageserver vscode-json-languageserver yaml-language-server base-devel docker docker-buildx docker-compose less websocat \
npm gtk3 alsa-lib trunk npm gtk3 alsa-lib trunk
@@ -49,12 +50,10 @@ RUN useradd -m -d /var/lib/opencode opencode
RUN mkdir /workspace RUN mkdir /workspace
RUN chown opencode:opencode /workspace RUN chown opencode:opencode /workspace
USER opencode USER opencode
RUN pipx install pyright
RUN pipx install pip-tools RUN pipx install pip-tools
USER root USER root
ADD --chown=opencode:opencode ./opencode.json /etc/opencode/opencode.json ADD --chown=opencode:opencode ./opencode.json /etc/opencode/opencode.json
RUN mkdir -p /usr/lib/opencode/addons RUN mkdir -p /usr/lib/opencode/addons
ADD --chmod=644 https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.46/lombok-1.18.46.jar /usr/lib/opencode/addons/lombok.jar
ENV OPENCODE_CONFIG=/etc/opencode/opencode.json ENV OPENCODE_CONFIG=/etc/opencode/opencode.json
USER opencode USER opencode
WORKDIR /workspace WORKDIR /workspace