Skip to content

Commit f32d505

Browse files
committed
[CHORE] add changelog github action, edit example output's rich box
1 parent e27071d commit f32d505

File tree

7 files changed

+286
-137
lines changed

7 files changed

+286
-137
lines changed

.github/changelog-ci-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
changelog_type: 'commit_message' # or 'pull_request'
2+
header_prefix: 'Version:'
3+
commit_changelog: true
4+
comment_changelog: true
5+
include_unlabeled_changes: true
6+
unlabeled_group_title: 'Unlabeled Changes'
7+
pull_request_title_regex: '^Release'
8+
version_regex: 'v?([0-9]{1,2})+[.]+([0-9]{1,2})+[.]+([0-9]{1,2})\s\(\d{1,2}-\d{1,2}-\d{4}\)'
9+
exclude_labels:
10+
- bot
11+
- dependabot
12+
- ci
13+
group_config:
14+
- title: Bug Fixes
15+
labels:
16+
- bug
17+
- bugfix
18+
- FIX
19+
- fix
20+
- title: Code Improvements
21+
labels:
22+
- improvements
23+
- enhancement
24+
- ADD
25+
- add
26+
- title: New Features
27+
labels:
28+
- feature
29+
- FEAT
30+
- feat
31+
- title: Documentation Updates
32+
labels:
33+
- docs
34+
- documentation
35+
- doc
36+
- DOCS
37+
- title: Template Updates
38+
labels:
39+
- template
40+
- TEMPLATE
41+
- TEMPLATES
42+
- templates

.github/workflows/changelog.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Changelog CI
2+
3+
on:
4+
pull_request:
5+
types: [ opened ]
6+
7+
# Optionally you can use `workflow_dispatch` to run Changelog CI Manually
8+
workflow_dispatch:
9+
inputs:
10+
release_version:
11+
description: 'Set Release Version'
12+
required: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
# Checks-out your repository
20+
- uses: actions/checkout@v2
21+
22+
- name: Run Changelog CI
23+
uses: saadmk11/changelog-ci@v1.1.2
24+
with:
25+
# Optional, only required when you want more customization
26+
# e.g: group your changelog by labels with custom titles,
27+
# different version prefix, pull request title and version number regex etc.
28+
# config file can be in JSON or YAML format.
29+
config_file: changelog-ci-config.yaml
30+
# Optional, only required when you want to run Changelog CI
31+
# on an event other than `pull_request` event.
32+
# In this example `release_version` is fetched from `workflow_dispatch` events input.
33+
# You can use any other method to fetch the release version
34+
# such as environment variable or from output of another action
35+
release_version: ${{ github.event.inputs.release_version }}
36+
# Optional
37+
github_token: ${{ secrets.GITHUB_TOKEN }}

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ rules:
1919
ignore: |
2020
.github/dependabot.yml
2121
.github/release-drafter.yml
22+
.github/changelog-ci-config.yaml

README.md

Lines changed: 148 additions & 86 deletions
Large diffs are not rendered by default.

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{!CHANGELOG.md!}

docs/index.md

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ Enter the author name: John Doe
5656
Enter the author email: john@example.com
5757
Enter the project description: My awesome FastAPI project
5858

59-
60-
Project Information
59+
Project Information
6160
┌──────────────┬────────────────────────────┐
6261
│ Project Name │ my-awesome-project │
6362
│ Author │ John Doe │
@@ -74,7 +73,6 @@ Available Stacks and Dependencies:
7473
│ Dependency 4 │ pydantic-settings │
7574
└──────────────┴───────────────────┘
7675

77-
7876
STANDARD Stack
7977
┌──────────────┬───────────────────┐
8078
│ Dependency 1 │ fastapi │
@@ -86,7 +84,6 @@ Available Stacks and Dependencies:
8684
│ Dependency 7 │ pydantic-settings │
8785
└──────────────┴───────────────────┘
8886

