faculties 0.16.0

An office suite for AI agents: kanban, wiki, files, messaging, and a GORBIE-backed viewer — all persisted in a TribleSpace pile.
name: release

# Build precompiled faculty binaries on tag push and attach them to
# the GitHub release. Restricted sandboxes can grab a tarball; dev
# environments can still `cargo install` from source.

on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

permissions:
  contents: write

jobs:
  build:
    name: ${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-24.04-arm
          # Intel macOS dropped: Apple stopped shipping Intel Macs
          # in late 2023 and the macos-13 free runner queue
          # frequently times out before the build slot opens. Add
          # back if a downstream user actually asks for it.
          - target: aarch64-apple-darwin
            os: macos-14

    steps:
      - uses: actions/checkout@v4

      - name: Install rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          # `wasm32-unknown-unknown` is needed because `wasmi`'s build
          # script (pulled transitively via triblespace-core 0.37)
          # invokes rustc against it.
          targets: ${{ matrix.target }}, wasm32-unknown-unknown

      - name: Build all binaries
        # Release builds don't deny warnings — that's a lint concern,
        # and the CLI faculties carry pre-existing unused-import
        # noise from their rust-script origins. Add a separate lint
        # workflow if/when we want to enforce.
        run: cargo build --release --bins --target ${{ matrix.target }}

      - name: Build bundled trible CLI
        # Ship the `trible` CLI alongside the faculty bins so users
        # who grab a tarball get the whole pile-management toolkit
        # in one drop. Pulled from crates.io (latest) and built for
        # the matrix target via `cargo install`.
        run: |
          cargo install trible \
            --target ${{ matrix.target }} \
            --root "$RUNNER_TEMP/trible-staged" \
            --locked

      - name: Stage binaries
        run: |
          set -eu
          stage="faculties-${GITHUB_REF_NAME}-${{ matrix.target }}"
          mkdir -p "$stage"
          cp LICENSE-MIT LICENSE-APACHE README.md "$stage/" || true
          # All faculty binaries (extension-less; .exe suffix on windows
          # if we ever add it). The widgets-only viewer is gated by a
          # feature so it's not built by default in this workflow.
          for bin in target/${{ matrix.target }}/release/*; do
            [ -f "$bin" ] || continue
            [ -x "$bin" ] || continue
            case "$(basename "$bin")" in
              *.d|*.rlib|*.so|*.dylib|deps|build|examples|incremental) continue ;;
            esac
            cp "$bin" "$stage/"
          done
          # Bundled trible CLI from the previous step.
          cp "$RUNNER_TEMP/trible-staged/bin/trible" "$stage/"
          tar -czf "$stage.tar.gz" "$stage"
          shasum -a 256 "$stage.tar.gz" > "$stage.tar.gz.sha256"
          echo "STAGE_TARBALL=$stage.tar.gz" >> "$GITHUB_ENV"
          echo "STAGE_SHA256=$stage.tar.gz.sha256" >> "$GITHUB_ENV"

      - name: Upload release assets
        uses: softprops/action-gh-release@v2
        with:
          files: |
            ${{ env.STAGE_TARBALL }}
            ${{ env.STAGE_SHA256 }}

  publish-meta:
    name: release notes
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Generate notes
        run: |
          echo "## Install" > notes.md
          echo "" >> notes.md
          echo "### Precompiled (sandboxed environments)" >> notes.md
          echo '```sh' >> notes.md
          echo 'curl -L https://github.com/triblespace/faculties/releases/download/'"${GITHUB_REF_NAME}"'/faculties-'"${GITHUB_REF_NAME}"'-aarch64-apple-darwin.tar.gz | tar -xz' >> notes.md
          echo 'export PATH="$PWD/faculties-'"${GITHUB_REF_NAME}"'-aarch64-apple-darwin:$PATH"' >> notes.md
          echo '```' >> notes.md
          echo "" >> notes.md
          echo "### From source (dev environments)" >> notes.md
          echo '```sh' >> notes.md
          echo 'cargo install --git https://github.com/triblespace/faculties --tag '"${GITHUB_REF_NAME}"' --bins' >> notes.md
          echo '```' >> notes.md
      - uses: softprops/action-gh-release@v2
        with:
          body_path: notes.md
          append_body: true