mdcast 0.3.0

Markdown → DOCX/ODT/PDF/PPTX/HTML-reveal with per-page layout templates, powered by pandoc and typst
Documentation
name: Release

on:
  push:
    tags: ['v*']

env:
  CARGO_BUILD_JOBS: 4

jobs:
  # Publish to crates.io on every version tag. Authenticates via crates.io
  # Trusted Publishing (OIDC) — no long-lived registry token in secrets.
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Verify tag matches Cargo.toml version
        run: |
          tag="${GITHUB_REF_NAME#v}"
          version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "mdcast") | .version')"
          if [ "$tag" != "$version" ]; then
            echo "Tag v$tag does not match Cargo.toml version $version" >&2
            exit 1
          fi

      - name: Install pandoc
        run: sudo apt-get update && sudo apt-get install -y pandoc

      - uses: Swatinem/rust-cache@v2

      # Tag pushes don't run the PR gate — re-verify before publishing.
      - name: Verify (lint + check-all + test)
        run: make verify

      - name: Authenticate with crates.io
        id: auth
        uses: rust-lang/crates-io-auth-action@v1

      - name: Publish
        run: cargo publish --locked
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}