Skip to content

Commit ef7629d

Browse files
author
Benjamin Kasser
committed
Add GitHub Actions workflow for automatic semantic release
1 parent 5055156 commit ef7629d

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
semantic-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # wichtig für Tags/History
17+
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.x"
21+
cache: "pip"
22+
23+
- name: Install tools
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install python-semantic-release build
27+
28+
- name: Semantic Release (bump version, tag, GitHub release)
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
semantic-release version
33+
semantic-release publish

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ https-login = "https_login.server:main"
2626
package-dir = {"" = "src"}
2727

2828
[tool.setuptools.packages.find]
29-
where = ["src"]
29+
where = ["src"]
30+
31+
[tool.semantic_release]
32+
version_toml = ["pyproject.toml:project.version"]
33+
version_variables = ["src/https_login/__init__.py:__version__"]
34+
branch = "main"
35+
tag_format = "v{version}"
36+
commit_message = "chore(release): {version} [skip ci]"
37+
upload_to_pypi = false
38+
upload_to_release = true
39+
build_command = "python -m build"

0 commit comments

Comments
 (0)