Skip to content

feat(ci): automate semantic versioning and publishing#49

Open
srgfrancisco wants to merge 1 commit into
mainfrom
feat/automated-semver-release
Open

feat(ci): automate semantic versioning and publishing#49
srgfrancisco wants to merge 1 commit into
mainfrom
feat/automated-semver-release

Conversation

@srgfrancisco

Copy link
Copy Markdown
Owner

Summary

  • Replace manual version bumping and tag-triggered publishing with fully automated semver workflow using python-semantic-release
  • On every merge to main, conventional commits are analyzed to determine bump type (patch/minor/major), version is bumped in pyproject.toml, tagged, published to PyPI, and a GitHub Release is created
  • If only chore/docs/ci commits exist since last tag, no release is created

Changes

  • New .github/workflows/release.yml — test + semantic-release + PyPI publish + GitHub Release
  • Added [tool.semantic_release] config to pyproject.toml
  • Changed ddogctl/cli.py — dynamic version via importlib.metadata (single source of truth in pyproject.toml)
  • Removed stale __version__ = "1.0.0" from ddogctl/__init__.py
  • Removed .github/workflows/publish.yml (superseded by release.yml)
  • Removed publish job from .github/workflows/ci.yml, scoped CI to pull_request only
  • Updated CLAUDE.md releasing section

Manual setup required after merge

  1. Create a fine-grained PAT (Contents: Read & Write for srgfrancisco/ddogctl)
  2. Store as RELEASE_TOKEN in repo secrets
  3. Update branch protection to allow bypass for release commits
  4. Update PyPI trusted publisher: workflow publish.ymlrelease.yml, job release

Test plan

  • All 680 tests pass
  • black --check clean
  • ruff check clean
  • After merge: verify release workflow triggers on push to main
  • After merge: verify no release when only chore commits present
  • After merge: verify version bump + tag + PyPI publish on feat/fix commits

…antic-release

Replace manual version bumping and tag-triggered publishing with fully automated
semver workflow. On every merge to main, python-semantic-release analyzes
conventional commits to determine bump type, updates pyproject.toml, creates a
tag, publishes to PyPI, and creates a GitHub Release.

- Add release.yml workflow with test + semantic-release + PyPI publish
- Configure python-semantic-release in pyproject.toml
- Use importlib.metadata for dynamic version in cli.py (single source of truth)
- Remove stale __version__ from __init__.py
- Remove redundant publish.yml and publish job from ci.yml
- Scope ci.yml to pull_request only (release.yml handles push-to-main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant