From c635ad6f957466c7818a18cb88570757ee1002b3 Mon Sep 17 00:00:00 2001
From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Date: Mon, 29 Jul 2024 13:52:03 +1000
Subject: [PATCH] CI: Add release-plz to release library crates (#1850)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Create release-plz.yml

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Disable release-plz for cargo-binstall

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

---------

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
---
 .github/workflows/release-plz.yml | 27 +++++++++++++++++++++++++++
 release-plz.toml                  |  3 +++
 2 files changed, 30 insertions(+)
 create mode 100644 .github/workflows/release-plz.yml
 create mode 100644 release-plz.toml

diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml
new file mode 100644
index 00000000..db2b1e0a
--- /dev/null
+++ b/.github/workflows/release-plz.yml
@@ -0,0 +1,27 @@
+name: Release-plz
+
+permissions:
+  pull-requests: write
+  contents: write
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  release-plz:
+    name: Release-plz
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+      - name: Install Rust toolchain
+        run: rustup toolchain install stable --no-self-update --profile minimal
+      - name: Run release-plz
+        uses: MarcoIeni/release-plz-action@v0.5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
diff --git a/release-plz.toml b/release-plz.toml
new file mode 100644
index 00000000..7103eb64
--- /dev/null
+++ b/release-plz.toml
@@ -0,0 +1,3 @@
+[[package]]
+name = "cargo-binstall"
+release = false # don't process this package