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
27 changes: 27 additions & 0 deletions .github/workflows/repack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Verify and repack official OpenCode
on:
workflow_dispatch:
push:
tags: ['v*']
permissions:
contents: read
jobs:
Expand All @@ -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
2 changes: 1 addition & 1 deletion extension.toml
Original file line number Diff line number Diff line change
@@ -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."
Expand Down
5 changes: 4 additions & 1 deletion scripts/repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading