@@ -20,14 +20,14 @@ jobs:
20
20
- uses : actions/checkout@v4
21
21
with :
22
22
fetch-depth : 0
23
- -
uses :
wagoid/[email protected] .4
23
+ -
uses :
wagoid/[email protected] .5
24
24
lint :
25
25
runs-on : ubuntu-latest
26
26
steps :
27
27
- uses : actions/checkout@v4
28
28
- uses : actions/setup-python@v5
29
29
with :
30
- python-version : " 3.10 "
30
+ python-version : " 3.11 "
31
31
-
uses :
pre-commit/[email protected]
32
32
33
33
test :
47
47
uses : actions/setup-python@v5
48
48
with :
49
49
python-version : ${{ matrix.python-version }}
50
- - uses : snok/install-poetry@v1.3.4
50
+ - uses : snok/install-poetry@v1.4.1
51
51
- name : Install Dependencies
52
52
run : poetry install
53
53
shell : bash
@@ -56,30 +56,38 @@ jobs:
56
56
shell : bash
57
57
release :
58
58
runs-on : ubuntu-latest
59
- environment : release
60
59
needs :
61
60
- test
61
+ concurrency : release
62
+ if : github.ref == 'refs/heads/main'
63
+ permissions :
64
+ id-token : write
65
+ environment :
66
+ name : pypi
67
+ url : https://pypi.org/project/python-roborock/
62
68
63
69
steps :
64
- - uses : actions/checkout@v4
65
- with :
66
- fetch-depth : 0
67
- persist-credentials : false
68
- # Run semantic release:
69
- # - Update CHANGELOG.md
70
- # - Update version in code
71
- # - Create git tag
72
- # - Create GitHub release
73
- # - Publish to PyPI
74
- - name : Python Semantic Release
75
-
76
- if : github.ref == 'refs/heads/main'
77
- with :
78
- github_token : ${{ secrets.GH_TOKEN }}
79
- repository_username : __token__
80
- repository_password : ${{ secrets.PYPI_TOKEN }}
81
- - name : Test release
82
- uses :
python-semantic-release/[email protected]
83
- if : github.ref_name != 'main'
84
- with :
85
- additional_options : --noop
70
+ - uses : actions/checkout@v4
71
+ with :
72
+ fetch-depth : 0
73
+
74
+ - name : Python Semantic Release
75
+ id : release
76
+ uses :
python-semantic-release/[email protected]
77
+ with :
78
+ github_token : ${{ secrets.GITHUB_TOKEN }}
79
+
80
+ - name : Publish package distributions to PyPI
81
+
82
+ with :
83
+ password : ${{ secrets.PYPI_TOKEN }}
84
+
85
+ # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
86
+ # See https://github.com/actions/runner/issues/1173
87
+ if : steps.release.outputs.released == 'true'
88
+
89
+ - name : Publish package distributions to GitHub Releases
90
+ uses :
python-semantic-release/[email protected]
91
+ if : steps.release.outputs.released == 'true'
92
+ with :
93
+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments