From ad36063472ea7c7eb11c34f2839c29e757327778 Mon Sep 17 00:00:00 2001 From: "pointman-app[bot]" <349576798+pointman-app[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 09:47:22 +0800 Subject: [PATCH 1/2] Attach repacked OpenCode builds to the release --- .github/workflows/repack.yml | 27 +++++++++++++++++++++++++++ extension.toml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repack.yml b/.github/workflows/repack.yml index 9ce0604..feeab55 100644 --- a/.github/workflows/repack.yml +++ b/.github/workflows/repack.yml @@ -1,6 +1,8 @@ name: Verify and repack official OpenCode on: workflow_dispatch: + push: + tags: ['v*'] permissions: contents: read jobs: @@ -24,3 +26,28 @@ jobs: name: opencode-${{ matrix.target }} path: release/* if-no-files-found: error + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: repack + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: opencode-* + merge-multiple: true + path: release + - name: Attach the repacked builds to the release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + # The release may already exist (published at the merge): attach to it + # rather than failing, whichever came first. + if gh release view "$TAG" >/dev/null 2>&1; then + gh release upload "$TAG" release/* --clobber + else + gh release create "$TAG" release/* --title "OpenCode $TAG" --notes "Official OpenCode binaries, checksum-verified and repacked. See the repository README for upstream provenance." + fi diff --git a/extension.toml b/extension.toml index 5354f72..1b85069 100644 --- a/extension.toml +++ b/extension.toml @@ -1,7 +1,7 @@ [extension] id = "opencode" name = "OpenCode" -version = "0.1.0" +version = "0.1.1" node = ">=0.4.3" publisher = "aurelio" summary = "OpenCode with the machine's sign-in and private agent configuration." From 0900586b77d89edd2e2ba1f9af77e37ebd2d28f1 Mon Sep 17 00:00:00 2001 From: "pointman-app[bot]" <349576798+pointman-app[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 09:48:29 +0800 Subject: [PATCH 2/2] Send a User-Agent when downloading the pinned archive --- scripts/repack.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/repack.py b/scripts/repack.py index 2f088a9..7f76ef6 100644 --- a/scripts/repack.py +++ b/scripts/repack.py @@ -77,7 +77,10 @@ def main(): parser.add_argument('--output', type=Path, default=Path('release')) args = parser.parse_args() if args.download: - with urllib.request.urlopen(pin['platforms'][args.target]['url'], timeout=120) as response: + # opencode.ai answers Python's default User-Agent with 403. + request = urllib.request.Request(pin['platforms'][args.target]['url'], + headers={'User-Agent': 'pointman-opencode-repack'}) + with urllib.request.urlopen(request, timeout=120) as response: data = response.read() else: data = args.archive.read_bytes()