rustygraph 0.4.2

A high-performance library for visibility graph computation from time series data
Documentation
name: Publish to crates.io

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Version to publish (should match Cargo.toml)'
        required: true
        type: string

env:
  CARGO_TERM_COLOR: always

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Verify version matches
      run: |
        CARGO_VERSION=$(grep -m1 '^version = ' Cargo.toml | cut -d'"' -f2)
        if [ "$CARGO_VERSION" != "${{ inputs.version }}" ]; then
          echo "Error: Version mismatch!"
          echo "Cargo.toml has version: $CARGO_VERSION"
          echo "You specified version: ${{ inputs.version }}"
          exit 1
        fi
        echo "Version verified: $CARGO_VERSION"

    - name: Publish to crates.io
      run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

    - name: Create git tag
      run: |
        git config user.name "GitHub Actions"
        git config user.email "actions@github.com"
        git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
        git push origin "v${{ inputs.version }}"