Skip to content

Commit 60c88b0

Browse files
authored
feat: add release management (#26)
* feat: add commit lint to PRs Signed-off-by: Chris Butler <[email protected]> * fix: add release workflow Signed-off-by: Chris Butler <[email protected]> * fix: add release actions pipeline Signed-off-by: Chris Butler <[email protected]> * chore: add gitignore Signed-off-by: Chris Butler <[email protected]> --------- Signed-off-by: Chris Butler <[email protected]>
1 parent 7838291 commit 60c88b0

File tree

6 files changed

+6396
-1
lines changed

6 files changed

+6396
-1
lines changed

.github/workflows/conventional-pr.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Lint PR title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
branches:
10+
- 'main'
11+
- 'develop'
12+
jobs:
13+
lint:
14+
if: ${{ github.head_ref != 'develop' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Install dependencies
21+
run: npm install @commitlint/cli @commitlint/config-conventional
22+
23+
- name: Validate PR title
24+
run: |
25+
PR_TITLE=$(jq -r '.pull_request.title' "$GITHUB_EVENT_PATH")
26+
echo "$PR_TITLE" | npx commitlint --config commitlint.config.js

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # Required for creating releases/tags
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Required for semantic-release to access all commits
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 'lts/*'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run semantic-release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: npx semantic-release

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ install-config.yaml
1616
azure-env.sh
1717
.openshift*
1818
.DS_Store
19-
openshift-install
19+
openshift-install
20+
node_modules

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

0 commit comments

Comments
 (0)