Skip to content

Commit f32e6fe

Browse files
author
phernandez
committed
chore: add github actions release workflow
1 parent 5ad08fb commit f32e6fe

File tree

3 files changed

+200
-7
lines changed

3 files changed

+200
-7
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_type:
6+
description: 'Type of version bump (major, minor, patch)'
7+
required: true
8+
default: 'patch'
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
release:
15+
types: [published]
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
concurrency: release
21+
permissions:
22+
id-token: write
23+
contents: write
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Install uv
32+
run: |
33+
curl -LsSf https://astral.sh/uv/install.sh | sh
34+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
35+
36+
- name: Python Setup
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: "3.10"
40+
41+
- name: Install dependencies
42+
run: |
43+
uv pip install ".[dev]"
44+
45+
- name: Release
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
49+
run: semantic-release publish

pyproject.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ dev = [
9595
"isort>=5.13.0",
9696
"mypy>=1.8.0",
9797
"ruff>=0.2.0",
98+
"python-semantic-release>=9.14.0",
9899
]
99100

100101
# Full install with all features
@@ -137,4 +138,16 @@ style = "default"
137138
[tool.pytest.ini_options]
138139
testpaths = ["tests"]
139140
python_files = ["test_*.py"]
140-
addopts = "-ra -q"
141+
addopts = "-ra -q"
142+
143+
144+
[tool.semantic_release]
145+
version_variable = "basic_components/__init__.py:__version__"
146+
version_toml = "pyproject.toml:project.version"
147+
major_on_zero = false
148+
branch = "main"
149+
changelog_file = "CHANGELOG.md"
150+
build_command = "uv build"
151+
dist_path = "dist/"
152+
upload_to_pypi = true
153+
commit_message = "chore(release): {version} [skip ci]"

uv.lock

Lines changed: 137 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)