regit-identifiers 1.0.1

Securities identifier validation in pure Rust — ISIN, CUSIP, SEDOL, LEI, BIC, MIC, FIGI, CFI and national numbers. Check-digit algorithms, parsing, and conversion. Zero dependencies, no_std, no alloc.
Documentation
name: Release

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'
      - 'v[0-9]+.[0-9]+.[0-9]+-*'
  workflow_dispatch:
    inputs:
      dry_run:
        description: 'Dry run (do not actually publish)'
        type: boolean
        default: true

permissions:
  contents: write

env:
  CARGO_TERM_COLOR: always

jobs:
  verify:
    name: Verify before publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Install Rust toolchain (from rust-toolchain.toml)
        run: rustup show

      - uses: Swatinem/rust-cache@v2

      - name: Format
        run: cargo fmt --all --check

      - name: Clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Test
        run: cargo test

      - name: Test (no default features)
        run: cargo test --no-default-features

      - name: WASM build
        run: cargo build --target wasm32-unknown-unknown --release

      - name: no_std build
        run: cargo build --target thumbv7em-none-eabi --no-default-features

  publish:
    name: Publish to crates.io
    needs: verify
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Install Rust toolchain (from rust-toolchain.toml)
        run: rustup show

      - uses: Swatinem/rust-cache@v2

      # cargo reads CARGO_REGISTRY_TOKEN from the environment automatically,
      # so --token is not needed and the secret never appears on the command
      # line. DRY_RUN is passed via env (not ${{ }} interpolation in shell)
      # to avoid template injection.
      - name: Publish regit-identifiers
        env:
          DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          if [ "$DRY_RUN" = "true" ]; then
            cargo publish --dry-run --allow-dirty
          else
            cargo publish
          fi

  github_release:
    name: GitHub Release
    needs: publish
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Extract changelog section for this tag
        id: changelog
        run: |
          TAG="${GITHUB_REF#refs/tags/}"
          VERSION="${TAG#v}"
          # Extract the section between [VERSION] and the next ## heading
          awk -v ver="$VERSION" '
            /^## \[/{ if (found) exit; if ($0 ~ "\\[" ver "\\]") found=1; next }
            found
          ' CHANGELOG.md > release_notes.md
          echo "Extracted release notes for v$VERSION:"
          cat release_notes.md

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          body_path: release_notes.md
          draft: false
          prerelease: ${{ contains(github.ref, '-') }}