isbn 0.8.20260501

A library for handling ISBNs.
Documentation
name: Release to crates.io
on:
  schedule:
    - cron: "0 1 * * *"
  workflow_dispatch:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        submodules: recursive

    - name: Update submodule to latest
      run: |
        cd isbn-ranges
        git fetch origin main
        git checkout origin/main
        cd ..

    - name: Check for changes
      id: check
      run: |
        if git diff --quiet isbn-ranges; then
          echo "changed=false" >> $GITHUB_OUTPUT
        else
          echo "changed=true" >> $GITHUB_OUTPUT
        fi

    - name: Update version and commit
      if: steps.check.outputs.changed == 'true'
      run: |
        VERSION="0.8.$(date +%Y%m%d)"
        sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
        git config user.name "github-actions[bot]"
        git config user.email "github-actions[bot]@users.noreply.github.com"
        git add isbn-ranges Cargo.toml
        git commit -m "Update isbn-ranges, release $VERSION"
        git tag "v$VERSION"
        git push
        git push --tags

    - name: Setup Rust
      if: steps.check.outputs.changed == 'true'
      uses: dtolnay/rust-toolchain@stable

    - name: Publish to crates.io
      if: steps.check.outputs.changed == 'true'
      run: cargo publish
      env:
        CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}