spm-cli 0.1.0

Skill package manager — declare AI skills in ai.json, materialize them for Claude/Copilot without polluting your repo.
name: release

# Cross-compiles static binaries for every target and attaches them to the
# GitHub Release when a v* tag is pushed.
on:
  push:
    tags: ["v*"]
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build:
    name: ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - { os: ubuntu-latest,  target: x86_64-unknown-linux-gnu,   ext: "" }
          - { os: ubuntu-latest,  target: aarch64-unknown-linux-gnu,  ext: "" }
          - { os: macos-latest,   target: x86_64-apple-darwin,        ext: "" }
          - { os: macos-latest,   target: aarch64-apple-darwin,       ext: "" }
          - { os: windows-latest, target: x86_64-pc-windows-msvc,     ext: ".exe" }
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}
      - uses: Swatinem/rust-cache@v2
      - name: Install cross-linker (aarch64 linux)
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu
          echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
      - name: Build
        run: cargo build --release --target ${{ matrix.target }}
      - name: Package
        shell: bash
        run: |
          bin="target/${{ matrix.target }}/release/spm${{ matrix.ext }}"
          out="spm-${{ matrix.target }}${{ matrix.ext }}"
          cp "$bin" "$out"
          echo "ASSET=$out" >> "$GITHUB_ENV"
      - name: Attach to release
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: ${{ env.ASSET }}