@@ -109,68 +109,21 @@ runs:
109109 echo "version=${VERSION}" >> $GITHUB_OUTPUT
110110 echo "Resolved altimate-code version: ${VERSION}"
111111
112- - name : Cache altimate-code
113- id : cache
114- uses : actions/cache@v4
115- with :
116- path : ~/.altimate-code/bin
117- key : altimate-code-${{ runner.os }}-${{ runner.arch }}-${{ steps.version.outputs.version }}
118-
119112 - name : Install altimate-code
120- if : steps.cache.outputs.cache-hit != 'true'
121113 shell : bash
122114 run : |
123- # Download binary directly from GitHub releases
124115 VERSION="${{ steps.version.outputs.version }}"
125- ARCH=$(uname -m)
126- OS=$(uname -s | tr '[:upper:]' '[:lower:]')
127-
128- # Map architecture names
129- case "$ARCH" in
130- x86_64) ARCH="x64" ;;
131- aarch64|arm64) ARCH="arm64" ;;
132- esac
133-
134- ASSET="altimate-code-${OS}-${ARCH}"
135- if [ "$OS" = "linux" ]; then
136- ASSET="${ASSET}.tar.gz"
137- else
138- ASSET="${ASSET}.zip"
139- fi
140-
141- DOWNLOAD_URL="https://github.com/AltimateAI/altimate-code/releases/download/${VERSION}/${ASSET}"
142- echo "Downloading altimate-code ${VERSION} from ${DOWNLOAD_URL}"
143-
144- mkdir -p ~/.altimate-code/bin
145- cd /tmp
146- if curl -fsSL -o "altimate-code-archive" "$DOWNLOAD_URL"; then
147- if [ "$OS" = "linux" ]; then
148- tar xzf altimate-code-archive -C ~/.altimate-code/bin/
149- else
150- unzip -o altimate-code-archive -d ~/.altimate-code/bin/
151- fi
152- chmod +x ~/.altimate-code/bin/altimate-code
153- rm -f altimate-code-archive
154-
155- # Verify installation
156- if [ -x "$HOME/.altimate-code/bin/altimate-code" ]; then
157- echo "altimate-code installed successfully"
158- "$HOME/.altimate-code/bin/altimate-code" --version 2>/dev/null || true
159- else
160- echo "::warning::altimate-code binary not found after extraction"
161- ls -la "$HOME/.altimate-code/bin/" || true
162- fi
163- else
164- echo "::warning::Failed to download altimate-code ${VERSION} — falling back to regex rules"
165- fi
116+ echo "Installing altimate-code ${VERSION} via npm..."
117+ npm install -g "@altimateai/altimate-code@${VERSION#v}" 2>&1 || \
118+ npm install -g @altimateai/altimate-code@latest 2>&1 || \
119+ echo "::warning::Failed to install altimate-code — falling back to regex rules"
166120
167- - name : Add altimate-code to PATH
168- shell : bash
169- run : |
170- echo "$HOME/.altimate-code/bin" >> $GITHUB_PATH
171- # Also verify check command is available
121+ # Verify
172122 if command -v altimate-code >/dev/null 2>&1; then
173- echo "altimate-code is on PATH"
123+ echo "altimate-code $(altimate-code --version 2>/dev/null || echo 'installed')"
124+ altimate-code check --help >/dev/null 2>&1 && echo "check command: available" || echo "check command: not available"
125+ else
126+ echo "::warning::altimate-code not found on PATH after install"
174127 fi
175128
176129 - name : Setup Node.js
0 commit comments