6
6
- main
7
7
pull_request :
8
8
9
+ concurrency :
10
+ group : ${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress : true
12
+
9
13
jobs :
10
14
lint :
11
15
runs-on : ubuntu-latest
12
16
steps :
13
- - uses : actions/checkout@v2
14
- - uses : actions/setup-python@v2
17
+ - uses : actions/checkout@v4
18
+ - uses : actions/setup-python@v5
15
19
with :
16
- python-version : " 3.11"
17
- - uses : pre-commit/action@v2.0.3
20
+ python-version : 3.x
21
+ - uses : pre-commit/action@v3.0.0
22
+
23
+ # Make sure commit messages follow the conventional commits convention:
24
+ # https://www.conventionalcommits.org
25
+ commitlint :
26
+ name : Lint Commit Messages
27
+ runs-on : ubuntu-latest
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+ with :
31
+ fetch-depth : 0
32
+ - uses : wagoid/commitlint-github-action@v5.4.4
18
33
19
34
test :
20
35
strategy :
@@ -28,57 +43,63 @@ jobs:
28
43
- ubuntu-latest
29
44
runs-on : ${{ matrix.os }}
30
45
steps :
31
- - uses : actions/checkout@v2
46
+ - uses : actions/checkout@v4
32
47
- name : Set up Python
33
- uses : actions/setup-python@v2
48
+ uses : actions/setup-python@v5
34
49
with :
35
50
python-version : ${{ matrix.python-version }}
36
- - uses : snok/install-poetry@v1
51
+ - uses : snok/install-poetry@v1.3.4
37
52
- name : Install Dependencies
38
53
run : poetry install
54
+ shell : bash
39
55
- name : Test with Pytest
40
- run : poetry run pytest --cov=./aiosteamist --cov-report=xml --cov-report=term-missing tests/test_init.py
56
+ run : poetry run pytest --cov-report=xml
57
+ shell : bash
41
58
- name : Upload coverage to Codecov
42
- uses : codecov/codecov-action@v2
59
+ uses : codecov/codecov-action@v3
43
60
with :
44
61
token : ${{ secrets.CODECOV_TOKEN }}
45
62
46
- docs :
47
- runs-on : ubuntu-latest
48
- steps :
49
- - uses : actions/checkout@v2
50
- - name : Set up Python
51
- uses : actions/setup-python@v2
52
- with :
53
- python-version : " 3.9"
54
- - uses : snok/install-poetry@v1
55
- - name : Install Dependencies
56
- run : poetry install -E docs
57
- - name : Build docs
58
- working-directory : docs
59
- run : poetry run make html
60
-
61
63
release :
62
- runs-on : ubuntu-latest
63
- environment : release
64
- if : github.ref == 'refs/heads/main'
65
64
needs :
66
65
- test
67
66
- lint
67
+ - commitlint
68
+
69
+ runs-on : ubuntu-latest
70
+ environment : release
71
+ concurrency : release
72
+ permissions :
73
+ id-token : write
74
+ contents : write
68
75
69
76
steps :
70
77
- uses : actions/checkout@v4
71
78
with :
72
79
fetch-depth : 0
80
+ ref : ${{ github.head_ref || github.ref_name }}
81
+
82
+ # Do a dry run of PSR
83
+ - name : Test release
84
+ uses : python-semantic-release/python-semantic-release@v8.7.2
85
+ if : github.ref_name != 'main'
86
+ with :
87
+ root_options : --noop
88
+
89
+ # On main branch: actual PSR + upload to PyPI & GitHub
90
+ - name : Release
91
+ uses : python-semantic-release/python-semantic-release@v8.7.2
92
+ id : release
93
+ if : github.ref_name == 'main'
94
+ with :
95
+ github_token : ${{ secrets.GITHUB_TOKEN }}
96
+
97
+ - name : Publish package distributions to PyPI
98
+ uses : pypa/gh-action-pypi-publish@release/v1
99
+ if : steps.release.outputs.released == 'true'
73
100
74
- # Run semantic release:
75
- # - Update CHANGELOG.md
76
- # - Update version in code
77
- # - Create git tag
78
- # - Create GitHub release
79
- # - Publish to PyPI
80
- - name : Python Semantic Release
81
- uses : relekang/python-semantic-release@v7.34.3
101
+ - name : Publish package distributions to GitHub Releases
102
+ uses : python-semantic-release/upload-to-gh-release@main
103
+ if : steps.release.outputs.released == 'true'
82
104
with :
83
105
github_token : ${{ secrets.GITHUB_TOKEN }}
84
- pypi_token : ${{ secrets.PYPI_TOKEN }}
0 commit comments