export-bundle 0.1.0

Copy CSV files keeping only caller-supplied columns, refuse headers that name people or machines, and write a verifiable SHA-256 manifest.
Documentation
name: Release

on:
  push:
    tags:
      - "v*"

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: tag matches Cargo.toml version
        run: |
          package_version=$(awk '
            $0 == "[package]" { in_pkg = 1; next }
            /^\[/ { in_pkg = 0 }
            in_pkg && $1 == "version" {
              gsub(/"/, "", $3)
              print $3
              exit
            }
          ' Cargo.toml)
          if [ -z "${package_version}" ]; then
            echo "could not read version from Cargo.toml"
            exit 1
          fi
          expected="v${package_version}"
          if [ "${GITHUB_REF_NAME}" != "${expected}" ]; then
            echo "tag ${GITHUB_REF_NAME} does not match Cargo.toml version ${package_version} (expected ${expected})"
            exit 1
          fi
      - name: require CARGO_REGISTRY_TOKEN
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          if [ -z "${CARGO_REGISTRY_TOKEN}" ]; then
            echo "CARGO_REGISTRY_TOKEN is not set. Add the organisation secret before tagging a release."
            exit 1
          fi
      - name: publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          cargo publish --dry-run
          cargo publish