Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v2
- run: python3 test-release-automation.py
- run: bash test-bump-version.sh
- run: python3 tests/test-release-automation.py
- run: bash tests/test-bump-version.sh

test:
name: Runtime behavior tests (${{ matrix.track }})
Expand Down Expand Up @@ -77,13 +77,16 @@ jobs:
IN="docker run --rm -e GITHUB_TOKEN --entrypoint bash opencode-test:latest"

test "server entrypoint, authentication, and flags work in the real image" \
"bash test-server-e2e.sh opencode-test:latest"
"bash tests/test-server-e2e.sh opencode-test:latest"

test "home-tool installer works in the real image" \
"bash test-home-tools-e2e.sh opencode-test:latest"
"bash tests/test-home-tools-e2e.sh opencode-test:latest"

test "package managers and zerobrew-backed lazy tools work in the real image" \
"bash test-toolchain-e2e.sh opencode-test:latest"
"bash tests/test-toolchain-e2e.sh opencode-test:latest"

test "locked tools install without version lookups; user tools resolve latest" \
"bash tests/test-mise-lock-e2e.sh opencode-test:latest"

echo "=== Pre-installed tools (interactive) ==="

Expand Down Expand Up @@ -137,6 +140,9 @@ jobs:
test "npx resolves from auto-install-shims" \
"$IN -c 'which npx | grep -q /opt/auto-install-shims/npx'"

test "clonetree, codex, claude, and cloudflared resolve from auto-install-shims" \
"$IN -c 'for c in clonetree codex claude cloudflared; do which \$c | grep -q /opt/auto-install-shims/\$c || exit 1; done'"

echo ""
echo "=== Results: $PASS passed, $FAIL failed ==="

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Publish

on:
workflow_dispatch:
inputs:
force:
description: Republish versions that are already on Docker Hub
type: boolean
default: false

permissions:
contents: write
Expand Down Expand Up @@ -39,7 +44,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Publish both tracks
- name: Publish new versions
env:
GH_TOKEN: ${{ github.token }}
run: task publish
run: task publish FORCE=${{ inputs.force }}
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ARG MISE_VERSION=2026.10.24
ARG MISE_ZEROBREW_PLUGIN_COMMIT=998174989a12910f82c1f6e791a432731ed2647d

# 1.5. mise — dev tool manager; pre-approved tools defined in the global config
# auto-install via zerobrew backend on first use at runtime. The release is
# auto-install on first use at runtime. The release is
# pinned so Docker caching cannot silently retain an old moving target.
RUN curl -fsSL https://mise.run | MISE_VERSION="${MISE_VERSION}" MISE_INSTALL_PATH=/usr/local/bin/mise sh \
&& mkdir -p /opt/mise \
Expand Down Expand Up @@ -190,6 +190,23 @@ RUN case "${OPENCODE_VERSION}" in \
esac \
&& install -m 0755 "/usr/local/lib/opencode/${entrypoint}" /usr/local/bin/entrypoint.sh

# Lock each "latest" tool in the system config to the release that is newest at
# build time. First runs then download straight from the locked URL instead of
# fetching release lists (codex's is ~10 MB, past mise's 3s timeout) or calling
# the rate-limited GitHub API. Tools users add still resolve at runtime.
# OPENCODE_VERSION is referenced so every opencode release re-locks rather than
# reusing a cached layer. mise writes a temp file beside the lockfile whenever
# it checks it, so the opencode user must own /etc/mise.
RUN echo "locking mise tools for opencode ${OPENCODE_VERSION}" \
&& cd / \
&& MISE_LOCKFILE=1 MISE_FETCH_REMOTE_VERSIONS_TIMEOUT=60s \
MISE_CACHE_DIR=/tmp/mise-lock-cache MISE_STATE_DIR=/tmp/mise-lock-state \
mise lock -g --platform linux-x64,linux-arm64 \
&& rm -rf /tmp/mise-lock-cache /tmp/mise-lock-state \
&& chmod 0644 /etc/mise/mise.lock \
&& chown opencode:opencode /etc/mise /etc/mise/mise.lock \
&& chown -R opencode:opencode /opt/mise

# Verify runtime and set up login-shell PATH and auto-install handler
RUN opencode --version \
&& install -m 0644 /dev/null /etc/mise/empty.toml \
Expand Down
Loading
Loading