mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 01:00:25 +00:00
parent
19e52ac7c1
commit
1b988028ad
2 changed files with 1 additions and 50 deletions
18
.github/workflows/build-binaries.yml
vendored
18
.github/workflows/build-binaries.yml
vendored
|
|
@ -77,21 +77,3 @@ jobs:
|
|||
pi-linux-arm64.tar.gz \
|
||||
pi-windows-x64.zip \
|
||||
--clobber
|
||||
|
||||
- name: Trigger companion-cloud companion-os refresh
|
||||
if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.COMPANION_CLOUD_DISPATCH_TOKEN }}
|
||||
run: |
|
||||
if [[ -z "${GH_TOKEN:-}" ]]; then
|
||||
echo "GitHub dispatch token not set; skipping companion-cloud trigger."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Triggering companion-cloud companion-os release for ${RELEASE_TAG}"
|
||||
gh api \
|
||||
repos/getcompanion-ai/companion-cloud/dispatches \
|
||||
-X POST \
|
||||
-f event_type=pi-mono-release \
|
||||
-f client_payload[pi_tag]="${RELEASE_TAG}" \
|
||||
-f client_payload[source_repo]="${{ github.repository }}"
|
||||
|
|
|
|||
|
|
@ -39,23 +39,6 @@ fail() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
resolve_agent_dir() {
|
||||
local raw_dir="$1"
|
||||
local fallback_dir="$2"
|
||||
|
||||
for candidate in "${raw_dir}" "${fallback_dir}"; do
|
||||
candidate="${candidate/#\~/$HOME}"
|
||||
[[ "$candidate" != /* ]] && candidate="$PWD/$candidate"
|
||||
mkdir -p "$candidate" 2>/dev/null || continue
|
||||
if : > "${candidate}/.pi-agent-dir-write-check" 2>/dev/null; then
|
||||
rm -f "${candidate}/.pi-agent-dir-write-check" 2>/dev/null || true
|
||||
echo "$candidate"; return
|
||||
fi
|
||||
log "Warning: AGENT_DIR is not writable: ${candidate}"
|
||||
done
|
||||
fail "Could not create writable AGENT_DIR. Checked ${raw_dir} and ${fallback_dir}."
|
||||
}
|
||||
|
||||
has() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
|
@ -175,8 +158,6 @@ if [[ "$FALLBACK_TO_SOURCE" != "0" && "$FALLBACK_TO_SOURCE" != "1" ]]; then
|
|||
fail "PI_FALLBACK_TO_SOURCE must be 0 or 1"
|
||||
fi
|
||||
|
||||
AGENT_DIR="$(resolve_agent_dir "$AGENT_DIR" "$INSTALL_DIR/agent")"
|
||||
|
||||
if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
||||
rm -rf "$INSTALL_DIR"
|
||||
fi
|
||||
|
|
@ -351,21 +332,9 @@ install_packages() {
|
|||
return
|
||||
fi
|
||||
|
||||
local npm_prefix
|
||||
local -a npm_env
|
||||
|
||||
npm_prefix="${HOME}/.pi/npm-global"
|
||||
npm_env=(
|
||||
"NPM_CONFIG_PREFIX=$npm_prefix"
|
||||
"npm_config_prefix=$npm_prefix"
|
||||
"NODE_PATH=$npm_prefix/lib/node_modules:${NODE_PATH:-}"
|
||||
"PATH=$npm_prefix/bin:$PATH"
|
||||
)
|
||||
mkdir -p "$npm_prefix/bin" "$npm_prefix/lib/node_modules"
|
||||
|
||||
while IFS= read -r package; do
|
||||
[[ -z "$package" ]] && continue
|
||||
if "${npm_env[@]}" "$BIN_DIR/pi" install "$package" >/dev/null 2>&1; then
|
||||
if "$BIN_DIR/pi" install "$package" >/dev/null 2>&1; then
|
||||
log "Installed package: $package"
|
||||
else
|
||||
log "Could not install ${package} now. It will install on first run when available."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue