@@ -20,14 +20,14 @@ jobs:
2020 - uses : actions/checkout@v4
2121 with :
2222 fetch-depth : 0
23- - uses : wagoid/commitlint-github-action@v5.4.4
23+ - uses : wagoid/commitlint-github-action@v5.4.5
2424 lint :
2525 runs-on : ubuntu-latest
2626 steps :
2727 - uses : actions/checkout@v4
2828 - uses : actions/setup-python@v5
2929 with :
30- python-version : " 3.10 "
30+ python-version : " 3.11 "
3131 - uses : pre-commit/action@v3.0.0
3232
3333 test :
4747 uses : actions/setup-python@v5
4848 with :
4949 python-version : ${{ matrix.python-version }}
50- - uses : snok/install-poetry@v1.3.4
50+ - uses : snok/install-poetry@v1.4.1
5151 - name : Install Dependencies
5252 run : poetry install
5353 shell : bash
@@ -56,30 +56,38 @@ jobs:
5656 shell : bash
5757 release :
5858 runs-on : ubuntu-latest
59- environment : release
6059 needs :
6160 - 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/
6268
6369 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- uses : relekang/python-semantic-release@v7.34.6
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/python-semantic-release@v7.34.6
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/python-semantic-release@v8.7.0
77+ with :
78+ github_token : ${{ secrets.GITHUB_TOKEN }}
79+
80+ - name : Publish package distributions to PyPI
81+ uses : pypa/gh-action-pypi-publish@v1.12.2
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/upload-to-gh-release@v8.7.0
91+ if : steps.release.outputs.released == 'true'
92+ with :
93+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments