File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ concurrency:
11
11
cancel-in-progress : true
12
12
13
13
jobs :
14
+ # Make sure commit messages follow the conventional commits convention:
15
+ # https://www.conventionalcommits.org
16
+ commitlint :
17
+ name : Lint Commit Messages
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - uses : actions/checkout@v3
21
+ with :
22
+ fetch-depth : 0
23
+
24
+
14
25
test :
15
26
strategy :
16
27
fail-fast : false
36
47
- name : Test with Pytest
37
48
run : poetry run pytest
38
49
shell : bash
50
+ release :
51
+ runs-on : ubuntu-latest
52
+ environment : release
53
+ if : github.ref == 'refs/heads/main'
54
+ needs :
55
+ - test
56
+
57
+ steps :
58
+ - uses : actions/checkout@v3
59
+ with :
60
+ fetch-depth : 0
61
+
62
+ # Run semantic release:
63
+ # - Update CHANGELOG.md
64
+ # - Update version in code
65
+ # - Create git tag
66
+ # - Create GitHub release
67
+ # - Publish to PyPI
68
+ - name : Python Semantic Release
69
+
70
+ with :
71
+ github_token : ${{ secrets.GH_TOKEN }}
72
+ pypi_token : ${{ secrets.PYPI_TOKEN }}
Original file line number Diff line number Diff line change @@ -28,3 +28,8 @@ build-backend = "poetry.core.masonry.api"
28
28
pytest-asyncio = " *"
29
29
pytest = " *"
30
30
31
+ [tool .semantic_release ]
32
+ branch = " main"
33
+ version_toml = " pyproject.toml:tool.poetry.version"
34
+ version_variable = " setup.py:__version__"
35
+ build_command = " pip install poetry && poetry build"
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ # This is a shim to allow GitHub to detect the package, build is done with poetry
4
+ # Taken from https://github.com/Textualize/rich
5
+
6
+ import setuptools
7
+
8
+ __version__ = "0.1.10"
9
+
10
+ if __name__ == "__main__" :
11
+ setuptools .setup (name = "roborock" , version = __version__ )
You can’t perform that action at this time.
0 commit comments