Shared memory and context tools for agentic work.
Code Rooms
name: Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
BINARY_NAME: m1nd-mcp
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact_name: m1nd-mcp-linux-x86_64
- target: x86_64-apple-darwin
os: macos-latest
artifact_name: m1nd-mcp-macos-x86_64
- target: aarch64-apple-darwin
artifact_name: m1nd-mcp-macos-aarch64
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
key: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --bin m1nd-mcp --target ${{ matrix.target }}
- name: Rename binary
run: |
cp target/${{ matrix.target }}/release/${{ env.BINARY_NAME }} ${{ matrix.artifact_name }}
- name: Upload artifact
uses: actions/upload-artifact@v7
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}
if-no-files-found: error
release:
name: Create GitHub Release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
- name: Download all artifacts
uses: actions/download-artifact@v8
path: artifacts/
- name: Flatten artifacts
mkdir -p release-bins
find artifacts/ -type f -exec mv {} release-bins/ \;
ls -la release-bins/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
files: release-bins/*
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
- name: Agent-docs coherence reminder (non-blocking)
echo "::notice title=Agent-docs coherence::Before announcing ${{ github.ref_name }}, confirm the agent-facing docs match what shipped: skills/ (installed into hosts), docs/ + wiki, README/CONTRIBUTING, and the M1ND_INSTRUCTIONS string. Stale host packs teach a stale contract (see PR #216). This is a reminder, not a gate — the PR-time agent-docs-gate is the enforcing check."
publish:
name: Publish to crates.io
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Check crates.io token
id: publish_guard
if [ -z "${CARGO_REGISTRY_TOKEN}" ]; then
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "CARGO_REGISTRY_TOKEN is not configured; skipping crates.io publish."
else
echo "enabled=true" >> "$GITHUB_OUTPUT"
fi
- name: Resolve crate versions
id: versions
if: ${{ steps.publish_guard.outputs.enabled == 'true' }}
python3 - <<'PY' >> "$GITHUB_OUTPUT"
import json
import subprocess
metadata = json.loads(subprocess.check_output([
"cargo",
"metadata",
"--no-deps",
"--format-version",
"1",
]))
versions = {package["name"]: package["version"] for package in metadata["packages"]}
print(f"core={versions['m1nd-core']}")
print(f"ingest={versions['m1nd-ingest']}")
print(f"mcp={versions['m1nd-mcp']}")
PY
- name: Publish m1nd-core
./scripts/publish_crate_if_missing.sh m1nd-core "${{ steps.versions.outputs.core }}" \
--token "$CARGO_REGISTRY_TOKEN"
- name: Publish m1nd-ingest
./scripts/publish_crate_if_missing.sh m1nd-ingest "${{ steps.versions.outputs.ingest }}" \
- name: Publish m1nd-mcp
./scripts/publish_crate_if_missing.sh m1nd-mcp "${{ steps.versions.outputs.mcp }}" \
publish-npm:
name: Publish to npm
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v4
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Check npm token
id: npm_guard
if [ -z "${NODE_AUTH_TOKEN}" ]; then
echo "NPM_TOKEN is not configured; skipping npm publish."
- name: Resolve version and dist-tag
id: npmmeta
if: ${{ steps.npm_guard.outputs.enabled == 'true' }}
VERSION=$(node -p "require('./package.json').version")
# Prereleases (a hyphen, e.g. 0.9.0-beta.8) publish under 'beta' so a
# bare `npm install` never resolves a prerelease; stable -> 'latest'.
case "$VERSION" in
*-*) TAG=beta ;;
*) TAG=latest ;;
esac
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Will publish @maxkle1nz/m1nd@$VERSION under dist-tag '$TAG'."
- name: Publish to npm (idempotent)
PKG="@maxkle1nz/m1nd@${{ steps.npmmeta.outputs.version }}"
if npm view "$PKG" version >/dev/null 2>&1; then
echo "$PKG already published; skipping."
npm publish --tag "${{ steps.npmmeta.outputs.tag }}"