Skip to content

Commit 0c86b69

Browse files
committed
fix: Use official python-semantic-release actions
1 parent 6e7e99d commit 0c86b69

2 files changed

Lines changed: 21 additions & 26 deletions

File tree

.github/workflows/semantic-release.yaml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,33 @@ jobs:
1414
name: Release
1515
needs: [pre-commit, tests]
1616
runs-on: ubuntu-latest
17+
concurrency: release
1718
permissions:
18-
contents: write
19-
issues: write
20-
pull-requests: write
19+
id-token: write
2120
steps:
2221
- name: Checkout
2322
uses: actions/checkout@v4
2423
with:
25-
ssh-key: ${{ secrets.DEPLOY_KEY }}
24+
#ssh-key: ${{ secrets.DEPLOY_KEY }}
2625
fetch-depth: 0
2726

28-
- name: Setup Python
29-
uses: actions/setup-python@v5
27+
#- name: Setup Python
28+
# uses: actions/setup-python@v5
29+
# with:
30+
# python-version: "3.11"
31+
32+
- name: Python Semantic Release
33+
id: release
34+
uses: python-semantic-release/python-semantic-release@v9.21.1
3035
with:
31-
python-version: "3.11"
36+
github_token: ${{ secrets.DEPLOY_KEY }}
3237

33-
- name: Install uv and sync dev dependencies
34-
run: |
35-
pip install uv
36-
uv venv
37-
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
38-
echo "$PWD/.venv/bin" >> $GITHUB_PATH
39-
uv sync --dev
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@v1
40+
if: steps.release.outputs.released == 'true'
4041

41-
- name: Release
42-
env:
43-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
45-
run: |
46-
semantic-release version
47-
semantic-release publish
42+
- name: Publish package distributions to GitHub Releases
43+
uses: python-semantic-release/publish-action@v9.21.1
44+
if: steps.release.outputs.released == 'true'
45+
with:
46+
github_token: ${{ secrets.DEPLOY_KEY }}

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ reports = "no"
6767
score = "no"
6868

6969
[tool.semantic_release]
70-
version_toml = [
71-
"pyproject.toml:project.version"
72-
]
70+
version_toml = ["pyproject.toml:project.version"]
7371
branch = "main"
74-
upload_to_pypi = true
75-
upload_to_release = true
7672
build_command = "uv build"
7773
tag_format = "{version}"
7874
commit_version_number = true

0 commit comments

Comments
 (0)