Skip to content

Commit dbcbdf2

Browse files
committed
Add semantic release configuration and update workflows for automated versioning and changelog generation
1 parent 88eb403 commit dbcbdf2

File tree

4 files changed

+12563
-6455
lines changed

4 files changed

+12563
-6455
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: Release
1+
name: Semantic Release
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
push:
5+
branches: [main]
76

87
jobs:
9-
release:
10-
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
13-
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: "20"
23-
cache: "npm"
24-
25-
- name: Install dependencies
26-
run: npm ci
27-
28-
- name: Build action
29-
run: npm run build
30-
31-
- name: Type check
32-
run: npm run typecheck
33-
34-
- name: Run tests
35-
run: npm test
36-
37-
- name: Create Release
38-
uses: softprops/action-gh-release@v1
39-
with:
40-
files: |
41-
dist/**
42-
action.yml
43-
README.md
44-
LICENSE
45-
generate_release_notes: true
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
release:
9+
name: Release version
10+
permissions:
11+
contents: write
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version-file: '.nvmrc'
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build action
30+
run: npm run build
31+
32+
- name: Type check
33+
run: npm run typecheck
34+
35+
- name: Run tests
36+
run: npm test
37+
38+
- name: Semantic Release
39+
uses: cycjimmy/semantic-release-action@v4.1.0
40+
with:
41+
extra_plugins: |
42+
@semantic-release/changelog
43+
@semantic-release/commit-analyzer
44+
@semantic-release/git
45+
@semantic-release/npm
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { Options } from 'semantic-release';
2+
3+
const config: Options = {
4+
branches: ['main'],
5+
repositoryUrl: 'git+https://github.com/doorloop/docloop-ai',
6+
plugins: [
7+
[
8+
'@semantic-release/commit-analyzer',
9+
{
10+
preset: 'angular',
11+
releaseRules: [
12+
{ type: 'chore', release: 'minor' },
13+
{ type: 'feat', release: 'minor' },
14+
{ type: 'fix', release: 'patch' },
15+
{ type: 'perf', release: 'patch' },
16+
{ type: 'breaking', release: 'major' },
17+
],
18+
},
19+
],
20+
'@semantic-release/release-notes-generator',
21+
'@semantic-release/changelog',
22+
['@semantic-release/npm', { npmPublish: false }],
23+
[
24+
'@semantic-release/git',
25+
{
26+
assets: ['package.json', 'CHANGELOG.md'],
27+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
28+
},
29+
],
30+
'@semantic-release/github',
31+
],
32+
};
33+
34+
export default config;

0 commit comments

Comments
 (0)