89-
9087
FULL Stack
9188
┌──────────────┬───────────────────┐
9289
│ Dependency 1 │ fastapi │
@@ -100,16 +97,17 @@ Available Stacks and Dependencies:
10097
│ Dependency 9 │ pydantic-settings │
10198
└──────────────┴───────────────────┘
10299

103-
104100
Select stack (minimal, standard, full): minimal
105101
Do you want to proceed with project creation? [y/N]: y
106102
FastAPI project will deploy at '~your-project-path~'
107-
╭─────────────────────────── Info ────────────────────────────╮
108-
│ ℹ Injected metadata into setup.py │
109-
╰─────────────────────────────────────────────────────────────╯
110-
╭─────────────────────────── Info ────────────────────────────╮
111-
│ ℹ Injected metadata into config file │
112-
╰─────────────────────────────────────────────────────────────╯
103+
104+
╭──────────────────────── Info ────────────────────────╮
105+
│ ℹ Injected metadata into setup.py │
106+
╰──────────────────────────────────────────────────────╯
107+
╭──────────────────────── Info ────────────────────────╮
108+
│ ℹ Injected metadata into config file │
109+
╰──────────────────────────────────────────────────────╯
110+
113111
Creating Project:
114112
my-awesome-project
115113
┌───────────────────┬───────────┐
@@ -119,32 +117,36 @@ FastAPI project will deploy at '~your-project-path~'
119117
│ pydantic │ ✓ │
120118
│ pydantic-settings │ ✓ │
121119
└───────────────────┴───────────┘
120+
122121
Creating virtual environment...
123-
╭─────────────────────────── Info ────────────────────────────╮
124-
│ ℹ venv created at │
125-
│ ~your-project-path~/my-awesome-project/.venv │
126-
│ To activate the virtual environment, run: │
127-
│ │
128-
│ source │
129-
│ ~your-project-path~/my-awesome-project/.venv/bin/activate │
130-
╰─────────────────────────────────────────────────────────────╯
122+
123+
╭──────────────────────── Info ────────────────────────╮
124+
│ ℹ venv created at │
125+
│ ~your-project-path~/my-awesome-project/.venv │
126+
│ To activate the virtual environment, run: │
127+
│ │
128+
│ source │
129+
│ ~your-project-path~/my-awesome-project/.venv/bin/act │
130+
│ ivate │
131+
╰──────────────────────────────────────────────────────╯
132+
131133
Installing dependencies...
132134
⠙ Setting up project environment...Collecting <packages~>
133135

134136
---> 100%
135137

136-
╭────────────────────────── Success ──────────────────────────╮
137-
│ ✨ Dependencies installed successfully
138-
╰─────────────────────────────────────────────────────────────
139-
╭────────────────────────── Success ──────────────────────────╮
140-
│ ✨ FastAPI project 'my-awesome-project' has been created
141-
│ successfully and saved to
142-
│ ~your-project-path~!
143-
╰─────────────────────────────────────────────────────────────
144-
╭─────────────────────────── Info ────────────────────────────╮
145-
│ ℹ To start your project, run 'fastkit runserver' at newly
146-
│ created FastAPI project directory
147-
╰─────────────────────────────────────────────────────────────
138+
╭─────────────────────── Success ───────────────────────╮
139+
│ ✨ Dependencies installed successfully │
140+
╰───────────────────────────────────────────────────────╯
141+
╭─────────────────────── Success ───────────────────────╮
142+
│ ✨ FastAPI project 'my-awesome-project' has been
143+
created successfully and saved to │
144+
│ ~your-project-path~! │
145+
╰───────────────────────────────────────────────────────╯
146+
╭──────────────────────── Info ────────────────────────╮
147+
│ ℹ To start your project, run 'fastkit runserver' at │
148+
newly created FastAPI project directory │
149+
╰──────────────────────────────────────────────────────╯
148150
```
149151

150152
</div>
@@ -169,13 +171,14 @@ $ fastkit addroute my-awesome-project user
169171
└──────────────────┴──────────────────────────────────────────┘
170172

171173
Do you want to add route 'user' to project 'my-awesome-project'? [Y/n]: y
172-
╭─────────────────────────── Info ────────────────────────────╮
173-
│ ℹ Updated main.py to include the API router │
174-
╰─────────────────────────────────────────────────────────────╯
175-
╭────────────────────────── Success ──────────────────────────╮
176-
│ ✨ Successfully added new route 'user' to project │
177-
│ `my-awesome-project` │
178-
╰─────────────────────────────────────────────────────────────╯
174+
175+
╭──────────────────────── Info ────────────────────────╮
176+
│ ℹ Updated main.py to include the API router │
177+
╰──────────────────────────────────────────────────────╯
178+
╭─────────────────────── Success ───────────────────────╮
179+
│ ✨ Successfully added new route 'user' to project │
180+
│ `my-awesome-project` │
181+
╰───────────────────────────────────────────────────────╯
179182
```
180183

