Skip to content

Commit a9d4087

Browse files
committed
chore: added semantic release integration
1 parent 9deae91 commit a9d4087

5 files changed

Lines changed: 428 additions & 29 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Release
3+
on:
4+
push:
5+
branches: [main]
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 0
17+
- name: install uv
18+
uses: astral-sh/setup-uv@v6
19+
with:
20+
python-version: "3.10"
21+
enable-cache: true
22+
- name: dependencies
23+
run: uv sync --locked --dev
24+
- name: release
25+
run: uv run semantic-release publish
26+
env:
27+
GH_TOKEN: ${{ github.token }}

.github/workflows/upload.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

justfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ set quiet
66
help:
77
just --list
88

9+
# bump version and release (dry-run on test PyPI)
10+
bump-test:
11+
uv run semantic-release publish --upload-to-index testpypi --no-commit --no-push
12+
13+
# bump version and release (prod)
14+
bump:
15+
uv run semantic-release publish
16+
917
# build package
1018
build:
1119
uv build

pyproject.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ homepage = "https://github.com/manchenkoff/openapi3-parser"
3232
source = "https://github.com/manchenkoff/openapi3-parser"
3333

3434
[dependency-groups]
35-
dev = ["mypy>=2.1.0", "pytest>=9.0.3", "pytest-cov>=6.1.0", "ruff>=0.15.13", "ty>=0.0.37"]
35+
dev = [
36+
"mypy>=2.1.0",
37+
"pytest>=9.0.3",
38+
"pytest-cov>=6.1.0",
39+
"python-semantic-release>=10.5.3",
40+
"ruff>=0.15.13",
41+
"ty>=0.0.37",
42+
]
3643

3744
[build-system]
3845
requires = ["uv_build>=0.11.12,<0.12"]
@@ -41,6 +48,18 @@ build-backend = "uv_build"
4148
[tool.uv.build-backend]
4249
module-name = "openapi_parser"
4350

51+
[tool.semantic_release]
52+
version_toml = ["pyproject.toml:project.version"]
53+
branch = "main"
54+
build_command = """
55+
uv lock --upgrade-package "$PACKAGE_NAME"
56+
git add uv.lock
57+
uv build
58+
"""
59+
upload_to_pypi = true
60+
upload_to_release = true
61+
remove_dist = true
62+
4463
[[tool.uv.index]]
4564
name = "testpypi"
4665
url = "https://test.pypi.org/simple/"

0 commit comments

Comments
 (0)