|
| 1 | +# Manual binary build for the personal-memory branch only. |
| 2 | +# Intentionally standalone and simple: no release workflow, no reusable workflow, |
| 3 | +# no publishing to GitHub Releases. It just builds one Linux x64 binary and |
| 4 | +# uploads a downloadable artifact from the selected branch ref. |
| 5 | +name: Personal Memory Branch Binary |
| 6 | + |
| 7 | +run-name: personal-memory binary @ ${{ github.ref_name }} |
| 8 | + |
| 9 | +on: |
| 10 | + workflow_dispatch: |
| 11 | + inputs: |
| 12 | + version: |
| 13 | + description: "Optional version string embedded in the binary, e.g. personal-memory-preview" |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + default: "" |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + build-linux-amd64: |
| 23 | + name: Build Linux amd64 artifact |
| 24 | + runs-on: ubuntu-latest |
| 25 | + timeout-minutes: 120 |
| 26 | + steps: |
| 27 | + - name: Annotate branch scope |
| 28 | + shell: bash |
| 29 | + run: | |
| 30 | + echo "::notice title=Branch-only workflow::This workflow is only for the personal-memory branch. Current ref: ${GITHUB_REF_NAME}." |
| 31 | + if [ "${GITHUB_REF_NAME}" != "personal-memory" ]; then |
| 32 | + echo "::error title=Wrong branch::Run this workflow with ref personal-memory. No binary will be built for ${GITHUB_REF_NAME}." |
| 33 | + exit 1 |
| 34 | + fi |
| 35 | +
|
| 36 | + - name: Checkout selected branch |
| 37 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 38 | + |
| 39 | + - name: Install build dependencies |
| 40 | + run: sudo apt-get update && sudo apt-get install -y build-essential zlib1g-dev |
| 41 | + |
| 42 | + - name: Build binary |
| 43 | + shell: bash |
| 44 | + env: |
| 45 | + VERSION: ${{ inputs.version }} |
| 46 | + run: | |
| 47 | + set -euo pipefail |
| 48 | + if [ -n "$VERSION" ]; then |
| 49 | + scripts/build.sh --version "$VERSION" CC=gcc CXX=g++ |
| 50 | + else |
| 51 | + scripts/build.sh CC=gcc CXX=g++ |
| 52 | + fi |
| 53 | + build/c/codebase-memory-mcp --version |
| 54 | + build/c/codebase-memory-mcp --help | grep -q 'manage_memory' |
| 55 | +
|
| 56 | + - name: Package artifact |
| 57 | + shell: bash |
| 58 | + run: | |
| 59 | + set -euo pipefail |
| 60 | + mkdir -p dist/codebase-memory-mcp-personal-memory-linux-amd64 |
| 61 | + cp build/c/codebase-memory-mcp LICENSE install.sh dist/codebase-memory-mcp-personal-memory-linux-amd64/ |
| 62 | + scripts/gen-third-party-notices.sh dist/codebase-memory-mcp-personal-memory-linux-amd64/THIRD_PARTY_NOTICES.md |
| 63 | + tar -czf dist/codebase-memory-mcp-personal-memory-linux-amd64.tar.gz \ |
| 64 | + -C dist codebase-memory-mcp-personal-memory-linux-amd64 |
| 65 | + sha256sum dist/codebase-memory-mcp-personal-memory-linux-amd64.tar.gz \ |
| 66 | + > dist/codebase-memory-mcp-personal-memory-linux-amd64.tar.gz.sha256 |
| 67 | +
|
| 68 | + - name: Upload binary artifact |
| 69 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 70 | + with: |
| 71 | + name: codebase-memory-mcp-personal-memory-linux-amd64 |
| 72 | + path: | |
| 73 | + dist/codebase-memory-mcp-personal-memory-linux-amd64.tar.gz |
| 74 | + dist/codebase-memory-mcp-personal-memory-linux-amd64.tar.gz.sha256 |
| 75 | + if-no-files-found: error |
0 commit comments