mind-cli 0.6.1

A manager for agent tooling (skills, agents, rules, tools) that melds arbitrary git repos and links items into your agent directories.
name: release

on:
  push:
    tags: ["v*"]

permissions:
  contents: write

concurrency:
  group: release-${{ github.ref_name }}
  cancel-in-progress: false

jobs:
  build:
    name: build ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: aarch64-apple-darwin
            os: macos-14
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-24.04-arm
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}
      - uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}
      - name: build
        run: cargo build --release --locked --bin mind --target ${{ matrix.target }}
      - name: package
        run: |
          version="${GITHUB_REF_NAME#v}"
          dist="mind-${version}-${{ matrix.target }}"
          mkdir "$dist"
          cp "target/${{ matrix.target }}/release/mind" "$dist/"
          tar -czf "${dist}.tar.gz" -C "$dist" mind
      - uses: actions/upload-artifact@v7
        with:
          name: ${{ matrix.target }}
          path: mind-*.tar.gz

  release:
    needs: build
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
      - uses: actions/download-artifact@v8
        with:
          path: dist
          merge-multiple: true
      - name: create release
        env:
          GH_TOKEN: ${{ github.token }}
        run: |
          version="${GITHUB_REF_NAME#v}"
          bash resources/changelog-section.sh "$version" > notes.md
          gh release create "$GITHUB_REF_NAME" dist/*.tar.gz --title "$GITHUB_REF_NAME" --notes-file notes.md

  formula:
    needs: release
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v7
        with:
          ref: main
      - uses: actions/download-artifact@v8
        with:
          path: dist
          merge-multiple: true
      - name: regenerate formula
        run: bash resources/update-formula.sh "${GITHUB_REF_NAME#v}" dist Formula/mind.rb
      - name: commit formula
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git add Formula/mind.rb
          if git diff --cached --quiet; then
            echo "formula already up to date"
          else
            git commit -m "release: update mind formula to ${GITHUB_REF_NAME#v}"
            git push origin main
          fi