diff --git a/.github/workflows/conventional-check.yaml b/.github/workflows/conventional-check.yaml new file mode 100644 index 0000000..6003d31 --- /dev/null +++ b/.github/workflows/conventional-check.yaml @@ -0,0 +1,47 @@ +name: Conventional Commit & PR + +on: + pull_request: + # For forked repositories: + # pull_request_target: + # You can add specific pull request types too. + # If this is omitted, the workflow will only executed on opened, synchronize, and reopened + # which is enough for generic use cases. + # Below is the list of supported pull request sub-events + # types: [opened, reopened, ready_for_review, unlocked, synchronize] + +jobs: + cpr: + name: Check PR for conventional style + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + # https://github.com/Namchee/conventional-pr + - uses: Namchee/conventional-pr@v0.12.1 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + close: false + issue: false + signed: false + label: invalid + commitlint: + name: Run commitlint on the PR + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + # https://github.com/ahmadnassri/action-commit-lint + - uses: ahmadnassri/action-commit-lint@v2.1.4 + + label: + name: Label PR derived from the conventional commit messages + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: label + # https://github.com/action-runner/conventional-labeler + uses: action-runner/conventional-labeler@2.0.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml index f504bf4..80c01d2 100644 --- a/.github/workflows/semantic-release.yaml +++ b/.github/workflows/semantic-release.yaml @@ -1,4 +1,4 @@ -name: Release +name: Semantic Release on: push: @@ -18,7 +18,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + # https://github.com/semantic-release/semantic-release + # https://github.com/cycjimmy/semantic-release-action + # Semantic Release dry run: + # https://github.com/traefik/faency/pull/309 - name: Semantic Release uses: cycjimmy/semantic-release-action@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + semantic_version: 19 + ci: true + dry_run: false + # You can specify specifying version range for the extra plugins if you prefer. + extra_plugins: | + @semantic-release/changelog@6.0.0 + @semantic-release/git diff --git a/.releaserc.yaml b/.releaserc.yaml index 5259793..46e5cbf 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -1,6 +1,57 @@ +--- branches: - "main" plugins: - - "@semantic-release/commit-analyzer" - - "@semantic-release/release-notes-generator" - - "@semantic-release/github" + - - "@semantic-release/commit-analyzer" + - releaseRules: + - type: revert + release: patch + - type: perf + release: patch + - type: build + scope: deps + release: patch + - type: docs + scope: README.md + release: patch + - scope: no-release + release: false + - - "@semantic-release/release-notes-generator" + - - "@semantic-release/changelog" + - changelogFile: CHANGELOG.md + changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." + - - "@semantic-release/git" + - message: "chore: Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + assets: + - CHANGELOG.md + - - "@semantic-release/github" + - assets: + - CHANGELOG.md +preset: conventionalcommits +presetConfig: + - types: + - type: feat + section": Features + - type: feature, + ssection": "Features" + - type: fix + section: Bug Fixes + - type: build + section": Updates to the Build System + hidden": false + - type: perf + section": "Performance Improvements" + - type: revert + section: Reverts + - type: docs + section: Documentation + - type: style + section: Styles + - type: chore + section: Miscellaneous Chores + - type: refactor + section: Code Refactoring + - type: test + section: Tests + - type: ci + section: Continuous Integration