181184
</div>
@@ -200,7 +203,6 @@ Deploying FastAPI project using 'fastapi-default' template
200203
Template path:
201204
/~fastapi_fastkit-package-path~/fastapi_project_template/fastapi-default
202205

203-
204206
Project Information
205207
┌──────────────┬─────────────────────────┐
206208
│ Project Name │ my-awesome-demo │
@@ -209,7 +211,6 @@ Template path:
209211
│ Description │ My awesome FastAPI demo │
210212
└──────────────┴─────────────────────────┘
211213

212-
213214
Template Dependencies
214215
┌──────────────┬───────────────────┐
215216
│ Dependency 1 │ fastapi │
@@ -224,13 +225,14 @@ FastAPI template project will deploy at '~your-project-path~'
224225

225226
---> 100%
226227

227-
╭────────────────────────── Success ──────────────────────────╮
228-
│ ✨ Dependencies installed successfully │
229-
╰─────────────────────────────────────────────────────────────╯
230-
╭────────────────────────── Success ──────────────────────────╮
231-
│ ✨ FastAPI project 'my-awesome-demo' from 'fastapi-default' │
232-
│ has been created and saved to ~your-project-path~! │
233-
╰─────────────────────────────────────────────────────────────╯
228+
╭─────────────────────── Success ───────────────────────╮
229+
│ ✨ Dependencies installed successfully │
230+
╰───────────────────────────────────────────────────────╯
231+
╭─────────────────────── Success ───────────────────────╮
232+
│ ✨ FastAPI project 'my-awesome-demo' from │
233+
│ 'fastapi-default' has been created and saved to │
234+
│ ~your-project-path~! │
235+
╰───────────────────────────────────────────────────────╯
234236
```
235237

236238
</div>

mkdocs.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ plugins:
4444
# Material for MkDocs
4545
- search
4646

47+
nav:
48+
- Home: index.md
49+
- Changelog: changelog.md
50+
4751
markdown_extensions:
4852
# Python Markdown
4953
- abbr
@@ -52,13 +56,13 @@ markdown_extensions:
5256
- md_in_html
5357
- mdx_include
5458
# PyMdown Extensions
55-
- pymdownx.highlight:
59+
- pymdownx.highlight: # necessary for code blocks & termynal
5660
anchor_linenums: true
5761
line_spans: __span
5862
pygments_lang_class: true
59-
- pymdownx.inlinehilite
60-
- pymdownx.snippets
61-
- pymdownx.superfences
63+
- pymdownx.inlinehilite # necessary for code blocks & termynal
64+
- pymdownx.snippets # necessary for code blocks & termynal
65+
- pymdownx.superfences # necessary for code blocks & termynal
6266

6367
extra_css:
6468
- css/termynal.css

0 commit comments

Comments
 (0)