nsfw 0.2.0

A Rust library for detecting NSFW images using a neural network.
Documentation
name: Release

on:
  push:
    tags: ["v*.*.*"]

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    uses: ./.github/workflows/test.yml
    secrets: inherit

  release_model:
    name: Add model to release
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Download model artifact
        uses: actions/download-artifact@v4
        with:
          name: model

      - name: Upload release asset
        uses: softprops/action-gh-release@v1
        with:
          files: model.onnx
          body: |
            The only file in this release is the model, `model.onnx`.
            See [the documentation](https://docs.rs/nsfw) for how to use it.
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

      - run: rustup toolchain install stable --profile minimal

      - run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}