Build Executables #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Executables | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| target: linux-x64 | |
| artifact: semble-linux-x64 | |
| - os: ubuntu-22.04-arm | |
| target: linux-arm64 | |
| artifact: semble-linux-arm64 | |
| - os: macos-14 | |
| target: macos-arm64 | |
| artifact: semble-macos-arm64 | |
| - os: windows-latest | |
| target: windows-x64 | |
| artifact: semble-windows-x64.exe | |
| runs-on: ${{ matrix.os }} | |
| name: Build (${{ matrix.target }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --extra mcp | |
| - name: Build executable | |
| run: uv run python build.py --name semble --with-mcp | |
| - name: Smoke test (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x dist/semble | |
| ./dist/semble search --help | |
| ./dist/semble init --help | |
| - name: Smoke test (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| dist\semble.exe search --help | |
| dist\semble.exe init --help | |
| - name: Rename artifact (Unix) | |
| if: runner.os != 'Windows' | |
| run: mv dist/semble dist/${{ matrix.artifact }} | |
| - name: Rename artifact (Windows) | |
| if: runner.os == 'Windows' | |
| run: mv dist/semble.exe dist/${{ matrix.artifact }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: dist/${{ matrix.artifact }} | |
| retention-days: 30 | |
| integration-test: | |
| needs: [build] | |
| runs-on: ubuntu-22.04 | |
| name: Integration Test (linux-x64) | |
| steps: | |
| - name: Download linux-x64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: semble-linux-x64 | |
| - name: Make executable | |
| run: chmod +x semble-linux-x64 | |
| - name: Clone a test repo | |
| run: git clone --depth 1 https://github.com/MinishLab/model2vec test-repo | |
| - name: Test search | |
| run: | | |
| OUTPUT=$(./semble-linux-x64 search "save model to disk" ./test-repo) | |
| echo "$OUTPUT" | |
| echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No results returned'" | |
| - name: Test find-related | |
| run: | | |
| OUTPUT=$(./semble-linux-x64 search "load pretrained" ./test-repo) | |
| FILE=$(echo "$OUTPUT" | python3 -c "import sys, json; print(json.load(sys.stdin)['results'][0]['chunk']['file_path'])") | |
| echo "Using file: $FILE" | |
| RELATED=$(./semble-linux-x64 find-related "$FILE" 1 ./test-repo) | |
| echo "$RELATED" | |
| echo "$RELATED" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No related results'" | |
| - name: Test search with --content all | |
| run: | | |
| OUTPUT=$(./semble-linux-x64 search "installation" ./test-repo --content all) | |
| echo "$OUTPUT" | |
| echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No results with --content all'" | |
| - name: Test search with top-k | |
| run: | | |
| OUTPUT=$(./semble-linux-x64 search "tokenizer" ./test-repo -k 3) | |
| echo "$OUTPUT" | |
| echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) <= 3, 'top-k not respected'" | |
| - name: Test init | |
| run: | | |
| ./semble-linux-x64 init --agent claude | |
| test -f .claude/agents/semble-search.md | |
| echo "Init created agent file successfully" | |
| - name: Test savings | |
| run: ./semble-linux-x64 savings | |
| release: | |
| needs: [build, integration-test] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| sha256sum * > checksums-sha256.txt | |
| cat checksums-sha256.txt | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/* | |
| generate_release_notes: true | |
| body: | | |
| ## Standalone Executables | |
| No Python installation required. Download the binary for your platform and run it directly. | |
| | Platform | Architecture | File | | |
| |----------|-------------|------| | |
| | Linux | x64 | `semble-linux-x64` | | |
| | Linux | ARM64 | `semble-linux-arm64` | | |
| | macOS | Apple Silicon (ARM64) | `semble-macos-arm64` | | |
| | Windows | x64 | `semble-windows-x64.exe` | | |
| ### Usage | |
| ```bash | |
| chmod +x semble-* | |
| ./semble-linux-x64 search "authentication flow" ./my-project | |
| ``` | |
| ### Verify checksums | |
| ```bash | |
| sha256sum -c checksums-sha256.txt | |
| ``` |