acroform 0.1.3

High-level PDF form manipulation library using lopdf
Documentation
name: Publish

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  CARGO_INCREMENTAL: 0
  CARGO_NET_RETRY: 10
  RUST_BACKTRACE: short
  CARGO_PROFILE_DEV_DEBUG: 0
  CARGO_PROFILE_TEST_DEBUG: 0

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        features:
          - name: "default"
            flags: ""

    steps:
      - uses: actions/checkout@v4

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

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

      - name: Tests (${{ matrix.features.name }})
        run: cargo test ${{ matrix.features.flags }} --locked --package acroform
        
  publish-crates:
    needs: [test]
    runs-on: ubuntu-latest
    environment: Publish
    steps:
      - name: Checkout
        uses: actions/checkout@v4

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

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

      - name: Publish workspace crates (no verification)
        run: cargo publish --locked --no-verify
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

      - name: Crates publish summary
        if: success()
        run: echo "✓ All publishable workspace crates published to crates.io"

  summary:
    needs: [publish-crates]
    runs-on: ubuntu-latest
    if: always()
    steps:
      - name: Overall summary
        run: |
          echo "## Publishing Summary"
          echo ""

          # Crates
          if [ "${{ needs.publish-crates.result }}" == "success" ]; then
            echo "✓ Crates published to crates.io"
          elif [ "${{ needs.publish-crates.result }}" == "skipped" ]; then
            echo "⊘ Crates publishing skipped"
          else
            echo "✗ Crates publishing failed"
          fi

          # Exit with failure if any job failed
          if [ "${{ contains(needs.*.result, 'failure') }}" == "true" ]; then
            echo ""
            echo "⚠️  One or more publishing jobs failed"
            exit 1
          fi