diff --git a/.github/workflows/build-cross-platform.yaml b/.github/workflows/build-cross-platform.yaml new file mode 100644 index 0000000..32791c7 --- /dev/null +++ b/.github/workflows/build-cross-platform.yaml @@ -0,0 +1,90 @@ +name: Cross-Platform Binary Build + +on: + push: + tags: ["v*.*.*"] + workflow_dispatch: + +jobs: + build: + name: Build for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install uv + run: | + if [ "$RUNNER_OS" = "Linux" ]; then + curl -LsSf https://astral.sh/uv/install.sh | sh + elif [ "$RUNNER_OS" = "macOS" ]; then + curl -LsSf https://astral.sh/uv/install.sh | sh + else + powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" + fi + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + shell: bash + + - name: Install dependencies + run: uv sync --dev + + - name: Install UPX + uses: crazy-max/ghaction-upx@v3 + with: + upx-version: latest + upx-pack: false + + - name: Build binary with PyInstaller + run: uv run pyinstaller pyinstaller.spec + + - name: Test binary + run: | + if [ "$RUNNER_OS" = "Windows" ]; then + dist/mem-mcp-launcher-windows.exe --help + else + dist/mem-mcp-launcher-${{ matrix.os == 'macos-latest' && 'macos' || 'linux' }} --help + fi + shell: bash + + - name: Package binary + run: | + if [ "$RUNNER_OS" = "Windows" ]; then + 7z a memov-launcher-windows.zip ./dist/* + else + zip -r memov-launcher-${{ matrix.os == 'macos-latest' && 'macos' || 'linux' }}.zip ./dist/* + fi + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: memov-launcher-${{ matrix.os }} + path: memov-launcher-*.zip + + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: | + artifacts/memov-launcher-ubuntu-latest/memov-launcher-linux.zip + artifacts/memov-launcher-windows-latest/memov-launcher-windows.zip + artifacts/memov-launcher-macos-latest/memov-launcher-macos.zip + generate_release_notes: true \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 899ed6e..fc369f5 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -15,12 +15,12 @@ 1. **Install uv** - [Modern Python package and project manager](https://docs.astral.sh/uv/getting-started/installation/) **Linux / macOS:** - + Using `curl`: ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` - + Or using `wget`: ```bash wget -qO- https://astral.sh/uv/install.sh | sh diff --git a/pyproject.toml b/pyproject.toml index 8a1bc05..39b0422 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ dependencies = [ "mcp>=1.13.0", "pathspec>=0.12.1", "psutil>=7.0.0", + "pyinstaller>=6.16.0", "starlette>=0.47.2", "typer>=0.16.0", "uvicorn>=0.35.0",