Skip to content

Commit

Permalink
feat(GHA): add commitlint and semrel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Morelly committed Dec 12, 2024
1 parent e45fca8 commit b79d546
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 31 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint Commit Messages
on:
push:
branches:
- main
pull_request:

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5

Check failure on line 15 in .github/workflows/commitlint.yml

View workflow job for this annotation

GitHub Actions / run

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 15 in .github/workflows/commitlint.yml

View workflow job for this annotation

GitHub Actions / run

yaml[new-line-at-end-of-file]

No new line character at the end of file
31 changes: 0 additions & 31 deletions .github/workflows/monthly-snapshot.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Semantic Releaser
on:
push:
branches:
- main

permissions:
contents: write
packages: write
pull-requests: write

jobs:
semrel:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Check failure on line 26 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / run

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 26 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / run

yaml[new-line-at-end-of-file]

No new line character at the end of file
45 changes: 45 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"branches": [
"main",
"master"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
ignores: [(message) => /^Bumps \[.+]\(.+\) from .+ to .+\.$/m.test(message)],
}

0 comments on commit b79d546

Please sign in to comment.