From 8a46e61f75e3f0aff2c0ff46a1711395c508e436 Mon Sep 17 00:00:00 2001 From: Simon Priet <105607989+SimonPistache@users.noreply.github.com> Date: Thu, 6 Mar 2025 12:14:04 +0100 Subject: [PATCH] ci(#202): Add Auto Release GHA and Enforce Conventional Commit GHA (#213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci(#202): 👷 Start working on CI Add Semantic Release for automating Releasing versions * ci(#202): 👷 Add Conventional Commit Validation * ci(#202): Change dependency from 1 to v1 * ci(#202): Change dependency wording * ci(#202): Change dependency version to 1.4.1 * ci: Change naming * ci(#202): Update CI to use FG-PAT Set the semantic-release to ignore for CC "^ci" message, Set a fine-grained personal access token for my account to let the bot work on my behalf on my repository, Add permissions to the bot to write on pull-requests, issues, and commit content on main. --- .github/workflows/auto-release.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/pr-cc.yml | 16 +++++++++++++ .releaserc.yml | 9 ++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/auto-release.yml create mode 100644 .github/workflows/pr-cc.yml create mode 100644 .releaserc.yml diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 0000000..61f5e06 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,36 @@ +name: Automatic Release +run-name: Release a new version of the icon pack on PR's merging + +on: + pull_request: + types: + - merged + branches: + - main + +jobs: + semantic-release: + if: "!startsWith(github.event.head_commit.message, 'ci')" + + name: Semantic Release + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + + steps: + # Checkout data from the repository + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + persist-credentials: false + + # Run Semantic-release-action with the included release + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + id: semantic # Need an `id` for output variables + env: + # Use admin FG-PAT + GITHUB_TOKEN: ${{ secrets.RELEABOT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pr-cc.yml b/.github/workflows/pr-cc.yml new file mode 100644 index 0000000..7ba7c47 --- /dev/null +++ b/.github/workflows/pr-cc.yml @@ -0,0 +1,16 @@ +name: Conventional Commit +run-name: Enforce that PR name follow Conventional Commits + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + Validate: + runs-on: ubuntu-latest + steps: + - name: PR Conventional Commit Validation + uses: ytanikin/pr-conventional-commits@1.4.1 + with: + task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]' + add_label: 'false' \ No newline at end of file diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..1ed17ff --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,9 @@ +plugins: + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" +# - "@semantic-release/changelog" + - "@semantic-release/git" + - "@semantic-release/github" + +branches: + - main \ No newline at end of file