Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ jobs:
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: 🔧 setup uv
uses: ./.github/uv
- name: 📜 semantic release version & publish on PyPI
run: |
RET_CODE=0
uv run semantic-release --strict version || RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
next_version=$(uv run semantic-release version --print)
last_released_version=$(uv run semantic-release version --print-last-released)
if [[ "$next_version" == "$last_released_version" ]]; then
echo "🙅🏽 Nothing to publish"
else
uv run semantic-release --strict version
echo "🙆🏽 Publishing on PyPI"
uv build
uv run twine upload dist/*
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,16 @@ env = "GH_TOKEN"
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
allow_zero_version = true
commit_message = """\
chore(release): v{version}

Automatically generated by python-semantic-release
"""

[tool.semantic_release.commit_parser_options]
patch_tags = ["fix", "perf", "build"]
minor_tags = ["feat"]
patch_tags = ["build", "ci", "docs", "fix", "perf", "refactor", "style", "test"]
other_allowed_tags = ["chore"]

[tool.semantic_release.changelog]
mode = "init"
Expand Down
Loading