From 47978504fa468d491931b8b7f4170fe73dd4189a Mon Sep 17 00:00:00 2001
From: saleel <saleel@saleel.xyz>
Date: Fri, 4 Oct 2024 14:34:37 +0530
Subject: [PATCH] chore: add release-please (#12)

---
 .github/workflows/pull-request-title.yml | 30 ++++++++++++++++++++++++
 .github/workflows/release.yml            | 21 +++++++++++++++++
 .gitignore                               |  3 +++
 .release-please-manifest.json            |  1 +
 release-please-config.json               | 16 +++++++++++++
 5 files changed, 71 insertions(+)
 create mode 100644 .github/workflows/pull-request-title.yml
 create mode 100644 .github/workflows/release.yml
 create mode 100644 .gitignore
 create mode 100644 .release-please-manifest.json
 create mode 100644 release-please-config.json

diff --git a/.github/workflows/pull-request-title.yml b/.github/workflows/pull-request-title.yml
new file mode 100644
index 0000000..901d76a
--- /dev/null
+++ b/.github/workflows/pull-request-title.yml
@@ -0,0 +1,30 @@
+name: Pull Request
+
+on:
+  merge_group:
+  pull_request_target:
+    types:
+      - opened
+      - reopened
+      - edited
+      - synchronize
+
+permissions:
+  pull-requests: read
+
+jobs:
+  conventional-title:
+    name: Validate PR title is Conventional Commit
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check title
+        if: github.event_name == 'pull_request_target'
+        uses: amannn/action-semantic-pull-request@v5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          types: |
+            fix
+            feat
+            chore
+          
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..0e24c81
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,21 @@
+name: Release
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  release-please:
+    name: Create Release
+    outputs:
+      release-pr: ${{ steps.release.outputs.pr }}
+      tag-name: ${{ steps.release.outputs.tag_name }}
+    runs-on: ubuntu-latest
+    steps:
+      - name: Run release-please
+        id: release
+        uses: google-github-actions/release-please-action@v3
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          command: manifest
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..452406a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+target
+.DS_Store
+.vscode
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 0000000..6643111
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1 @@
+{".": "0.2.1"}
diff --git a/release-please-config.json b/release-please-config.json
new file mode 100644
index 0000000..e33ce20
--- /dev/null
+++ b/release-please-config.json
@@ -0,0 +1,16 @@
+{
+  "release-type": "simple",
+  "bump-minor-pre-major": true,
+  "bump-patch-for-minor-pre-major": true,
+  "pull-request-title-pattern": "chore: Release ${version}",
+  "group-pull-request-title-pattern": "chore: Release ${version}",
+  "packages": {
+    ".": {
+      "release-type": "simple",
+      "include-component-in-tag": false
+    }
+  },
+  "plugins": [
+    "sentence-case"
+  ]
+}