---
name: "Release Rust 🦀"
on:
  workflow_dispatch:
  push:
    branches:
      - "master"

jobs:
  release_rust:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: arduino/setup-protoc@v3
      - uses: katyo/publish-crates@v2
        with:
          path: './cln-rpc'
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          ignore-unpublished-changes: true
      - uses: katyo/publish-crates@v2
        with:
          path: './plugins'
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          ignore-unpublished-changes: true
      - uses: katyo/publish-crates@v2
        with:
          path: './cln-grpc'
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          ignore-unpublished-changes: true
