terni 0.5.0

Ternary error handling: Success, Partial with measured loss, Failure. Because computation is not binary.
Documentation
name: Publish

on:
  release:
    types: [published]

jobs:
  publish-imperfect:
    name: Publish terni to crates.io
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: systemic-engineering/ci/actions/nix-setup@main

      - name: Verify version matches tag
        run: |
          TAG_VERSION="${GITHUB_REF#refs/tags/v}"
          CARGO_VERSION=$(nix develop -c cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "terni") | .version')
          if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
            echo "Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
            exit 1
          fi

      - name: Publish terni
        run: nix develop -c cargo publish -p terni
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  notify-on-failure:
    if: failure()
    needs: [publish-imperfect]
    uses: systemic-engineering/ci/.github/workflows/notify-ntfy.yml@main
    with:
      repo: ${{ github.repository }}
      workflow: ${{ github.workflow }}
      run_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
    secrets:
      NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}