solverforge-ui 0.6.1

Frontend component library for SolverForge constraint-optimization applications
Documentation
name: Publish to crates.io

on:
  push:
    tags:
      - 'v*'

env:
  CARGO_TERM_COLOR: always

jobs:
  publish:
    if: ${{ github.server_url == 'https://github.com' }}
    name: Publish
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        run: |
          rm -rf .git
          git init .
          git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
          git fetch --depth=1 origin "${{ github.sha }}"
          git checkout --detach FETCH_HEAD

      - name: Install Rust
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
          echo "$HOME/.cargo/bin" >> $GITHUB_PATH

      - name: Check formatting
        run: cargo fmt --all -- --check

      - name: Run clippy
        run: cargo clippy --all-targets -- -D warnings

      - name: Build
        run: cargo build --release

      - name: Run tests
        run: cargo test

      - name: Dry-run publish
        run: cargo publish --dry-run

      - name: Verify package contents
        run: ./scripts/verify-package.sh

      - name: Publish solverforge-ui
        run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}