Skip to content

Commit

Permalink
ci: adds setup for release-please and commit linting (#297)
Browse files Browse the repository at this point in the history
* ci: enforce convention commits for PR titles

Signed-off-by: Jennifer Power <[email protected]>

* chore: add an initial release please configuration and workflow

Signed-off-by: Jennifer Power <[email protected]>

---------

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 authored Aug 5, 2024
1 parent c7bfe71 commit 32ecd92
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/conventional-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint PR title

on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- 'main'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4

- name: Install dependencies
run: npm install @commitlint/cli @commitlint/config-conventional

- name: Validate PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx commitlint --config commitlint.config.js
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Draft a Trestle-Bot release PR

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # 4.1.3
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.10.1"
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
33 changes: 33 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"packages": {
".": {
"release-type": "python",
"include-v-in-tag": true,
"bump-minor-pre-major": true,
"draft": true,
"changelog-path": "CHANGELOG.md",
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "Maintenance",
"hidden": false
},
{
"ci": "ci",
"section": "Infrastructure",
"hidden": false
}
]
}
}
}

0 comments on commit 32ecd92

Please sign in to comment.