Skip to content

Commit cf067d4

Browse files
authored
fix: bump semantic release (#236)
* fix: bump semantic release * fix: bump versioning and add environment * fix: move if check * fix: some other version bumps
1 parent 44ed817 commit cf067d4

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- uses: wagoid/[email protected].4
23+
- uses: wagoid/[email protected].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/[email protected]
3232

3333
test:
@@ -47,7 +47,7 @@ jobs:
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/[email protected]
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+
uses: pypa/[email protected]
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

Comments
 (0)