这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@leomaurodesenv
Copy link
Owner

feat: Add semantic-release for automated releases

Description

This pull request integrates python-semantic-release into the project to fully automate the versioning, changelog generation, and package publishing process. By adopting an automated release strategy, we can ensure consistency, reduce manual effort, and streamline the process of getting new features and fixes to users.

This setup leverages the Conventional Commits standard (which we are already using via commitizen) to automatically determine version bumps.

Key Changes

  • Dependency Addition:

    • python-semantic-release has been added to the [project.optional-dependencies.build] group in pyproject.toml.
  • Configuration:

    • A new [tool.semantic_release] section has been added to pyproject.toml to configure the tool's behavior, including the build command and branch settings.
  • New Release Workflow:

    • A new GitHub Actions workflow, .github/workflows/release.yml, has been created. This workflow is specifically designed to handle the release process.

How the New Workflow Works

  1. Trigger: The workflow is triggered manually when a new release is published on GitHub.
  2. Versioning & Building:
    • The build job checks out the code.
    • It runs semantic-release version, which automatically:
      • Determines the new version number based on commit history.
      • Updates the version in pyproject.toml.
      • Builds the sdist and wheel.
      • Commits the version change and tags the commit.
    • The resulting packages in dist/ are uploaded as artifacts.
  3. Deployment:
    • The deploy job, which runs after a successful build, downloads the package artifacts.
    • It uses uv publish to upload the new version to PyPI, using the UV_PUBLISH_TOKEN secret.

This new process replaces manual version bumping and publishing, creating a robust and automated CI/CD pipeline for releases.

@leomaurodesenv leomaurodesenv self-assigned this Jun 28, 2025
@leomaurodesenv leomaurodesenv added the enhancement New feature or request label Jun 28, 2025
@leomaurodesenv leomaurodesenv merged commit 8b52574 into main Jun 28, 2025
3 checks passed
@leomaurodesenv leomaurodesenv deleted the feat/semantic-release branch June 28, 2025 22:45
leomaurodesenv added a commit that referenced this pull request Jun 28, 2025
* feat(package): add build command

* feat(package): add changelog file

* feat(package): update release groups

* 1.0.0-alpha.1

Automatically generated by python-semantic-release

* fix(workflow): remove library publishing

* feat(workflow): add release pipeline

* feat(github): add codeowners

* feat(release): update changelog file

* fix(github): codeowners author

* feat(release): update auto-commit

---------

Co-authored-by: semantic-release <semantic-release>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants