Skip to content

Commit 59e46c9

Browse files
committed
fix(ci): Adapt workflow for Python Semantic Release v7 -> v9
Python Semantic Release V8 brought changes where releases were no longer pushed to Github/PyPI. As such, we need to update our workflows. https://python-semantic-release.readthedocs.io/en/latest/migrating_from_v7.html
1 parent 44a5446 commit 59e46c9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/main.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
needs: [test, lint]
6161

6262
steps:
63-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v4
6464
with:
6565
# You must set fetch-depth to 0 when using actions/checkout@v2, since
6666
# Python Semantic Release needs access to the full history to
@@ -70,6 +70,19 @@ jobs:
7070
- run: pip install packaging
7171

7272
- name: Python Semantic Release
73+
id: release
7374
uses: python-semantic-release/[email protected]
7475
with:
7576
github_token: ${{ secrets.GITHUB_TOKEN }}
77+
78+
- name: Publish package distributions to PyPI
79+
uses: pypa/gh-action-pypi-publish@release/v1
80+
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
81+
# See https://github.com/actions/runner/issues/1173
82+
if: steps.release.outputs.released == 'true'
83+
84+
- name: Publish package distributions to GitHub Releases
85+
uses: python-semantic-release/[email protected]
86+
if: steps.release.outputs.released == 'true'
87+
with:
88+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)