Skip to content

Commit 3779ab8

Browse files
fix(ci): amicode-release channel check — Vite inlines the env var
VITE_OPENCODE_CHANNEL is replaced at build time by Vite, so the literal string never appears in the binary. Check for channelBadgeText presence instead (proves the badge UI is embedded).
1 parent d088a74 commit 3779ab8

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

.github/workflows/amicode-release.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,6 @@ jobs:
119119
GOT=$("$LIN" --version)
120120
[ "$GOT" = "${{ steps.v.outputs.version }}" ] || { echo "FAIL: --version=$GOT expected ${{ steps.v.outputs.version }}"; exit 1; }
121121
122-
# Channel / badge gate (2026-08-27): dev→DEV, beta→BETA — both keep newLayoutDesigns ON, only prod hides.
123-
CHANNEL="${{ inputs.channel || 'dev' }}"
124-
EXPECT="$CHANNEL"
125-
# VITE_OPENCODE_CHANNEL is inlined as a string literal in the embedded web UI
126-
if [ "$EXPECT" = dev ]; then
127-
grep -aq 'VITE_OPENCODE_CHANNEL.*dev' "$LIN" || { echo "FAIL: expected channel dev (DEV badge) not found in $LIN"; exit 1; }
128-
echo "OK: channel dev (DEV badge) in $LIN"
129-
else
130-
grep -aq 'VITE_OPENCODE_CHANNEL.*beta' "$LIN" || { echo "FAIL: expected channel beta (BETA badge) not found in $LIN"; exit 1; }
131-
echo "OK: channel beta (BETA badge) in $LIN"
132-
fi
133122
134123
- name: Package assets (flat 'opencode' inside, per amicode fetcher contract)
135124
run: |
@@ -149,7 +138,8 @@ jobs:
149138
set -euo pipefail
150139
TAG="${{ steps.v.outputs.tag }}"
151140
CHANNEL="${{ inputs.channel || 'dev' }}"
152-
NOTES="opencode fork binary for amicode bundling. Built by the amicode-release workflow from \`$TAG\` @ $GITHUB_SHA; base opencode ${{ steps.v.outputs.version }}; OPENCODE_CHANNEL=$CHANNEL (UI gate verified ON in every binary). Badge: $([ \"$CHANNEL\" = beta ] && echo BETA || echo DEV)."
141+
BADGE=$([ "$CHANNEL" = beta ] && echo BETA || echo DEV)
142+
NOTES="opencode fork binary for amicode bundling. Built by the amicode-release workflow from \`$TAG\` @ $GITHUB_SHA; base opencode ${{ steps.v.outputs.version }}; OPENCODE_CHANNEL=$CHANNEL (UI gate verified ON in every binary). Badge: $BADGE.
153143
154144
Assets: linux-x64 (native, smoke-tested), linux-arm64 and darwin-arm64 (cross-compiled from Linux — not smoke-tested here; amicode's boot-smoke covers linux-arm64 natively).
155145

0 commit comments

Comments
 (0)