From 06ab3dfaeb440a5de8686e0e8b479d1cf3369c39 Mon Sep 17 00:00:00 2001 From: saleel Date: Fri, 4 Oct 2024 14:37:22 +0530 Subject: [PATCH] chore: add release-please (#7) --- .github/workflows/pull-request-title.yml | 30 ++++++++++++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++ .gitignore | 2 ++ .release-please-manifest.json | 1 + release-please-config.json | 16 +++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 .github/workflows/pull-request-title.yml create mode 100644 .github/workflows/release.yml 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 index eb5a316..27f1a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ target +**/.DS_Store +.vscode diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b881a39 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{".":"0.1.0"} 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" + ] +}