v1.0.30 #19
Workflow file for this run
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 and Release Binaries | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag (e.g., v1.0.9)' | |
| required: false | |
| env: | |
| PYTHON_VERSION: '3.13' | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux-x86_64 | |
| ext: '' | |
| - os: macos-15 | |
| target: macos-x86_64 | |
| ext: '' | |
| - os: macos-latest | |
| target: macos-arm64 | |
| ext: '' | |
| - os: windows-latest | |
| target: windows-x86_64 | |
| ext: '.exe' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| - name: Install package dependencies | |
| run: | | |
| pip install -e . | |
| - name: Download and bundle embedding model | |
| run: python scripts/download_model.py | |
| - name: Build binary with PyInstaller | |
| run: | | |
| pyinstaller --clean code-memory.spec | |
| - name: Rename binary | |
| shell: bash | |
| run: | | |
| mv dist/code-memory${{ matrix.ext }} dist/code-memory-${{ matrix.target }}${{ matrix.ext }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-memory-${{ matrix.target }} | |
| path: dist/code-memory-${{ matrix.target }}${{ matrix.ext }} | |
| retention-days: 7 | |
| release: | |
| name: Upload Release Assets | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: code-memory-* | |
| merge-multiple: false | |
| - name: List artifacts structure | |
| run: | | |
| echo "=== Artifacts directory structure ===" | |
| find artifacts -type f -ls | |
| - name: Prepare release assets | |
| run: | | |
| mkdir -p release_assets | |
| # Copy all binaries to release_assets with correct names | |
| for dir in artifacts/code-memory-*/; do | |
| if [ -d "$dir" ]; then | |
| target=$(basename "$dir") | |
| if [ -f "${dir}${target}" ]; then | |
| cp "${dir}${target}" "release_assets/${target}" | |
| elif [ -f "${dir}${target}.exe" ]; then | |
| cp "${dir}${target}.exe" "release_assets/${target}.exe" | |
| fi | |
| fi | |
| done | |
| echo "=== Release assets ===" | |
| ls -la release_assets/ | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release_assets/* | |
| fail_on_unmatched_files: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |