spatial-narrative 0.1.0

A Rust library for representing, analyzing, and working with narratives that unfold across real-world geographic space
Documentation
name: Publish to Crates.io

on:
  release:
    types: [published]
  workflow_dispatch:
    inputs:
      dry_run:
        description: 'Dry run (do not actually publish)'
        required: false
        default: 'true'
        type: boolean

env:
  CARGO_TERM_COLOR: always

jobs:
  publish:
    name: Publish
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: ${{ runner.os }}-cargo-publish-${{ hashFiles('**/Cargo.lock') }}

      - name: Verify package
        run: cargo package --list

      - name: Run tests
        run: cargo test --all-features

      - name: Dry run publish
        if: ${{ github.event.inputs.dry_run == 'true' || github.event_name != 'release' }}
        run: cargo publish --dry-run

      - name: Publish to crates.io
        if: ${{ github.event.inputs.dry_run != 'true' && github.event_name == 'release' }}
        run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}