Skip to content

Commit a51617d

Browse files
arturfracalaArtur Fracala
andauthored
(DPS-4422) Add versioning to livechat-public-docs (#1543)
feat: setup semantic-release, commitlint, and GitHub Actions workflows Co-authored-by: Artur Fracala <[email protected]>
1 parent 84a8eb0 commit a51617d

File tree

8 files changed

+1507
-0
lines changed

8 files changed

+1507
-0
lines changed

.github/workflows/commitlint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Commitlint Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
commitlint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "14.20.0"
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run commitlint
24+
run: |
25+
npx commitlint --from=$(git merge-base origin/master HEAD) --to=HEAD

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20.17.0"
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run semantic-release
24+
run: npx semantic-release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit "$1"

.releaserc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/git",
9+
{
10+
"assets": ["package.json", "CHANGELOG.md"],
11+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12+
}
13+
]
14+
]
15+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ You can simulate the production build process locally by running.
4242

4343
In order to test your work before merging to master, **Netlify** provides **Deploy Preview**. When raising a PR, GitHub will provide **Netlify** notifications with the **Deploy Preview** url that can be found in the checks section.
4444

45+
## Versioning
46+
47+
Every change automatically updates the documentation version. Versions are built based on commit messages, so adherence to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is required.
48+
4549
## How to contribute
4650

4751
All contribution's welcome! [Read how to do it.](./CONTRIBUTING.md)

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ["@commitlint/config-conventional"] };

0 commit comments

Comments
 (0)