narrative-graph 0.1.2

Turn prose into candidate relational facts — entity detection, relation labeling, confidence scoring, entirely local.
Documentation
name: Publish npm

on:
  release:
    types: [published]

permissions:
  contents: read
  id-token: write
  attestations: write

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os: macos-latest
            target: aarch64-apple-darwin
          - os: macos-15-intel
            target: x86_64-apple-darwin
          - os: windows-latest
            target: x86_64-pc-windows-msvc

    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

    - name: Install Rust
      uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
      with:
        targets: ${{ matrix.target }}

    - name: Install Node.js
      uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
      with:
        node-version: '20'

    - name: Install dependencies
      run: npm ci --omit=optional

    - name: Build
      run: npm run build -- --target ${{ matrix.target }}

    - name: Upload artifact
      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
      with:
        name: bindings-${{ matrix.target }}
        path: "*.node"
        if-no-files-found: error

  publish:
    runs-on: ubuntu-latest
    needs: build
    steps:
    - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

    - name: Install Node.js
      uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
      with:
        node-version: '20'
        registry-url: 'https://registry.npmjs.org'

    - name: Install dependencies
      run: npm ci --omit=optional

    - name: Download all artifacts
      uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
      with:
        path: artifacts

    # The per-platform package dirs are generated rather than committed, so they
    # have to exist before `napi artifacts` fills them and `napi prepublish`
    # (run by prepublishOnly) publishes them as optionalDependencies.
    - name: Create npm package dirs
      run: npx napi create-npm-dirs

    - name: Move artifacts
      run: npm run artifacts

    - name: Generate attestations
      uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
      with:
        subject-path: '*.node'

    - name: Publish
      run: npm publish --provenance --access public
      env:
        NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}