Skip to content

Commit a91381a

Browse files
committed
fix: ci workflow for semantic releases
1 parent aebf9cb commit a91381a

7 files changed

Lines changed: 378 additions & 14 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Setup Project with Python and UV
2+
3+
runs:
4+
using: composite
5+
6+
steps:
7+
- uses: actions/checkout@v6
8+
9+
- uses: actions/setup-python@v6
10+
with:
11+
python-version: "3.12"
12+
13+
- uses: astral-sh/setup-uv@v6
14+
15+
- run: uv sync --frozen --dev
16+
shell: bash

.github/workflows/ci.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ on:
77
branches: ["**"]
88

99
jobs:
10-
lint:
10+
commitizen:
1111
runs-on: ubuntu-latest
1212

13-
container:
14-
image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
15-
1613
steps:
17-
- uses: actions/checkout@v6
14+
- uses: ./.github/actions/setup-project
1815

19-
- name: Install dependencies
20-
run: uv sync --dev
16+
- run: cz check --rev-range origin/main..HEAD
17+
18+
lint:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: ./.github/actions/setup-project
2123

2224
- name: Lint
2325
run: uv run ruff check
@@ -31,14 +33,8 @@ jobs:
3133
test:
3234
runs-on: ubuntu-latest
3335

34-
container:
35-
image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
36-
3736
steps:
38-
- uses: actions/checkout@v6
39-
40-
- name: Install dependencies
41-
run: uv sync --dev
37+
- uses: ./.github/actions/setup-project
4238

4339
- name: Test
4440
run: uv run pytest -v --cov=app --cov-report=xml --cov-report=term-missing --cov-fail-under=95

.github/workflows/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "pip"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release Drafter
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
jobs:
11+
update_release_draft:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: release-drafter/release-drafter@v6
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
19+
categories:
20+
- title: Features
21+
labels:
22+
- feature
23+
24+
- title: Bug Fixes
25+
labels:
26+
- bug

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: ./.github/actions/setup-project
17+
18+
- env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: semantic-release version
21+

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ project-includes = [
4242
"**/*.ipynb",
4343
]
4444

45+
[tool.commitizen]
46+
name = "cz_conventional_commits"
47+
version = "0.1.0"
48+
version_files = [
49+
"pyproject.toml"
50+
]
51+
4552
[dependency-groups]
4653
dev = [
4754
"ruff>=0.15.11",
@@ -52,4 +59,6 @@ dev = [
5259
"schemathesis>=4.17.0",
5360
"openapi-spec-validator>=0.7.1",
5461
"pyrefly>=1.0.0",
62+
"commitizen>=4.16.3",
63+
"python-semantic-release>=9.21.1",
5564
]

0 commit comments

Comments
 (0)