-
Notifications
You must be signed in to change notification settings - Fork 2
Add modular extras and standalone CLI binary #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -111,9 +111,24 @@ jobs: | |||||||||||||
| > ``` | ||||||||||||||
| > Then open the app normally. This only needs to be done once. | ||||||||||||||
|
|
||||||||||||||
| ### CLI Binary (Terminal Only) | ||||||||||||||
| | Platform | Download | Size | | ||||||||||||||
| |----------|----------|------| | ||||||||||||||
| | **Linux** (x64) | [`cachi-linux-x64.tar.gz`](https://github.com/${{ github.repository }}/releases/download/v${{ steps.bump_version.outputs.new_version }}/cachi-linux-x64.tar.gz) | — | | ||||||||||||||
| | **macOS** (Apple Silicon) | [`cachi-mac-arm64.tar.gz`](https://github.com/${{ github.repository }}/releases/download/v${{ steps.bump_version.outputs.new_version }}/cachi-mac-arm64.tar.gz) | — | | ||||||||||||||
| | **Windows** (x64) | [`cachi-win-x64.zip`](https://github.com/${{ github.repository }}/releases/download/v${{ steps.bump_version.outputs.new_version }}/cachi-win-x64.zip) | — | | ||||||||||||||
|
|
||||||||||||||
| ### Mini Server (Dashboard — no Python required) | ||||||||||||||
| | Platform | Download | Size | | ||||||||||||||
| |----------|----------|------| | ||||||||||||||
| | **Linux** (x64) | [`cachibot-server-mini-linux-x64.tar.gz`](https://github.com/${{ github.repository }}/releases/download/v${{ steps.bump_version.outputs.new_version }}/cachibot-server-mini-linux-x64.tar.gz) | — | | ||||||||||||||
|
|
||||||||||||||
| > Lightweight server with web dashboard, database, and auth. No knowledge base or platform integrations. Ideal for Raspberry Pi, VPS, and edge deployments. | ||||||||||||||
|
|
||||||||||||||
| ### Python Package (pip) | ||||||||||||||
| ```bash | ||||||||||||||
| pip install cachibot==${{ steps.bump_version.outputs.new_version }} | ||||||||||||||
| pip install cachibot==${{ steps.bump_version.outputs.new_version }} # CLI only | ||||||||||||||
| pip install cachibot[full]==${{ steps.bump_version.outputs.new_version }} # CLI + server + all extras | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
@@ -222,7 +237,7 @@ jobs: | |||||||||||||
| shell: bash | ||||||||||||||
| run: | | ||||||||||||||
| echo "${{ needs.release.outputs.new_version }}" > VERSION | ||||||||||||||
| pip install -e . | ||||||||||||||
| pip install -e ".[full]" | ||||||||||||||
| pip install pyinstaller | ||||||||||||||
|
|
||||||||||||||
| - name: Clean __pycache__ | ||||||||||||||
|
|
@@ -275,6 +290,157 @@ jobs: | |||||||||||||
| name: ${{ matrix.artifact }} | ||||||||||||||
| path: dist/cachibot-server/ | ||||||||||||||
|
|
||||||||||||||
| # ========================================================================= | ||||||||||||||
| # 2b. Build CLI-only binary with PyInstaller (3 platforms) | ||||||||||||||
| # ========================================================================= | ||||||||||||||
| build-cli: | ||||||||||||||
| needs: release | ||||||||||||||
| strategy: | ||||||||||||||
| fail-fast: false | ||||||||||||||
| matrix: | ||||||||||||||
| include: | ||||||||||||||
| - os: ubuntu-latest | ||||||||||||||
| artifact: cachi-linux-x64 | ||||||||||||||
| archive_name: cachi-linux-x64.tar.gz | ||||||||||||||
| archive_cmd: tar -czf | ||||||||||||||
| - os: macos-latest | ||||||||||||||
| artifact: cachi-mac-arm64 | ||||||||||||||
| archive_name: cachi-mac-arm64.tar.gz | ||||||||||||||
| archive_cmd: tar -czf | ||||||||||||||
| - os: windows-latest | ||||||||||||||
| artifact: cachi-win-x64 | ||||||||||||||
| archive_name: cachi-win-x64.zip | ||||||||||||||
| archive_cmd: zip -r | ||||||||||||||
|
|
||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
| with: | ||||||||||||||
| ref: v${{ needs.release.outputs.new_version }} | ||||||||||||||
|
|
||||||||||||||
| - uses: actions/setup-python@v5 | ||||||||||||||
| with: | ||||||||||||||
| python-version: '3.12' | ||||||||||||||
| cache: pip | ||||||||||||||
|
|
||||||||||||||
| - name: Install CachiBot (core only) + PyInstaller | ||||||||||||||
| shell: bash | ||||||||||||||
| run: | | ||||||||||||||
| echo "${{ needs.release.outputs.new_version }}" > VERSION | ||||||||||||||
| pip install -e . | ||||||||||||||
| pip install pyinstaller | ||||||||||||||
|
|
||||||||||||||
| - name: Clean __pycache__ | ||||||||||||||
| shell: bash | ||||||||||||||
| run: find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true | ||||||||||||||
|
|
||||||||||||||
| - name: Build CLI binary | ||||||||||||||
| run: pyinstaller cachibot-cli.spec --clean | ||||||||||||||
|
|
||||||||||||||
| - name: Smoke test CLI binary | ||||||||||||||
| shell: bash | ||||||||||||||
| run: | | ||||||||||||||
| BINARY="./dist/cachi/cachi" | ||||||||||||||
| if [[ "$RUNNER_OS" == "Windows" ]]; then | ||||||||||||||
| BINARY="./dist/cachi/cachi.exe" | ||||||||||||||
| fi | ||||||||||||||
| "$BINARY" --help | ||||||||||||||
| echo "CLI smoke test passed" | ||||||||||||||
|
|
||||||||||||||
| - name: Archive CLI binary | ||||||||||||||
| shell: bash | ||||||||||||||
| run: | | ||||||||||||||
| cd dist | ||||||||||||||
| if [[ "${{ matrix.archive_name }}" == *.zip ]]; then | ||||||||||||||
| ${{ matrix.archive_cmd }} "${{ matrix.archive_name }}" cachi/ | ||||||||||||||
| else | ||||||||||||||
| ${{ matrix.archive_cmd }} "${{ matrix.archive_name }}" cachi/ | ||||||||||||||
| fi | ||||||||||||||
|
Comment on lines
+355
to
+359
|
||||||||||||||
| if [[ "${{ matrix.archive_name }}" == *.zip ]]; then | |
| ${{ matrix.archive_cmd }} "${{ matrix.archive_name }}" cachi/ | |
| else | |
| ${{ matrix.archive_cmd }} "${{ matrix.archive_name }}" cachi/ | |
| fi | |
| ${{ matrix.archive_cmd }} "${{ matrix.archive_name }}" cachi/ |
Copilot
AI
Mar 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow references cachibot-server-mini.spec, but this file does not exist in the repository. This job will fail at the PyInstaller step. A spec file for the mini server build must be created and included in this PR.
| run: pyinstaller cachibot-server-mini.spec --clean | |
| run: pyinstaller cachibot-server-mini.py --name cachibot-server-mini --clean |
Copilot
AI
Mar 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the health endpoint never becomes healthy within 60 iterations, the for loop exits silently without an explicit failure. The subsequent curl -sf on line 424 will fail (thanks to set -e), but the error message will be confusing — it won't indicate a timeout. Consider adding an explicit failure after the loop, e.g., checking a variable set on success or failing with a clear "Timed out waiting for server" message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow references
cachibot-cli.spec(line 339) andcachibot-server-mini.spec(line 403), but neither file exists in the repository. Thebuild-cliandbuild-server-minijobs will fail at the PyInstaller step. These spec files need to be created and included in this PR.