File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 cd packages/opencode/dist/opencode-darwin-arm64/bin
3333 tar czf "../../../../../release-assets/opencode-darwin-arm64.tar.gz" opencodex
3434 cd -
35+ cp script/install.sh release-assets/
3536 ls -la release-assets/
3637
3738 - name : Create or Update Release
4041 tag_name : ${{ github.ref_type == 'tag' && github.ref_name || 'latest' }}
4142 name : ${{ github.ref_type == 'tag' && github.ref_name || 'Latest macOS Build' }}
4243 prerelease : ${{ github.ref_type != 'tag' }}
43- files : release-assets/opencode-darwin-arm64.tar.gz
44+ files : |
45+ release-assets/opencode-darwin-arm64.tar.gz
46+ release-assets/install.sh
4447 fail_on_unmatched_files : true
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ REPO=" 3kaiu/opencode-x"
5+ BIN_NAME=" opencodex"
6+ INSTALL_DIR=" ${INSTALL_DIR:-/ usr/ local/ bin} "
7+
8+ if [[ " ${OSTYPE} " != " darwin" * ]] || [[ " $( uname -m) " != " arm64" ]]; then
9+ echo " Only macOS arm64 is supported." >&2
10+ exit 1
11+ fi
12+
13+ echo " Fetching latest release from ${REPO} ..."
14+ LATEST=$( curl -fsSL " https://api.github.com/repos/${REPO} /releases/latest" | grep ' "tag_name"' | cut -d' "' -f4)
15+ echo " Latest version: ${LATEST} "
16+
17+ DOWNLOAD_URL=" https://github.com/${REPO} /releases/download/${LATEST} /opencode-darwin-arm64.tar.gz"
18+ TMPDIR=$( mktemp -d)
19+ trap ' rm -rf "${TMPDIR}"' EXIT
20+
21+ echo " Downloading ${DOWNLOAD_URL} ..."
22+ curl -fsSL " ${DOWNLOAD_URL} " -o " ${TMPDIR} /opencode.tar.gz"
23+ tar xzf " ${TMPDIR} /opencode.tar.gz" -C " ${TMPDIR} "
24+
25+ echo " Installing ${BIN_NAME} to ${INSTALL_DIR} ..."
26+ install -d " ${INSTALL_DIR} "
27+ install " ${TMPDIR} /${BIN_NAME} " " ${INSTALL_DIR} /${BIN_NAME} "
28+
29+ echo " Installed ${BIN_NAME} ${LATEST} to ${INSTALL_DIR} /${BIN_NAME} "
You can’t perform that action at this time.
0 commit comments