meebis 0.6.0

A fast, disposable, in-memory Redis-compatible server for ephemeral dev work
name: Release Please

on:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

jobs:
  # Maintains a "release PR" that accrues changelog entries and the next
  # version from Conventional Commits. Merging that PR creates the git tag and
  # a *draft* GitHub Release (see draft/force-tag-creation in
  # release-please-config.json).
  #
  # This uses a PAT rather than the default GITHUB_TOKEN on purpose: a tag
  # pushed by GITHUB_TOKEN does NOT trigger other workflows, so the tag-driven
  # `release.yml` (dist) would never run. The PAT must have contents:write on
  # this repo. dist then builds the binaries, uploads them to the draft
  # release, and undrafts it (create-release = false in dist-workspace.toml).
  release-please:
    runs-on: ubuntu-latest
    outputs:
      release_created: ${{ steps.release.outputs.release_created }}
      tag_name: ${{ steps.release.outputs.tag_name }}
    steps:
      - uses: googleapis/release-please-action@v4
        id: release
        with:
          token: ${{ secrets.RELEASE_PLEASE_TOKEN }}

  # Publish the crate to crates.io when a release is cut. Independent of the
  # prebuilt binaries — those are built and attached to the GitHub Release by
  # dist in `release.yml`, triggered by the tag above.
  publish-crate:
    needs: release-please
    if: ${{ needs.release-please.outputs.release_created == 'true' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Publish to crates.io
        run: cargo publish --locked
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}