tzf-rs 2.2.0

Fast convert longitude,latitude to timezone name.
Documentation
name: Deploy documentation
on:
  push:
    branches: [main]

env:
  CARGO_TERM_COLOR: always
  # Same interim sibling bootstrap as rust.yml — see the note there.
  TZF_REF: embedded
  TZF_DIST_REF: v2-artifacts
  TBB_VERSION: 2026d

defaults:
  run:
    working-directory: tzf-rs

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: "https://ringsaturn.github.io/tzf-rs/tzf_rs"
    permissions:
      contents: read
      pages: write
      id-token: write
    steps:
      - uses: actions/checkout@v7
        with:
          path: tzf-rs

      # See rust.yml: the bootstrap is only needed while Cargo.toml carries
      # the dev-form path dependency on ../tzf-dist.
      - name: Does this manifest still need the sibling tzf-dist bootstrap?
        id: data
        run: |
          if grep -Eq '^[[:space:]]*tzf-dist[[:space:]]*=.*path[[:space:]]*=' Cargo.toml; then
            echo "bootstrap=true" >> "$GITHUB_OUTPUT"
          else
            echo "bootstrap=false" >> "$GITHUB_OUTPUT"
          fi

      - uses: actions/checkout@v7
        if: steps.data.outputs.bootstrap == 'true'
        with:
          repository: ringsaturn/tzf
          ref: ${{ env.TZF_REF }}
          path: tzf
      - uses: actions/checkout@v7
        if: steps.data.outputs.bootstrap == 'true'
        with:
          repository: ringsaturn/tzf-dist
          ref: ${{ env.TZF_DIST_REF }}
          path: tzf-dist

      - uses: actions/setup-go@v7
        if: steps.data.outputs.bootstrap == 'true'
        with:
          go-version-file: tzf/go.mod
          cache-dependency-path: tzf/go.sum

      - name: Cache tzf-dist artifact build
        if: steps.data.outputs.bootstrap == 'true'
        uses: actions/cache@v6
        with:
          path: tzf/tmp/tzf-dist-dev
          key: tzf-dist-dev-${{ env.TBB_VERSION }}-${{ hashFiles('tzf/scripts/build-tzf-dist-dev.sh', 'tzf/internal/**', 'tzf/cmd/**') }}

      - name: Build and install tzf-dist artifacts
        if: steps.data.outputs.bootstrap == 'true'
        working-directory: tzf
        run: ./scripts/build-tzf-dist-dev.sh

      - uses: actions-rust-lang/setup-rust-toolchain@v2
        with:
          toolchain: nightly
          cache-workspaces: tzf-rs
      - name: Build documentation with all features
        run: make doc

      # https://github.com/actions/deploy-pages/issues/303
      - name: Fix permissions
        run: |
          chmod -c -R +rX "target/doc/" | while read line; do
            echo "::warning title=Invalid file permissions automatically fixed::$line"
          done

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v5
        with:
          path: "./tzf-rs/target/doc"

      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v5