jsonfg 0.1.0

Types for OGC Features and Geometries JSON (JSON-FG), a GeoJSON superset with support for arbitrary coordinate reference systems, solids, and curved geometries.
Documentation
name: Publish to crates.io
on:
  release:
    types: [published]
  # Manual trigger for the one-time bootstrap publish of a brand-new crate, which cannot
  # use Trusted Publishing (that must be configured on an already-published crate). Uses
  # the CARGO_TOKEN_FOR_NEW_CRATES_ONLY secret. Every subsequent release publishes via
  # OIDC and needs no token.
  workflow_dispatch:

jobs:
  publish:
    name: Publish
    runs-on: ubuntu-latest

    permissions:
      contents: read
      id-token: write

    steps:
      - name: Checkout the code
        uses: actions/checkout@v6

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

      - name: Rust cache
        uses: Swatinem/rust-cache@v2

      - name: Set version from tag
        if: github.event_name == 'release'
        run: |
          VERSION="${GITHUB_REF_NAME#v}"
          sed -i "s/^version = .*/version = \"${VERSION}\"/" Cargo.toml

      - name: Authenticate via Trusted Publishing (OIDC)
        if: github.event_name == 'release'
        uses: rust-lang/crates-io-auth-action@v1
        id: auth

      - name: Publish jsonfg
        run: cargo publish --allow-dirty
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token || secrets.CARGO_TOKEN_FOR_NEW_CRATES_ONLY }}