update: release.py tags a Debian revision other than 1 as x.y.z-n.
Release / release (push) Successful in 19s

This commit is contained in:
slawek committed 2026-10-25 17:32:48 +01:00
1 parent 4a5b15a559
commit bf651da5a6
2 files changed
+16 -5

No files matched your search

+6 -5
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
"""Commit everything, tag the version of the newest changelog entry and push main with the tags.
The tag is the upstream version of the first entry of debian-package/debian/changelog,
without the Debian revision: vpn-router (0.5.1-1) is tagged 0.5.1, which starts the
release workflow.
The tag is the version of the first entry of debian-package/debian/changelog, without the
Debian revision 1: vpn-router (0.5.1-1) is tagged 0.5.1 and (0.5.1-2) 0.5.1-2. The tag
starts the release workflow.
"""
import argparse
@@ -48,13 +48,14 @@ def summary():
def version():
"""The upstream version of the first changelog entry."""
"""The tag of the first changelog entry: its version, without the Debian revision when that is 1."""
first = CHANGELOG.read_text(encoding='utf-8').splitlines()[0]
start, end = first.find('('), first.find(')')
if start == -1 or end < start:
sys.exit(f'{CHANGELOG}: the first line has no version: {first}')
full = first[start + 1:end]
return full.rsplit('-', 1)[0] if '-' in full else full
upstream, _, revision = full.rpartition('-')
return upstream if upstream and revision == '1' else full
def main():