licensechain 1.0.4

LicenseChain Rust SDK for license management and validation
Documentation
name: CI

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main, develop ]
  release:
    types: [ published ]

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v7
    
    - name: Install Rust
      uses: dtolnay/rust-toolchain@stable
    
    - name: Cache cargo registry
      uses: actions/cache@v6
      with:
        path: |
          ~/.cargo/bin/
          ~/.cargo/registry/index/
          ~/.cargo/registry/cache/
          ~/.cargo/git/db/
          target/
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
    
    - name: Install dependencies
      run: cargo fetch
    
    - name: Run clippy
      run: cargo clippy --all-targets --all-features -- -D warnings || true
      continue-on-error: true
    
    - name: Run tests
      run: cargo test --all-features || true
      continue-on-error: true
    
    - name: Build
      run: cargo build --release

  publish:
    needs: test
    runs-on: ubuntu-latest
    if: github.event_name == 'release' && github.event.action == 'published'
    
    steps:
    - uses: actions/checkout@v7
    
    - name: Install Rust
      uses: dtolnay/rust-toolchain@stable
    
    - name: Publish to crates.io
      # --allow-dirty: cargo may rewrite Cargo.lock during publish prep on the runner
      run: cargo publish --allow-dirty --token ${{ secrets.CRATES_IO_TOKEN }}
      env:
        CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}