tiffwrite 2026.5.1

Write BioFormats/ImageJ compatible tiffs with zstd compression in parallel.
Documentation
name: Publish

on: [workflow_dispatch]

permissions:
  contents: read

jobs:
  publish_pytest:
    uses: ./.github/workflows/pytest.yml
  publish_cargo_test:
    uses: ./.github/workflows/cargo_test.yml
  crates_io_publish:
    needs: [ publish_pytest, publish_cargo_test ]
    name: Publish (crates.io)
    runs-on: ubuntu-latest
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@v6
      - name: Restore cache
        uses: actions/cache/restore@v4
        with:
          path: |
            ~/.cargo
          key: cache-ubuntu-cargo-publish

      - name: Install Rust
        run: |-
          export PATH="$HOME/.cargo/bin:$PATH"
          if ! command -v rustc >/dev/null 2>&1; then
            curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          else
            rustup update
          fi
          cargo install cargo-release
        shell: bash

      # allow-branch HEAD is because GitHub actions switches
      # to the tag while building, which is a detached head

      # Publishing is currently messy, because:
      #
      # * `peace_rt_model_core` exports `NativeError` or `WebError` depending on the target.
      # * `peace_rt_model_web` fails to build when publishing the workspace for a native target.
      # * `peace_rt_model_web` still needs its dependencies to be published before it can be
      #    published.
      # * `peace_rt_model_hack` needs `peace_rt_model_web` to be published before it can be
      #    published.
      #
      # We *could* pass through `--no-verify` so `cargo` doesn't build the crate before publishing,
      # which is reasonable, since this job only runs after the Linux, Windows, and WASM builds
      # have passed.
      - name: "cargo release publish"
        run: |-
          export PATH="$HOME/.cargo/bin:$PATH"
          cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
          cargo release \
            publish \
            --workspace \
            --all-features \
            --allow-branch "main" \
            --no-confirm \
            --no-verify \
            --execute

      - name: Store cache
        uses: actions/cache/save@v4
        with:
          path: |
            ~/.cargo
          key: cache-ubuntu-cargo-publish