Skip to main content

semvertag

PyPI version Supported Python versions Downloads Coverage CI License GitHub stars Context7 uv Ruff ty

Auto-tag your GitLab or GitHub repository with semantic version tags from CI — one tool, two strategies, two providers.

Install

uvx semvertag tag

Use it in GitLab CI

Paste this job into your .gitlab-ci.yml:

stages: [tag]

semvertag:
  stage: tag
  image: python:3.13-slim
  variables:
    SEMVERTAG_STRATEGY: branch-prefix  # or: conventional-commits
  before_script:
    - pip install --quiet 'uv>=0.4,<1'
  script:
    - uvx 'semvertag>=0.5.0,<1' tag
  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'

It runs uvx semvertag tag against your repo on the default branch. semvertag inspects the head commit + tag history, decides the appropriate semver bump, and creates the new tag via the GitLab API.

A one-line include: - component: … via the GitLab CI Catalog will replace this snippet once the component is published. For now, paste the job inline.

Use it in GitHub Actions

Paste this workflow into .github/workflows/semvertag.yml:

name: semvertag
on:
  push:
    branches: [main]

permissions:
  contents: write

jobs:
  tag:
    runs-on: ubuntu-latest
    steps:
      - uses: modern-python/semvertag@v0

semvertag auto-detects GitHub Actions, picks the bump from the latest commit, and creates the tag ref via the GitHub API. It never reads the working tree, so the job needs no actions/checkout step at all. See GitHub Actions docs for token scopes, GitHub Enterprise setup, outputs, and troubleshooting.

Strategies

  • branch-prefix (default): the head commit on the default branch must be a merge commit whose source branch starts with feature/ (minor), bugfix/, or hotfix/ (patch).
  • conventional-commits: parses the head commit's Conventional Commits header (feat: minor, fix:/perf: patch, ! or BREAKING CHANGE: major).

Both are configurable via env vars. See docs for the full configuration surface.

Built with

semvertag stands on other modern-python libraries:

  • modern-di-typer — dependency-injection wiring for the Typer CLI. semvertag resolves its settings, API providers, and bump strategies through a modern_di container (semvertag/ioc.py).
  • httpware — the resilient HTTP client both providers use for the GitLab/GitHub REST calls (retries, timeouts, typed decoding, secret redaction).

📚 Documentation

📦 PyPI

📝 License

Part of modern-python

Browse the full list of templates and libraries in modern-python — see the org profile for the categorized index.

Metadata

Release files for semvertag 0.8.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semvertag 0.8.6
File Size Uploaded
semvertag-0.8.6.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for semvertag 0.8.6
File Interpreter ABI Platform
semvertag-0.8.6-py3-none-any.whl Python 3 none any Details

Total release size: 41.6 kB

Release files / semvertag-0.8.6.tar.gz

Download URL semvertag-0.8.6.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c2f4bf67be11b81e0cc2d4ea61cce59e6884bef701e519e49eee368b70958522
BLAKE2b-256 checksum
How to use checksums
624f23ff308753d3a2d871c815739870ebf8ceb8a90641973ffd612c51f1750f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / semvertag-0.8.6-py3-none-any.whl

Download URL semvertag-0.8.6-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be12ea71d4155387b1d22797bb0fff2da4e8fd0fd092d6c89fb98a67c0953253
BLAKE2b-256 checksum
How to use checksums
1277552854f2a61114e74421adfbc9c01d7aecc9cb395f5d7c0e5555133e605c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.9.0

2 release files

This release

0.8.6 This release

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page