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
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,83 @@ jobs:
activate-environment: true
- name: Build package
run: uv build

# Test semantic-release configuration on PR branches
test-release:
name: Test Semantic Release
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Git for Semantic Release Testing
run: |
# Setup a temp branch to test
git checkout -B temp-main-branch
git merge ${{ github.event.pull_request.head.sha }} --no-edit
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Test Semantic Release (No-op)
id: test-release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
changelog: true
# Use noop mode to test without making changes
no_operation_mode: true
- name: Test Semantic Release (Dry Run)
id: test-release-dry
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
changelog: true
# Use dry run mode to test without committing
commit: false
tag: false
push: false
vcs_release: false
release:
runs-on: ubuntu-latest
needs:
- test
concurrency: release
if: github.ref == 'refs/heads/main'
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
actions: write
packages: write
environment:
name: release

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ secrets.GH_TOKEN }}
changelog: true

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
with:
packages-dir: dist
print-hash: true
verbose: true

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/publish-action@v10.5.3
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
6 changes: 5 additions & 1 deletion commitlint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export default {
// Disable the rule that enforces lowercase in subject
"subject-case": [0], // 0 = disable, 1 = warn, 2 = error
// Disable the rule that enforces a maximum line length in the body
"body-max-line-length": [0, "always"]
"body-max-line-length": [0, "always"],
// Disable header max length for AI-generated commits
"header-max-length": [0],
// Disable the rule that prevents periods at the end of subjects
"header-full-stop": [0]
},

};
12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@ dev = [
[tool.semantic_release]
branch = "main"
version_toml = ["pyproject.toml:project.version"]
build_command = "pip install uv && uv lock --upgrade-package python-roborock && git add uv.lock && uv build"
build_command = "pip install uv && uv lock --upgrade-package harbor-python && git add uv.lock && uv build"
changelog_file = 'CHANGELOG.md'
commit = true

[tool.semantic_release.branches.main]
match = "main"
prerelease = false

[tool.semantic_release.commit_parser_options]
allowed_tags = [
"chore",
"docs",
"feat",
"fix",
"refactor"
]
major_tags= ["refactor"]

[tool.ruff]
lint.ignore = ["F403", "E741"]
lint.select=["E", "F", "UP", "I"]
Expand Down
Loading