Build Executables #10
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 onefile executable | |
| run: uv run python build.py --name semble --with-mcp | |
| - name: Rename onefile artifact (Unix) | |
| if: runner.os != 'Windows' | |
| run: mv dist/semble dist/${{ matrix.artifact }} | |
| - name: Rename onefile artifact (Windows) | |
| if: runner.os == 'Windows' | |
| run: mv dist/semble.exe dist/${{ matrix.artifact }} | |
| - name: Build onedir executable | |
| run: uv run python build.py --onedir --name semble --with-mcp | |
| - name: Smoke test onefile (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x dist/${{ matrix.artifact }} | |
| ./dist/${{ matrix.artifact }} search --help | |
| ./dist/${{ matrix.artifact }} init --help | |
| - name: Smoke test onefile (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| dist\${{ matrix.artifact }} search --help | |
| dist\${{ matrix.artifact }} init --help | |
| - name: Smoke test onedir (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x dist/semble/semble | |
| ./dist/semble/semble search --help | |
| ./dist/semble/semble init --help | |
| - name: Smoke test onedir (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| dist\semble\semble.exe search --help | |
| dist\semble\semble.exe init --help | |
| - name: Package onedir as archive (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd dist/semble | |
| tar -czf ../semble-${{ matrix.target }}-fast.tar.gz . | |
| - name: Package onedir as archive (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cd dist/semble | |
| Compress-Archive -Path * -DestinationPath ../semble-${{ matrix.target }}-fast.zip | |
| - name: Upload onefile artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: dist/${{ matrix.artifact }} | |
| retention-days: 30 | |
| - name: Upload onedir artifact (Unix) | |
| if: runner.os != 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: semble-${{ matrix.target }}-fast.tar.gz | |
| path: dist/semble-${{ matrix.target }}-fast.tar.gz | |
| retention-days: 30 | |
| - name: Upload onedir artifact (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: semble-${{ matrix.target }}-fast.zip | |
| path: dist/semble-${{ matrix.target }}-fast.zip | |
| 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]['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. | |
| ### Single-file binaries (portable, slower startup) | |
| | 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` | | |
| ### Fast-start archives (extract and run, ~20x faster startup) | |
| | Platform | Architecture | File | | |
| |----------|-------------|------| | |
| | Linux | x64 | `semble-linux-x64-fast.tar.gz` | | |
| | Linux | ARM64 | `semble-linux-arm64-fast.tar.gz` | | |
| | macOS | Apple Silicon (ARM64) | `semble-macos-arm64-fast.tar.gz` | | |
| | Windows | x64 | `semble-windows-x64-fast.zip` | | |
| ### Usage | |
| **Single-file (portable):** | |
| ```bash | |
| chmod +x semble-linux-x64 | |
| ./semble-linux-x64 search "authentication flow" ./my-project | |
| ``` | |
| **Fast-start (recommended for repeated use):** | |
| ```bash | |
| tar -xzf semble-linux-x64-fast.tar.gz -C semble/ | |
| ./semble/semble search "authentication flow" ./my-project | |
| ``` | |
| ### Verify checksums | |
| ```bash | |
| sha256sum -c checksums-sha256.txt | |
| ``` |